Kubernetes 1.6.1을 실행하는 3 개의 노드로 이루어진 클러스터를 가지고 있으며 각각 2 개의 CPU와 4G RAM을 가지고 있습니다.Kubernetes의 GC는 Expected Docker 컨테이너를 제거하지 않습니다.
컨테이너로 전달되는 환경 변수 값을 바꾸어 포드 템플릿 해시를 업데이트하여 동일한 Docker 태그로 내 애플리케이션을 지속적으로 재배포합니다.
sed "s/THIS_STRING_IS_REPLACED_DURING_BUILD/$(date)/g" nginx-deployment.yml | kubectl replace -f -
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: nginx-deployment
spec:
replicas: 3
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.7.9
ports:
- containerPort: 80
env:
- name: FOR_GODS_SAKE_PLEASE_REDEPLOY
value: 'THIS_STRING_IS_REPLACED_DURING_BUILD'
나는이 몇 백 번 할 경우에, 나는 더 이상 다시 배포 할 수 없습니다 - 새로운 포드는 보류 상태에 있습니다. kubectl get events
는 다음을 생성합니다
Events:
FirstSeen LastSeen Count From SubObjectPath Type Reason Message
--------- -------- ----- ---- ------------- -------- ------ -------
1h 50s 379 default-scheduler Warning
FailedScheduling No nodes are available that match all of the following predicates:: Insufficient pods (3).
을 동시에 내가 모든 KUBE 노드에서 200에 Exited의 nginx 컨테이너를 볼 수 있습니다.
kube-controller-manager 로그를 보면 PodGC가 일부 창을 삭제하려고 시도하지만 볼 수 없다는 것을 알 수 있습니다.
I0516 12:53:41.137311 1 gc_controller.go:175] Found unscheduled terminating Pod nginx-deployment-2927112463-qczvv not assigned to any Node. Deleting.
I0516 12:53:41.137320 1 gc_controller.go:62] PodGC is force deleting Pod: default:nginx-deployment-2927112463-qczvv
E0516 12:53:41.190592 1 gc_controller.go:177] pods "nginx-deployment-2927112463-qczvv" not found
I0516 12:53:41.195020 1 gc_controller.go:175] Found unscheduled terminating Pod nginx-deployment-3265736979-jrpzb not assigned to any Node. Deleting.
I0516 12:53:41.195048 1 gc_controller.go:62] PodGC is force deleting Pod: default:nginx-deployment-3265736979-jrpzb
E0516 12:53:41.238307 1 gc_controller.go:177] pods "nginx-deployment-3265736979-jrpzb" not found
내가 일어나는 것을 방지하기 위해 할 수있는 일이 있나요?