我最初試圖運行一個似乎卡在CrashBackoffLoop中的Job。這裏曾是服務文件:Kubernetes有一噸錯誤狀態的錯誤狀態,似乎無法清除
apiVersion: batch/v1
kind: Job
metadata:
name: es-setup-indexes
namespace: elk-test
spec:
template:
metadata:
name: es-setup-indexes
spec:
containers:
- name: es-setup-indexes
image: appropriate/curl
command: ['curl -H "Content-Type: application/json" -XPUT http://elasticsearch.elk-test.svc.cluster.local:9200/_template/filebeat [email protected]/etc/filebeat/filebeat.template.json']
volumeMounts:
- name: configmap-volume
mountPath: /etc/filebeat/filebeat.template.json
subPath: filebeat.template.json
restartPolicy: Never
volumes:
- name: configmap-volume
configMap:
name: elasticsearch-configmap-indexes
我試圖刪除工作,但如果我跑以下命令時,它只會工作:運行時
kubectl delete job es-setup-indexes --cascade=false
之後,我注意到:
kubectl get pods -w
我會在錯誤狀態下得到一個TON的豆莢,我看不到清理它們的方法。這裏只是輸出的一個小樣本,當我運行Get莢:
es-setup-indexes-zvx9c 0/1 Error 0 20h
es-setup-indexes-zw23w 0/1 Error 0 15h
es-setup-indexes-zw57h 0/1 Error 0 21h
es-setup-indexes-zw6l9 0/1 Error 0 16h
es-setup-indexes-zw7fc 0/1 Error 0 22h
es-setup-indexes-zw9bw 0/1 Error 0 12h
es-setup-indexes-zw9ck 0/1 Error 0 1d
es-setup-indexes-zwf54 0/1 Error 0 18h
es-setup-indexes-zwlmg 0/1 Error 0 16h
es-setup-indexes-zwmsm 0/1 Error 0 21h
es-setup-indexes-zwp37 0/1 Error 0 22h
es-setup-indexes-zwzln 0/1 Error 0 22h
es-setup-indexes-zx4g3 0/1 Error 0 11h
es-setup-indexes-zx4hd 0/1 Error 0 21h
es-setup-indexes-zx512 0/1 Error 0 1d
es-setup-indexes-zx638 0/1 Error 0 17h
es-setup-indexes-zx64c 0/1 Error 0 21h
es-setup-indexes-zxczt 0/1 Error 0 15h
es-setup-indexes-zxdzf 0/1 Error 0 14h
es-setup-indexes-zxf56 0/1 Error 0 1d
es-setup-indexes-zxf9r 0/1 Error 0 16h
es-setup-indexes-zxg0m 0/1 Error 0 14h
es-setup-indexes-zxg71 0/1 Error 0 1d
es-setup-indexes-zxgwz 0/1 Error 0 19h
es-setup-indexes-zxkpm 0/1 Error 0 23h
es-setup-indexes-zxkvb 0/1 Error 0 15h
es-setup-indexes-zxpgg 0/1 Error 0 20h
es-setup-indexes-zxqh3 0/1 Error 0 1d
es-setup-indexes-zxr7f 0/1 Error 0 22h
es-setup-indexes-zxxbs 0/1 Error 0 13h
es-setup-indexes-zz7xr 0/1 Error 0 12h
es-setup-indexes-zzbjq 0/1 Error 0 13h
es-setup-indexes-zzc0z 0/1 Error 0 16h
es-setup-indexes-zzdb6 0/1 Error 0 1d
es-setup-indexes-zzjh2 0/1 Error 0 21h
es-setup-indexes-zzm77 0/1 Error 0 1d
es-setup-indexes-zzqt5 0/1 Error 0 12h
es-setup-indexes-zzr79 0/1 Error 0 16h
es-setup-indexes-zzsfx 0/1 Error 0 1d
es-setup-indexes-zzx1r 0/1 Error 0 21h
es-setup-indexes-zzx6j 0/1 Error 0 1d
kibana-kq51v 1/1 Running 0 10h
但是,如果我看我的工作沒有得到有關再這樣了:
$ kubectl get jobs --all-namespaces
NAMESPACE NAME DESIRED SUCCESSFUL AGE
kube-system configure-calico 1 1 46d
我也注意到, kubectl似乎反應緩慢。我不知道這些豆莢是不斷嘗試重新啓動還是處於某種不穩定的狀態,但如果有人能讓我知道如何排除故障,那麼這將非常棒,因爲我還沒有在kubernetes中遇到類似的問題。
庫貝信息:
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.1", GitCommit:"b0b7a323cc5a4a2019b2e9520c21c7830b7f708e", GitTreeState:"clean", BuildDate:"2017-04-03T20:44:38Z", GoVersion:"go1.7.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.1", GitCommit:"b0b7a323cc5a4a2019b2e9520c21c7830b7f708e", GitTreeState:"clean", BuildDate:"2017-04-03T20:33:27Z", GoVersion:"go1.7.5", Compiler:"gc", Platform:"linux/amd64"}
怎麼樣的輸出: $你是怎樣嘗試刪除莢kubectl描述莢 –
turkenh
? '你是什麼意思'它只會用'--cascade = false''?有錯誤嗎? – johnharris85
@turkenh所以我最終運行了這個命令。我看到他們運行的節點,進入這些節點並手動刪除所有與docker ps -a匹配的圖像。刪除舊容器後,似乎即使我手動刪除了它們,kubectl仍會報告它們。我不知道是否應該嘗試啓動更多節點並遷移到新節點並拆除舊節點,或者如果有辦法瞭解如何讓kube與狀態同步泊塢窗。 – xamox