본문 바로가기
SMALL

deployments5

Deployments - Pausing and Resuming a Deployment Pausing and Resuming a Deployment 운영 중인 Deployment를 pause 시킬 수 있음. pause한 뒤 실행시키는 update는 반영되지 않고 대기된다. 이후 resume했을 때 모든 변경 사항이 새로운 ReplicaSet에 반영되게 된다. 2021. 2. 10.
Deployments - Scaling a Deployment Scaling a Deployment 아래 명령어로 sacle 할 수 있음. kubectl scale deployment.v1.apps/nginx-deployment --replicas=10 기존 desired를 넘어가는 replicas도 되나? 됨. 어차피 새로운 rs로 만드는 거라. horizontal Pod autoscaling이 활성화되어 있다면 아래와 같이 cpu 사용율 기반의 autoscaling도 설정 가능. kubectl autoscale deployment.v1.apps/nginx-deployment --min=10 --max=15 --cpu-percent=80 Proportional scaling rollout 도중 autoscaler가 scale 할 경우 Deployment Contr.. 2021. 2. 10.
Deployments - Rolling Back a Deployment Rolling Back a Deployment rollout 될 때마다 rollout history가 남고 이를 이용해 롤백이 가능함. 여기서는 nginx 버전에 오타를 내고 배포하는 예시로 진행했음. 해당 버전이 아예 없어서 ImagePullBackOff 에러가 발생. Checking Rollout History of a Deployment 1. 먼저 아래 명령어로 revisions를 확인 kubectl rollout history deployment.v1.apps/nginx-deployment 2. 특정 revision의 상세 내용은 아래 명령어로 kubectl rollout history deployment.v1.apps/nginx-deployment --revision=2 Rolling Back .. 2021. 2. 10.
Deployments - Updating a Deployment Updating a Deployment Deployment's Pod template 변경이 있어야 rollout이 트리거 됨. 아래 명령어로 nginx image update 가능. --record 쓰면 .metadata.annotation[kubernetes.io/change-cause]에 명령어가 추가된다. kubectl set image deployment/nginx-deployment nginx=nginx:1.16.1 --record edit 명령어로 직접 vi로 yaml 수정하는 방법도 있음. kubectl edit deployment.v1.apps/nginx-deployment 업데이트 시에 설정된 replica 수의 최소 75% 이상의 pods 수를 유지하며, 최대 125%의 pods 수만.. 2021. 2. 10.