"쿠버네티스 Deployment"의 두 판 사이의 차이

29번째 줄: 29번째 줄:
         ports:
         ports:
         - containerPort: 80
         - containerPort: 80
</source>
<source lang='console'>
$ kubectl create -f  https://k8s.io/examples/controllers/nginx-deployment.yaml
$ kubectl get deployments
NAME              DESIRED  CURRENT  UP-TO-DATE  AVAILABLE  AGE
nginx-deployment  3        0        0            0          1s
</source>
<source lang='console'>
$ kubectl rollout status deployment/nginx-deployment
Waiting for rollout to finish: 2 out of 3 new replicas have been updated...
deployment.apps/nginx-deployment successfully rolled out
</source>
<source lang='console'>
$ kubectl get deployments
NAME              DESIRED  CURRENT  UP-TO-DATE  AVAILABLE  AGE
nginx-deployment  3        3        3            3          18s
</source>
<source lang='console'>
$ kubectl get rs
NAME                          DESIRED  CURRENT  READY  AGE
nginx-deployment-2035384211  3        3        3      18s
</source>
<source lang='console'>
$ kubectl get pods --show-labels
NAME                                READY    STATUS    RESTARTS  AGE      LABELS
nginx-deployment-2035384211-7ci7o  1/1      Running  0          18s      app=nginx,pod-template-hash=2035384211
nginx-deployment-2035384211-kzszj  1/1      Running  0          18s      app=nginx,pod-template-hash=2035384211
nginx-deployment-2035384211-qqcnn  1/1      Running  0          18s      app=nginx,pod-template-hash=2035384211
</source>
</source>



2018년 10월 11일 (목) 13:20 판

1 개요

쿠버네티스 디플로이먼트, 디플로이먼트
Kubernetes Deployment, Deployment
  • 복제된(replicated) 애플리케이션을 관리하는 API 객체
  • 각 레플리카는 각각 하나의 Pod로 대표되며, 그러한 Pod들은 클러스터 내 노드들에 걸쳐 배포됨

2 예시

controllers/nginx-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
  labels:
    app: nginx
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.15.4
        ports:
        - containerPort: 80
$ kubectl create -f  https://k8s.io/examples/controllers/nginx-deployment.yaml
$ kubectl get deployments
NAME               DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
nginx-deployment   3         0         0            0           1s
$ kubectl rollout status deployment/nginx-deployment
Waiting for rollout to finish: 2 out of 3 new replicas have been updated...
deployment.apps/nginx-deployment successfully rolled out
$ kubectl get deployments
NAME               DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
nginx-deployment   3         3         3            3           18s
$ kubectl get rs
NAME                          DESIRED   CURRENT   READY   AGE
nginx-deployment-2035384211   3         3         3       18s
$ kubectl get pods --show-labels
NAME                                READY     STATUS    RESTARTS   AGE       LABELS
nginx-deployment-2035384211-7ci7o   1/1       Running   0          18s       app=nginx,pod-template-hash=2035384211
nginx-deployment-2035384211-kzszj   1/1       Running   0          18s       app=nginx,pod-template-hash=2035384211
nginx-deployment-2035384211-qqcnn   1/1       Running   0          18s       app=nginx,pod-template-hash=2035384211

3 같이 보기

4 참고

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}