[Mock2_5] set deployment

유유·2023년 2월 1일
0

CKA

목록 보기
14/19

https://kubernetes.io/docs/concepts/workloads/controllers/deployment/

Create a new deployment called nginx-deploy, with image nginx:1.16 and 1 replica. Next upgrade the deployment to version 1.17 using rolling update.


Deployment : nginx-deploy. Image: nginx:1.16

Image: nginx:1.16

Task: Upgrade the version of the deployment to 1:17

Task: Record the changes for the image upgrade

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deploy
  labels:
    app: nginx:1.16
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nginx:1.16
  template:
    metadata:
      labels:
        app: nginx:1.16
    spec:
      containers:
      - name: nginx
        image: nginx:1.16
        ports:
        - containerPort: 80
kubectl set image deployment/nginx-deploy nginx=nginx:1.17
profile
하이

0개의 댓글