Pod의 작업을 유지한 채 수정
예시 (Trouble Shooting)
오류 식별
1 2 3
master@k8s-master:~/kubernetes$ kubectl get pods NAME READY STATUS RESTARTS AGE redis 0/1 ImagePullBackOff 0 19m
- 오류 분석
- 하단의 이벤트 로그를 통해 Image Pulling 실패 식별
1 2 3 4 5 6 7 8 9 10 11 12 13 14
master@k8s-master:~/kubernetes$ kubectl describe pods redis Name: redis ... Events: Type Reason Age From Message ---- ------ ---- ---- ------- Normal Scheduled 21m default-scheduler Successfully assigned default/redis to k8s-node1 Normal Pulling 20m (x4 over 21m) kubelet Pulling image "redis123" Warning Failed 20m (x4 over 21m) kubelet Failed to pull image "redis123": rpc error: code = Unknown desc = Error response from daemon: pull access denied for redis123, repository does not exist or may require 'docker login': denied: requested access to the resource is denied Warning Failed 20m (x4 over 21m) kubelet Error: ErrImagePull Warning Failed 19m (x6 over 21m) kubelet Error: ImagePullBackOff Normal BackOff 99s (x85 over 21m) kubelet Back-off pulling image "redis123"
- 해당 Pods 수정
- edit 명령어를 통해 수정 요청
- vi 편집기에서 오류에 해당하는 내용을 수정
1
kubectl edit pods redis