gpt4 book ai didi

docker - Pod "mysql"被禁止 : no API token found for service account default/default

转载 作者:行者123 更新时间:2023-12-02 05:35:51 25 4
gpt4 key购买 nike

我有以下 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 相同的操作:

  1. 生成签名 key :

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 - Pod "mysql"被禁止 : no API token found for service account default/default,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34464779/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com