版本:
- k8s 1.5
- docker 1.3
- CentOS 7.6
使用命令 kubectl get pods
输出no resources
。解决方法是修改 apiserver 的配置文件
vim /etc/kubernetes/apiserver
...
KUBE_ADMISSION_CONTROL="--admission-control=NamespaceLifecycle,NamespaceExists,LimitRanger,SecurityContextDeny,ResourceQuota"
去掉原先的ServiceAccount。然后重启apiserver
systemctl restart apiserver
启动pod是,一直处于ContainerCreating状态,需要安装
yum install *rhsm*
查看docker日志,docker一直再拉取registry.access.redhat.com/rhel7/pod-infrastructure
,且提示不存在,所以修改 kubelet 配置文件
vim /etc/kubernetes/kubelet
KUBELET_POD_INFRA_CONTAINER="--pod-infra-container-image=docker.io/tianyebj/pod-infrastructure"
然后重启kubelet
systemctl restart kubelet