通過以下代碼獲得certificates,注意,必須對於master結點和兩個node結點機器上都需要獲取
通過 kubectl describe pod xxx獲得報錯信息:
Error syncing pod, skipping: failed to "StartContainer" for "POD" with ErrImagePull: "image pull failed for registry.access.redhat.com/rhel7/pod-infrastructure:latest, this may be because there are no credentials on this request. details: (open /etc/docker/certs.d/registry.access.redhat.com/redhat-ca.crt: no such file or directory)"
通過一下命令解決:
yum install -y *rhsm* wget http://mirror.centos.org/centos/7/os/x86_64/Packages/python-rhsm-certificates-1.19.10-1.el7_4.x86_64.rpm rpm2cpio python-rhsm-certificates-1.19.10-1.el7_4.x86_64.rpm | cpio -iv --to-stdout ./etc/rhsm/ca/redhat-uep.pem | tee /etc/rhsm/ca/redhat-uep.pem
注意必須是對每台機器都使用這個指令,然后就能獲取到certificate。
接下來檢查pod的狀態就能發現pod已經成功被創建,並且狀態是running
轉載自:https://www.jianshu.com/p/adf2aebdc381