docker-荚“ mysql”被禁止:没有为服务帐户默认/默认找到API令牌

前端之家收集整理的这篇文章主要介绍了docker-荚“ mysql”被禁止:没有为服务帐户默认/默认找到API令牌 前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

我有以下mysql.yaml文件

apiVersion: v1beta3
kind: Pod
Metadata:
  name: MysqL
  labels:
    name: MysqL
spec:
  containers:
    - resources:
        limits :
          cpu: 1
      image: MysqL
      name: MysqL
      env:
        - name: MysqL_ROOT_PASSWORD
          # change this
          value: yourpassword
      ports:
        - containerPort: 3306
          name: MysqL

运行kubectl create -f MysqL.yaml会给出错误

Error from server: error when creating "MysqL.yaml": Pod "Unknown" is forbidden: no API token found for service account default/default,retry after the token is automatically created and added to the service account

我有一个主机和一个节点,都是centos 7.1.

最佳答案
为了使您的设置正常工作,您可以执行local-up-cluster.sh相同的操作:

>生成签名密钥:

openssl genrsa -out /tmp/serviceaccount.key 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”

https://github.com/kubernetes/kubernetes/issues/11355#issuecomment-127378691

猜你在找的Docker相关文章