In a deployment, you can describe the desired state for your application and Kubernetes will constantly check if this state is matched. A deployment will create ReplicaSets which then ensures that the desired number of pods are running. If a pod goes down due to an interruption, the ReplicaSets controller will notice that the desired state does not match the actual state, and a new pod will be created.

Deployment: application에 대한 원하는 상태를 명시하면 쿠버네티스가 계속 상태가 일치하는지 확인한다. deployment는 원하는 pod의 개수를 보증하는 ReplicaSets을 만든다. 만약 pod이 꺼진다면 ReplicaSets controller는 원하는 상태와 맞지 않음을 알리고 pod이 새로 생성된다.

Deployments offer:

Deployment가 제공하는 바:

Create a Deployment

  1. ⓘ Imperative: Use a CLI command to create a deployment
    1. 시작이 빠르지만 문제점이 있다. 어떤 룰 들이 적용되어 있는지 알기 어렵다.
  2. ⓓ Declarative: YAML (or JSON) 파일에 원하는 deployment 상태 명시 후 적용
    1. self-documenting. 모든 설정사항들이 파일에 있고, Git에서 관리될 수 있다. 여러 개발자들이 같은 deployment를 가질 수 있고, 히스토리를 알 수 있다.