[Email protected] pods]# Kubectl create-f Mysql.yaml
Error from server (servertimeout): Error when creating ' Mysql.yaml ': No API token found for service account "default", ret Ry after the token was automatically created and added to the service account
Troubleshoot authentication issues:
1 Removal Certification
creating pod:# kubectl Create-F Mysql.yaml At this time has the following error:error from server (servertimeout): Error when creating ' Mysql.yaml ': No API token found for service account "default", Retry after the token are automatically created and added to the Service account solution is edit/etc/kubernetes/apiserver remove Securitycontextdeny,serviceaccount from Kube_admission_control and restart kube-apiserver.service Service: #vim/etc/kubernetes/Apiserverkube_admission_control="--admission_control=namespacelifecycle,namespaceexists,limitranger,resourcequota"#systemctl Restart Kube-Apiserver.service after re-creating pod:# kubectl Create-f mysql.yamlpod "MySQL" Created
2 Building a Certificate
Source:
Http://stackoverflow.com/questions/34464779/pod-mysql-is-forbidden-no-api-token-found-for-service-account-default-default
To get your setup working, you can do the same thing local-up-cluster.sh are doing:
Generate a signing key:
OpenSSL Genrsa-out/tmp/serviceaccount.key 2048
Update/etc/kubernetes/apiserver:
Kube_api_args= "–service_account_key_file=/tmp/serviceaccount.key"
Update/etc/kubernetes/controller-manager:
Kube_controller_manager_args= "–service_account_private_key_file=/tmp/serviceaccount.key"
From https://github.com/kubernetes/kubernetes/issues/11355#issuecomment-127378691
Error: No API token found for service account "default",