Not Able To Create Pod in Kubernetes Version: v1.10.0-beta.3
When I create pod on the master node I face the following error:
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\
executed command :
openssl genrsa -out /tmp/serviceaccount.ket 2048
modified the
/etc/kubernetes/apiserver
file to add following :KUBE_API_ARGS="--service_account_key_file=/tmp/serviceaccount.key"
modified the
/etc/kubernetes/controller-manager
and add following:KUBE_CONTROLLER_MANAGER_ARGS="-- service_account_private_key_file=/tmp/serviceaccount.key"
restarted the Kubernetes but I face still the same error:
No API token found for service account \"default\", retry after the token is automatically created and added to the service account\
An another way remove SecurityContextDeny,ServiceAccount on apiservice before:
KUBE_ADMISSION_CONTROL="--admission-control=NamespaceLifecycle,LimitRanger,SecurityContextDeny,ServiceAccount,ResourceQuota"
after:
KUBE_ADMISSION_CONTROL="--admission-control=NamespaceLifecycle,LimitRanger,ResourceQuota"
still error:
No API token found for service account \"default\", retry after the token is automatically created and added to the service account\
How can I solve it?