前言
报错信息:
Error from server (ServerTimeout): error when creating "busybox.yaml": No API token found for
service account "default", retry after the token is automatically created and added to the service
account
解决方法
1.首先生成密钥:
openssl genrsa -out /etc/kubernetes/serviceaccount.key 2048
2.编辑/etc/kubenetes/apiserver
添加以下内容
KUBE_API_ARGS="--service_account_key_file=/etc/kubernetes/serviceaccount.key"
3.编辑/etc/kubernetes/controller-manager
KUBE_CONTROLLER_MANAGER_ARGS="--service_account_private_key_file=/etc/kubernetes/serviceaccount.key"
- 重启服务
systemctl restart etcd kube-apiserver kube-controller-manager kube-scheduler