"애플리케이션 그린-블루 롤아웃 수행"의 두 판 사이의 차이

15번째 줄: 15번째 줄:
$ vi /wonderful/v2.yaml
$ vi /wonderful/v2.yaml
</syntaxhighlight>
</syntaxhighlight>
<syntaxhighlight lang='yaml' line>
<syntaxhighlight lang='yaml' line highlight='6,12,17,20,37'>
apiVersion: apps/v1
apiVersion: apps/v1
kind: Deployment
kind: Deployment

2024년 6월 6일 (목) 15:15 판

1 개요

애플리케이션의 그린-블루 롤아웃 수행

2 시나리오

  • "wonderful" 애플리케이션이 default 네임스페이스에서 실행중이고, 애플리케이션 YAML은 /wonderful/init.yaml에 있음
  • 기존 애플리케이션을 바탕으로 새 Deployment wonderful-v2 생성
  • 단, 이미지는 nginx:alpine 사용, Pod에는 app: wonderfulversion: v2 레이블
  • 새 Pod이 실행되면, Service wonderfulversion: v2 레이블
  • Deployment wonderful-v1을 0 replicas로 스케일 다운

3 실습

$ cp /wonderful/init.yaml /wonderful/v2.yaml
$ vi /wonderful/v2.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: wonderful
  name: wonderful-v2
spec:
  replicas: 4
  selector:
    matchLabels:
      app: wonderful
      version: v2
  template:
    metadata:
      labels:
        app: wonderful
        version: v2
    spec:
      containers:
      - image: nginx:alpine
        name: httpd
---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: wonderful
  name: wonderful
spec:
  ports:
  - port: 80
    protocol: TCP
    targetPort: 80
    nodePort: 30080
  selector:
    app: wonderful
    version: v2
  type: NodePort
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}