Error: No API token found for service account "default",

Source: Internet
Author: User

[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",

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.