k8s图形界面登录报错如下
bash
{
"kind": "Status",
"apiVersion": "v1",
"metadata": {
},
"status": "Failure",
"message": "forbidden: User \"system:anonymous\" cannot get path \"/\"",
"reason": "Forbidden",
"details": {
},
"code": 403
}
证书问题,添加证书
使用client-certificate-data和client-key-data生成一个p12文件
生成client-certificate-data
bash
grep 'client-certificate-data' ~/.kube/config | head -n 1 | awk '{print $2}' | base64 -d >> kubecfg.crt
生成client-key-data
bash
grep 'client-key-data' ~/.kube/config | head -n 1 | awk '{print $2}' | base64 -d >> kubecfg.key
生成p12
bash
openssl pkcs12 -export -clcerts -inkey kubecfg.key -in kubecfg.crt -out kubecfg.p12 -name "kubernetes-client"
kubecfg.p12就是生成的个人证书
下面是Chrome和Firefox浏览器导入证书
然后关闭浏览器,重新登录后通过token登录就可以了