關於建立rc和pod出現的問題
阿新 • • 發佈:2018-12-06
-
1:no resource found
解決辦法
vim /etc/kubernetes/apiserver
找到KUBE_ADMISSION_CONTROL=這一行,去掉ServiceAccount,儲存退出。 重啟kube-apiservice服務即可
-
2:使用kubectl get pod命令檢視pod時出現狀態不對。
$ kubectl get pod NAME READY STATUS RESTARTS AGE mysql-j553h 0/1 ContainerCreating 0 1h
此時狀態ContainerCreating是不正常的,應該是running。 按網上解決方法執行以下命令,會報找不到檔案或資料夾
$ yum update $ yum install python-rhsm-certificates $ docker pull registry.access.redhat.com/rhel7/pod-infrastructure:latest /etc/docker/certs.d/registry.access.redhat.com/redhat-ca.crt: no such file or directory.
感覺又跳進了一個坑,網上查了下說使用vpn下載映象就可以解決(沒試過),那沒vpn的可以進行以下操作,首先把自己的映象源更改成國內的
vim /etc/docker/daemon.json 修改 { "registry-mirrors": ["映象地址(阿里加速器,自行申請)"] } $ sudo systemctl daemon-reload $ sudo systemctl restart docker
然後更新yum,手動安裝rhsm和pod-infrastructure,
$ yum update $ yum search rhsm #搜尋一下 $ yum install python-rhsm-certificates $ docker search pod-infrastructure #搜尋一下國內源,有些下不了,找那些帶有ok的下 INDEX NAME DESCRIPTION STARS OFFICIAL AUTOMATED docker.io docker.io/openshift/origin-pod The pod infrastructure image for OpenShift 3 8 docker.io docker.io/davinkevin/podcast-server Container around the Podcast-Server Applic... 5 docker.io docker.io/infrastructureascode/aws-cli Containerized AWS CLI on alpine to avoid r... 4 [OK] docker.io docker.io/newrelic/infrastructure Public image for New Relic Infrastructure. 4 docker.io docker.io/infrastructureascode/uwsgi uWSGI application server 2 [OK] docker.io docker.io/infrastructureascode/serf A tiny Docker image with HashiCorp Serf us... 1 [OK] docker.io docker.io/mosquitood/k8s-rhel7-pod-infrastructure 1 docker.io docker.io/podigg/podigg-lc-hobbit A HOBBIT dataset generator wrapper for PoDiGG 1 [OK] docker.io docker.io/stefanprodan/podinfo Kubernetes multi-arch pod info 1 docker.io docker.io/tianyebj/pod-infrastructure registry.access.redhat.com/rhel7/pod-infra... 1 docker.io docker.io/w564791/pod-infrastructure latest 1 docker.io docker.io/infrastructureascode/hello-world A tiny "Hello World" web server with a hea... 0 [OK] docker.io docker.io/jqka/pod-infrastructure redhat pod 0 [OK] docker.io docker.io/ocpqe/hello-pod Copy form docker.io/deshuai/hello-pod:latest 0
我找了個
$ docker pull docker.io/jqka/pod-infrastructure
把下載好的映象標籤該成registry.access.redhat.com/rhel7/pod-infrastructure:latest(剛才報錯的那個名稱)
$ docker tag docker.io/jqka/pod-infrastructure registry.access.redhat.com/rhel7/pod-infrastructure:latest
重啟
systemctl restart kubelet
此時檢視pods發現狀態還是不對,莫急,可以把原來的rc刪除,重新建立一個。 發現狀態都正常了。
新手學習,步步為坑,記,共勉之