无法在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\
我该如何解决?
答案 0 :(得分:0)
我遇到了同样的问题,并遵循了以下步骤。
验证以下内容