Enable Access for Kubernetes Dashboard via external VIP or Floating IP
You will need to create a clusterrole to grant permission to kubernetes-dashboard and bind it to system:anonymous user as followed.
kind: ClusterRoleapiVersion: rbac.authorization.k8s.io/v1metadata: name: kubernetes-dashboard-anonymousrules:- apiGroups: [""] resources: ["services/proxy"] resourceNames: ["https:kubernetes-dashboard:"] verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]- nonResourceURLs: ["/ui", "/ui/*", "/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/*"] verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]---apiVersion: rbac.authorization.k8s.io/v1kind: ClusterRoleBindingmetadata: name: kubernetes-dashboard-anonymousroleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: kubernetes-dashboard-anonymoussubjects:- kind: User name: system:anonymous
Edit:To apply these changes, save it into a .yaml (e.g.: clusterrole.yaml) file and run
kubectl apply -f clusterrole.yaml