问题1: 虽然每次通过yaml创建rc都显示成功了,但是 kubectl get pod却没显示任何的pod.
问题2: 直接通过yaml创建pod提示apixxx
问题2: 直接通过yaml创建pod提示apixxx
问题3: 通过.json文件创建pod 未验证
原因是身份认证
解决办法:跳过认证
创建pod:
# kubectl create -f nginx.yaml
此时有如下报错:
Error from server: error when creating "nginx.yaml": Pod "nginx" is forbidden: no API token found for service account default/default,
retry after the token is automatically created and added to the service account
解决办法:
编辑/etc/kubernetes/apiserver
去除 KUBE_ADMISSION_CONTROL中的SecurityContextDeny,ServiceAccount,并重启kube-apiserver服务:
vim /etc/kubernetes
/apiserverKUBE_ADMISSION_CONTROL="--admission_control=NamespaceLifecyc