【错误解决】kubernetes 1.21.10 apiserver报错 Error: [service-account-issuer is a required flag
阅读原文时间:2023年10月17日阅读:3

报错日志

Error: [service-account-issuer is a required flag, --service-account-signing-key-file and --service-account-issuer are required flags]

解决办法

生成sa证书和pub

cat<<EOF > /root/k8s/certs/sa-csr.json 
{
    "CN":"sa",
    "key":{
        "algo":"rsa",
        "size":2048
    },
    "names":[
        {
            "C":"CN",
            "L":"BeiJing",
            "ST":"BeiJing",
            "O":"k8s",
            "OU":"System"
        }
    ]
}
EOF

# 此处修改自己的路径
cfssl gencert -initca /root/k8s/certs/sa-csr.json  | cfssljson -bare /root/k8s/certs/sa -

openssl x509 -in /root/k8s/certs/sa.pem -pubkey -noout > /root/k8s/certs/sa.pub

# 修改apiserver的参数
 --service-account-key-file=/root/k8s/certs/sa.pub
--service-account-signing-key-file=/root/k8s/certs/sa-key.pem
--service-account-issuer=api

手机扫一扫

移动阅读更方便

阿里云服务器
腾讯云服务器
七牛云服务器

你可能感兴趣的文章