无法在 Kubernetes版本中创建 Pod:v1.10.0-beta.3
当我在主节点上创建 pod 时,我遇到以下错误:
kubectl create -f ./nginx-rc.yaml
ERROR:
No API token found for service account \"default\", retry after the token is automatically created and added to the service account\
执行命令:
openssl genrsa -out /tmp/serviceaccount.ket 2048
修改
/etc/kubernetes/apiserver
文件以添加以下内容:KUBE_API_ARGS="--service_account_key_file=/tmp/serviceaccount.key"
修改
/etc/kubernetes/controller-manager
并添加以下内容:KUBE_CONTROLLER_MANAGER_ARGS="-- service_account_private_key_file=/tmp/serviceaccount.key"
重新启动了 Kubernetes,但我仍然面临同样的错误:
No API token found for service account \"default\", retry after the token is automatically created and added to the service account\
另一种方法在 apiservice 上删除 SecurityContextDeny,ServiceAccount 之前:
KUBE_ADMISSION_CONTROL="--admission-control=NamespaceLifecycle,LimitRanger,SecurityContextDeny,ServiceAccount,ResourceQuota"
后:
KUBE_ADMISSION_CONTROL="--admission-control=NamespaceLifecycle,LimitRanger,ResourceQuota"
仍然错误:
No API token found for service account \"default\", retry after the token is automatically created and added to the service account\
我该如何解决?