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

잔글 (Jmnote님이 K8s 디플로이먼트 문서를 쿠버네티스 Deployment 문서로 이동했습니다)
 
(사용자 2명의 중간 판 19개는 보이지 않습니다)
1번째 줄: 1번째 줄:
{{다른뜻|디플로이먼트}}
==개요==
==개요==
;쿠버네티스 디플로이먼트, 디플로이먼트
;쿠버네티스 디플로이먼트, 디플로이먼트
;Kubernetes Deployment, Deployment
;Kubernetes Deployment, Deployment
* 복제된(replicated) 애플리케이션을 관리하는 API 객체
* 복제된(replicated) 애플리케이션을 관리하는 API 객체
* 각 레플리카는 각각 하나의 Pod로 대표되며, 그러한 Pod들은 클러스터 내 노드들에 걸쳐 배포됨
* 각 레플리카는 각각 하나의 Pod로 대표되며, 그러한 Pod들은 클러스터 내 노드들에 걸쳐 배포된다.
* [[k8s ReplicaSet|ReplicaSet]](+[[k8s Pod|Pod]])을 생성한다.
 
==예시==
<syntaxhighlight lang='yaml' line highlight='2'>
apiVersion: apps/v1
kind: Deployment
metadata:
  name: appname-deployment
spec:
  selector:
    matchLabels:
      app: appname
  template:
    metadata:
      labels:
        app: appname
    spec:
      containers:
      - name: appname
        image: gcr.io/google-containers/busybox
        resources:
          requests:
            memory: "32Mi"
            cpu: "100m"
          limits:
            memory: "128Mi"
            cpu: "500m"
        ports:
        - containerPort: 8080
</syntaxhighlight>
 
{{소스헤더|controllers/nginx-deployment.yaml}}
<syntaxhighlight lang='yaml' line highlight='2'>
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
</syntaxhighlight>
<syntaxhighlight 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
</syntaxhighlight>
<syntaxhighlight 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
</syntaxhighlight>
<syntaxhighlight lang='console'>
$ kubectl get deployments
NAME              DESIRED  CURRENT  UP-TO-DATE  AVAILABLE  AGE
nginx-deployment  3        3        3            3          18s
</syntaxhighlight>
<syntaxhighlight lang='console'>
$ kubectl get rs
NAME                          DESIRED  CURRENT  READY  AGE
nginx-deployment-2035384211  3        3        3      18s
</syntaxhighlight>
<syntaxhighlight 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
</syntaxhighlight>


==같이 보기==
==같이 보기==
{{z컬럼3|
* [[디플로이먼트]]
* [[쿠버네티스 Pod]]
* [[쿠버네티스 Pod]]
* [[쿠버네티스 Service]]
* [[쿠버네티스 StatefulSet]]
* [[쿠버네티스 용어]]
* [[쿠버네티스 용어]]
* [[디플로이먼트]]
* [[쿠버네티스 워크로드]]
* [[k8s deployment strategy]]
* [[kubectl get deployment]]
* [[kubectl get deployments]]
}}


==참고==
==참고==
14번째 줄: 106번째 줄:
* https://cloud.google.com/kubernetes-engine/docs/concepts/deployment
* https://cloud.google.com/kubernetes-engine/docs/concepts/deployment


[[분류: Kubernetes]]
[[분류:K8s Deployment]]

2022년 1월 17일 (월) 20:29 기준 최신판

  다른 뜻에 대해서는 디플로이먼트 문서를 참조하십시오.

1 개요[ | ]

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

2 예시[ | ]

apiVersion: apps/v1
kind: Deployment
metadata:
  name: appname-deployment
spec:
  selector:
    matchLabels:
      app: appname
  template:
    metadata:
      labels:
        app: appname
    spec:
      containers:
      - name: appname
        image: gcr.io/google-containers/busybox
        resources:
          requests:
            memory: "32Mi"
            cpu: "100m"
          limits:
            memory: "128Mi"
            cpu: "500m"
        ports:
        - containerPort: 8080
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 }}