I’m an osx user, so these instructions are intended for this system, in case I have to restart it.

Once Docker.app is started, you enter in preferences, Kubernetes, click on initialize Kubernetes. After a minute or so, you will get the indicator that Kubernetes is up and running. By default the Dashboard does not start, so now you open Terminal.app.

To start the dashboard, run the following commands, both, on the terminal:

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

after that, run this command in another terminal:

kubectl proxy

Now, you can access the input url,

http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/#/overview?namespace=default

but he’s gonna ask you for a security token, so you have to create it. To do this, according to the content of this GitHub (https://github.com/kubernetes/dashboard/blob/master/docs/user/access-control/creating-sample-user.md), create a folder where you want and create a file dashboard-adminuser.yaml with the following content:

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

To create the token:

kubectl apply -f dashboard-adminuser.yaml

To know what token have been generated:

kubectl -n kubernetes-dashboard describe secret $(kubectl -n kubernetes-dashboard get secret | grep admin-user | awk '{print $1}')

Now we can use that token to enter the dashboard via the input url.

Now we’re going to create a pod on which we’ll run a previously created docker image and upload it to hub.docker.com. To do this, once you have entered the dashboard, you hit the button above to the right. You give it to Créate From Form, you write a Label, you put the indicator of a container, in my case, aironman/demo-rafa, Number of Pods 1, Service external, ports 8080 8080, and finally you can create the service. After a little while, you will have the service available at localhost:8080

That’s it, you’ve got your first service running at Kubernetes.

Attention!. I have found that every time I want to enter the dashboard, from one day to the next, I have to generate a token each time. Also, there are times when you enter the token but it doesn’t advance to the next screen, so you have to copy the input url into another tab once you have entered the token. I guess it’s because the current software is unstable.

Important link, thank you @kubernetesio:

https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s