커맨드 기록 저장하기. 


$ kubectl apply -f kubernetes.yml  --record



커맨드 히스토리 보기

$ kubectl rollout history deployment in-config -n production

deployment.extensions/google-config

REVISION  CHANGE-CAUSE

1         kubectl apply --filename=kubernetes.yml --record=true




history의 revision 1으로 롤백도 할 수 있다. 


$ kubectl rollout history deployment in-config -n production --revision=1

deployment.extensions/in-config with revision #1

Pod Template:

  Labels: app=google-config

pod-template-hash=627459006

  Annotations: kubernetes.io/change-cause: kubectl apply --filename=kubernetes.yml --record=true

  Containers:

   google-config:

    Image: ..

    Port: 8080/TCP

    Host Port: 0/TCP

    Requests:

      cpu: 1

      memory: 1000Mi

    Liveness: http-get http://:8080/actuator/health delay=3s timeout=1s period=3s #success=1 #failure=3

    Environment: <none>

    Mounts: <none>

  Volumes: <none>



비슷하게 바로 직전으로 롤백할 수 있다.


$ kubectl rollout undo deployment  in-config -n production


Posted by '김용환'
,