[kubernetes]Error from server (BadRequest):container install-cni is not valid for pod kube-dns
安裝完 Flannel 網路元件之後,發現 pod kube-flannel 的狀態為 CrashLoopBackOff,執行命令檢視日誌,提示如下資訊:
Error from server (BadRequest): container install-cni is not valid for pod kube-dns-6f4fd4bdf-qdhqb
出現這個是因為 pod kube-flannel 啟動了兩個容器 kube-flannel 和 install-cni,檢視日誌時需要指定檢視那個容器,可通過命令 -c <container_name> 指定,例如: kubectl logs -f pods/kube-flannel-ds-vkdzw -c install-cni -n kube-system。通過命令可以看到報錯資訊如下:
+ cp -f /etc/kube-flannel/cni-conf.json /etc/cni/net.d/10-flannel.conf
cp: can't create '/etc/cni/net.d/10-flannel.conf': Permission denied
這個是因為容器跟主機檔案系統有互動操作,需要關閉 SELinux,執行如下命令即可:
[apps@mvxl1484 ~]$ sudo su -
[root@mvxl1484 ~]# setenforce 0
setenforce: SELinux is disabled
[root@mvxl1484 ~]# systemctl daemon-reload
檢視pod執行情況:
[apps@mvxl1484 ~]$ kubectl get pod --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system etcd-mvxl1484 1/1 Running 0 50m
kube-system kube-apiserver-mvxl1484 1/1 Running 0 50m
kube-system kube-controller-manager-mvxl1484 1/1 Running 0 50m
kube-system kube-dns-6f4fd4bdf-qdhqb 2/3 CrashLoopBackOff 21 50m
kube-system kube-flannel-ds-7248h 1/1 Running 0 38m
kube-system kube-flannel-ds-bzdg4 1/1 Running 0 38m
刪除有問題的pod,會自動重新安裝
[apps@mvxl1484 ~]$ kubectl delete pod kube-dns-6f4fd4bdf-qdhqb -n kube-system
pod "kube-dns-6f4fd4bdf-qdhqb" deleted
再看,已經正常
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system etcd-mvxl1484 1/1 Running 0 51m
kube-system kube-apiserver-mvxl1484 1/1 Running 0 51m
kube-system kube-controller-manager-mvxl1484 1/1 Running 0 51m
kube-system kube-dns-6f4fd4bdf-4jj56 2/3 Running 0 55s
kube-system kube-flannel-ds-7248h 1/1 Running 0 39m
kube-system kube-flannel-ds-bzdg4 1/1 Running 0 39m
相關文章
- kubernetes實踐之三十九:Pod初始化容器之Init ContainerAI
- kubernetes實踐之九:kube-dnsDNS
- An error from listenerError
- Error occurred while downloading files from admin server for deploymentErrorWhileServer
- Caused by: Error: ' ' is not a valid resource name characterError
- Kubernetes Pod驅逐策略
- Kubernetes Pod 全面知識
- Kubernetes:Pod總結(二)
- kubernetes container device interface (CDI)AIdev
- Kubernetes:28---pod託管(Job:任務型pod)
- ubuntu 16.04 下安裝kubernetes 1.6 之kube-dnsUbuntuDNS
- Kubernetes Pod OOM 排查日記OOM
- Kubernetes的Pod進階(十一)
- Kubernetes之Pod工作負載負載
- cURL error 52: Empty reply from server GitHub 三方登入報錯ErrorServerGithub
- kubernetes之初始容器(init container)AI
- kubernetes CNI(Container Network Inferface)AI
- [Jenkins]Error:403 No valid crumb was included in the requestJenkinsError
- ScalaSigParserError: Unexpected error: Not a valid class fileError
- Networking from the container's point of view 筆記AIView筆記
- pod》error:The dependency `` is not used in any concrete targetError
- kubernetes-pod驅逐機制
- 技術分享 | kubernetes pod 簡介
- 詳解Kubernetes Pod優雅退出
- Kubernetes-POD的健康檢查
- an error has occurred. - no valid devices were found...Errordev
- ERROR | [iOS] unknown: Encountered an unknown error (Could not find a `ios` simulator (valid values:ErroriOS
- kubernetes高階之pod安全策略
- 【一】kubernetes學習筆記-Pod概念筆記
- Kubernetes POD與NodePort服務釋出
- kubernetes實踐之二十二:Pod
- tar: Error exit delayed from previous errorsError
- api-server-pod-重啟失敗APIServer
- 開啟託管server報錯:Cannot read from policy store. Reason is PolicyStore ErrorServerError
- Kubernetes(k8s)如何使用kube-dns實現服務發現K8SDNS
- 五、搭建kube-dnsDNS
- Kubernetes中Pod間共享記憶體方案記憶體
- Kubernetes原始碼分析之Pod的刪除原始碼