Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languageyml
titleInsert nodePortNodePort
spec:
   clusterIP: 10.107.65.54
   externalTrafficPolicy: Cluster
   ports:
      - nodePort: 30000		# <--- pay attention to this field
        port: 443
        protocol: TCP
        targetPort: 8443
   selector:
        k8s-app: kubernetes-dashboard
   sessionAffinity: None
   type: NodePort			# <--- Enter NodePort (pay attention to uppercase and lowercase letters) in place of ClusterIP
status:
   loadBalancer:

...

Code Block
languageyml
titledashboard-_adminuser.yaml
collapsetrue
apiVersion: v1
kind: ServiceAccount
metadata: 
  name: admin-user
  namespace: kubernetes-dashboard
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: admin-user
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cluster-admin
subjects:
- kind: ServiceAccount
  name: admin-user
  namespace: kubernetes-dashboard

which we will then launch with the command kubectl apply -f dashboard-_adminuser.yaml. Finally, we obtain the token (present in the last line), which will be pasted on the Dashboard login screen, by launching the command

...