-
install kuberntes dashboard
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.1/src/deploy/recommended/kubernetes-dashboard.yaml
-
Edit kubernetes service
kubectl -n kube-system edit service kubernetes-dashboard
# Please edit the object below. Lines beginning with a '#' will be ignored, # and an empty file will abort the edit. If an error occurs while saving this file will be # reopened with the relevant failures. # apiVersion: v1 kind: Service metadata: annotations: kubectl.kubernetes.io/last-applied-configuration: | {"apiVersion":"v1","kind":"Service","metadata":{"annotations":{},"labels":{"k8s-app":"kubernetes-dashboard"},"name":"kubernetes-dashboard","namespace":"kube-system"},"spec":{"ports":[{"port":443,"targetPort":8443}],"selector":{"k8s-app":"kubernetes-dashboard"}}} creationTimestamp: "2019-11-12T08:28:58Z" labels: k8s-app: kubernetes-dashboard name: kubernetes-dashboard namespace: kube-system resourceVersion: "16616648" selfLink: /api/v1/namespaces/kube-system/services/kubernetes-dashboard uid: *** spec: clusterIP: **** externalTrafficPolicy: Cluster ports: - nodePort: 31025 port: 443 protocol: TCP targetPort: 8443 selector: k8s-app: kubernetes-dashboard sessionAffinity: None type: NodePort # change ClusterIp to NodePort status: loadBalancer: {}
-
Now you can open this link in your browser
https://master_server_ip:node_port_ip
-
Login to kuberntes with Token
- Find kubernetes dashboard token secret
kubectl get secret -n kube-system output: . . . kubernetes-dashboard-token-vdh5j . . .
-
Copy token
sudo kubectl describe secret -n kube-system kubernetes-dashboard-token-vdh5j #output Name: kubernetes-dashboard-token-vdh5j Namespace: kube-system Labels: <none> Annotations: kubernetes.io/service-account.name: kubernetes- dashboard kubernetes.io/service-account.uid: 1332793e-f1d2-438a-af36-34a49c6b9bba Type: kubernetes.io/service-account-token Data ==== ca.crt: 1025 bytes namespace: 11 bytes token: ******
Now you can login to your dashboard and enjoy!
Created
November 12, 2019 14:20
-
-
Save includeamin/ac2230f9737405b7741fcee3e47e033f to your computer and use it in GitHub Desktop.
access to kuberntes dashboard from public ip
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment