1.参考这篇文章:
https://github.com/kubernetes/dashboard/wiki/Creating-sample-user
创建用户
2.获取token
3.kubectl get svc --all-namespaces
kube-system kubernetes-dashboard NodePort 10.233.31.8 <none> 443:32666/TCP
4.修改type
spec:
clusterIP: 10.233.31.8
externalTrafficPolicy: Cluster
ports:
- nodePort: 32666
port: 443
protocol: TCP
targetPort: 8443
selector:
k8s-app: kubernetes-dashboard
sessionAffinity: None
type: NodePort