-
Kubernetes 기본기본 개념 정리하기web 2022. 11. 9. 03:25
쿠버네티스란? 컨테이너화된 애플리케이션의 자동 디플로이, 스케일링 등을 제공하는 관리시스템
목적은 여러 클러스터의 호스트 간에 애플리케이션 컨테이너의 배치, 스케일링, 운영을 자동화하기 위한 플랫폼을 제공하기 위함
도커랑 같이 자주 쓰인다.
예를 들어, 여러개의 리눅스 노드를 클러스터로 설정하고, 도커 어플리케이션 컨테이너를 띄우면 쿠버네티스가 (설정에 따라) n번째에 배치하고, 리플리카를 만들고 하는 것을 자동화 해준다.
파드Pods are the smallest deployable units of computing that you can create and manage in Kubernetes.
A Pod (as in a pod of whales or pea pod) is a group of one or more containers, with shared storage and network resources, and a specification for how to run the containers. A Pod's contents are always co-located and co-scheduled, and run in a shared context. A Pod models an application-specific "logical host": it contains one or more application containers which are relatively tightly coupled. In non-cloud contexts, applications executed on the same physical or virtual machine are analogous to cloud applications executed on the same logical host.
파드는 대체로 하나의 컨테이너를 띄워서 배포하는 단위이다. 하나의 파드로 묶이면 같이 움직인다.
파드를 띄우는 방법은 CLI 를 통해, 또는 yml 을 통해서가 있다.
Workload resources
디플로이먼트
A Deployment provides declarative updates for Pods and ReplicaSets.
You describe a desired state in a Deployment, and the Deployment Controller changes the actual state to the desired state at a controlled rate. You can define Deployments to create new ReplicaSets, or to remove existing Deployments and adopt all their resources with new Deployments.
Deployment 는 declarative state 를 정의하는 것이다. 예를 들어, 어떤 어플이 떠야 하고 replica 가 3개로 유지되야 한다고 declare 할 경우, replica 하나가 삭제되면 파드가 재시작된다.
시크릿
A Secret is an object that contains a small amount of sensitive data such as a password, a token, or a key. Such information might otherwise be put in a Pod specification or in a container image. Using a Secret means that you don't need to include confidential data in your application code.
Credential 을 저장할 때 쓸 수 있다.
서비스
An abstract way to expose an application running on a set of Pods as a network service.
With Kubernetes you don't need to modify your application to use an unfamiliar service discovery mechanism. Kubernetes gives Pods their own IP addresses and a single DNS name for a set of Pods, and can load-balance across them.
서비스의 종류에는 clusterIp, nodeport, loadbalance 등이 있다.
클러스터 내에서 사용할 IP, 외부에서 사용할 port (8080:80 이런거), 외부 로드밸런싱 등의 기능을 한다.
인그레스
An API object that manages external access to the services in a cluster, typically HTTP.
Ingress may provide load balancing, SSL termination and name-based virtual hosting.
HTTP 를 이용한 외부 접속을 가능하게 설정하는 기능이다.
'web' 카테고리의 다른 글
docker container exec -it <container_id> <command>작동 방식 (0) 2023.02.10