Kubernetes

running pod 수정법

Devops mg 2023. 4. 26. 21:07

running 상태의 pod는 아래사항은 수정이 불가하다. 

- spec.container.image

- spec.initContainers.image

- spec.activeDeadlineSeconds

-spec.tolerations

 

따라서, 수정하면 아래처럼 에러가난다. 

해결방법은 2가지가 있다.

1. tmp 로 pod 수정

kubectl edit pod <pod name>

kubectl delete pod webapp

kubectl create -f /tmp/kubectl-edit-ccvrq.yaml

1-2. tmp, replace로 수정 

kubectl edit pod <pod name>

kubectl replace --force  -f /tmp/kubectl-edit-ccvrq.yaml

 

2. newpod.yaml 생성 

kubectl get pod webapp -o yaml > newpod.yaml

vi newpod.yaml

kubectl delete pod webapp

kubectl create -f newpod.yaml