多节点部署k8s(8):解决谷歌浏览器无法访问UI界面的问题
转接上文:多节点部署k8s(7):创建UI界面https://192.168.100.30:30001/1、生成需要的证书[root@k8s-master1 k8s页面]# vim dashboard-cert.shcat > dashboard-csr.json <<EOF{"CN": "Dashboard","hosts": [],...
·
转接上文:多节点部署k8s(7):创建UI界面
https://192.168.100.30:30001/
1、生成需要的证书
[root@k8s-master1 k8s页面]# vim dashboard-cert.sh
cat > dashboard-csr.json <<EOF
{
"CN": "Dashboard",
"hosts": [],
"key": {
"algo": "rsa",
"size": 2048
},
"names": [
{
"C": "CN",
"L": "BeiJing",
"ST": "BeiJing"
}
]
}
EOF
K8S_CA=$1
cfssl gencert -ca=$K8S_CA/ca.pem -ca-key=$K8S_CA/ca-key.pem -config=$K8S_CA/ca-config.json -profile=kubernetes dashboard-csr.json | cfssljson -bare dashboard
kubectl delete secret kubernetes-dashboard-certs -n kube-system
kubectl create secret generic kubernetes-dashboard-certs --from-file=./ -n kube-system
[root@k8s-master1 k8s页面]# vim dashboard-controller.yaml
[root@k8s-master1 k8s页面]# bash dashboard-cert.sh /master/k8s
[root@k8s-master1 k8s页面]# ls
dashboard-cert.sh dashboard-csr.json dashboard-secret.yaml
dashboard-configmap.yaml dashboard-key.pem dashboard-service.yaml
dashboard-controller.yaml dashboard.pem k8s-admin.yaml
dashboard.csr dashboard-rbac.yaml
[root@k8s-master1 k8s页面]# vim dashboard-controller.yaml
46 # PLATFORM-SPECIFIC ARGS HERE
47 - --auto-generate-certificates
48 - --tls-key-file=dashboard-key.pem
49 - --tls-cert-file=dashboard.pem
50 volumeMounts:
2、重新生成
[root@k8s-master1 k8s页面]# kubectl apply -f dashboard-controller.yaml
[root@k8s-master1 k8s页面]# kubectl get secret -n kube-system
NAME TYPE DATA AGE
dashboard-admin-token-tpbnt kubernetes.io/service-account-token 3 4d18h
default-token-h94dv kubernetes.io/service-account-token 3 7d
kubernetes-dashboard-certs Opaque 11 12m
kubernetes-dashboard-key-holder Opaque 2 4d19h
kubernetes-dashboard-token-x9f9h kubernetes.io/service-account-token 3 4d19h
更多推荐
已为社区贡献7条内容
所有评论(0)