Thursday 9 July 2020

Kubernetes: Hello World Application using dashboard

Step 1: Open a terminal and execute the below command to start the dashboard.

minikube dashboard

$minikube dashboard
🤔  Verifying dashboard health ...
🚀  Launching proxy ...
🤔  Verifying proxy health ...
🎉  Opening http://127.0.0.1:52023/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/ in your default browser...

Once you execute the command, it automatically opens the dashboard in browser.

Click on + button available at top right corner of the page.


You can create the application in three ways.

a.   By directly providing input in yaml or json format

b.   From an yaml or json file

c.    Using a form

 

Let’s choose the third option 'Using a form'.

 

Give App Name as ‘user-service’

Container Image as ‘jboss/wildfly’ and

Number of Pods as 1.


Click on Deploy button.

 

Once you click on Deploy button, you will be redirected to the dashboard.


Under the Deployments section, you can see that the deployment ‘user-service’ is up and running.

 

You can see all the objects in Kubernetes by executing the command ‘kubectl get all’.

$kubectl get all
NAME                                READY   STATUS    RESTARTS   AGE
pod/user-service-7977c4d9bc-x946n   1/1     Running   0          8m55s

NAME                 TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
service/kubernetes   ClusterIP   10.96.0.1    <none>        443/TCP   29d

NAME                           READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/user-service   1/1     1            1           8m55s

NAME                                      DESIRED   CURRENT   READY   AGE
replicaset.apps/user-service-7977c4d9bc   1         1         1       8m55s

As you see the output, deployment user-service is created, similarly, replicaset and pod also created. Do not worry much, I will explain these things in my later posts.

 

You can delete the deployment by executing the below command.

 

kubectl delete deployment user-service

$kubectl delete deployment user-service
deployment.apps "user-service" deleted

Once you execute the command rerun ‘get all’ to make sure that the deployment, replicaset, and pod get deleted.

$kubectl get all
NAME                 TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
service/kubernetes   ClusterIP   10.96.0.1    <none>        443/TCP   29d

Perfect, from the output, you can confirm that only the Kubernetes service is running.



Previous                                                    Next                                                    Home

No comments:

Post a Comment