You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Kubernetes provides a Dashboard, to allow cluster management through a user interface, certainly more intuitive than the classic command line. You can use Dashboard to deploy containerized applications on a Kubernetes cluster, troubleshoot the containerized application, and manage cluster resources. You can use the Dashboard to get an overview of the applications running on the cluster, as well as to create or modify individual Kubernetes resources. For more information, consult the official documentation Kubernetes Dashboard.

Installation

The user interface is not distributed by default. Installation is very simple, just run the following command (check the version)

Install Dashboard
$ kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deploy/recommended.yaml

Access

We need to make a small modification to a .yaml file, via the command

Edit file
$ kubectl -n kubernetes-dashboard edit svc kubernetes-dashboard

Once the above command has been launched, a .yaml file will appear. If not already present, make the following change (here an extract of the file already modified)

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 in place of ClusterIP
status:
   loadBalancer:

The port value here is generated randomly in the range 30000-32767, after saving the modified file with type: NodePort (the default value should be ClusterIP). If you want, you can opt for another value, as long as it belongs to the aforementioned range of values, by relaunching the edit command (here we have chosen the 30000 port, easier to remember). Remember to open the port in the SecurityGroup on OpenStack. We can check if the changes made have had any effect on the service by running the command

Get the service
$ kubectl -n kubernetes-dashboard get services
NAME                  TYPE        CLUSTER-IP    EXTERNAL-IP   PORT(S)         AGE
kubernetes-dashboard  NodePort    10.107.65.54  <none>        443:30000/TCP   27h

Note the value of the TYPE field, now equal to NodePort.




  • No labels