How To Handle Minikube(Cheatsheet)-2? K8s – Part: 8

0
103
views
How To Handle Minikube(Cheatsheet)-2? K8s - Part: 8

In the previous article, you read minikube Cheatsheet -1 to handle the minikube. Now follow more commands to handle the Minikube.

COMMAND 13: Bring Up the dashboard

It is quite easy to setup Kubernetes dashboard in Minikube by just running below command.

[[email protected] ~]# minikube dashboard
Opening kubernetes dashboard in default browser...

This will pop up the dashboard on your default browser

COMMAND 14: Get the Dashboard URL

If you are now interested in launching the dashboard in a browser or need to get URL only then hit the below command to get the URL of the dashboard

[[email protected] ~]# minikube dashboard --url=true
http://192.168.99.100:30000

COMMAND 15: To SSH minikube vm

The shown command is used to get ssh access in the minikube to perform any task required for your setup.

[[email protected] ~]# minikube ssh
minikube ssh




COMMAND16: To Get Running Services List

This command will help you to get the list of all running services.

[[email protected] ~]# minikube service list
minikube command

COMMAND 17: Stop Your Minikube Setup

If you need to stop your Minikube cluster setup then run following command

[[email protected] ~]# minikube stop
Stopping local Kubernetes cluster...
Machine stopped.

COMMAND 18: To recreate your Minikube setup

If your cluster is not working and you want to recreate your cluster then run following command to achieve the same

[[email protected] ~]# minikube stop
[[email protected] ~]# rm -rf ~/.minikube
[[email protected] ~]# minikube start

COMMAND 19: To Delete Minikube cluster
Run this command when you are really sure to delete your Minikube. This will delete your Minikube cluster

[[email protected] ~]# minikube delete
Deleting local Kubernetes cluster...
Machine deleted.




COMMAND 20: To Dump All the Cluster Info

This cluster dump command is really useful when you need all the information of your cluster and need to troubleshoot your cluster or want to keep current cluster information.

[[email protected] ~]# kubectl cluster-info dump > minikube_cluster_dump.txt
You may your cat command to see all the information.

COMMAND 21: List node (It must be only 1 i.e. Minikube)

A typical kubectl command but can be used to get the number of nodes.

[[email protected] ~]# kubectl get nodes
NAME STATUS ROLES AGE VERSION
minikube Ready master 57m v1.10.0

Section 2: Minikube App Deployments & Administration

The following section will help you deploying applications over Minikube

COMMAND 22: To create an APP deployment

[[email protected] ~]# kubectl run nginx-test --image=nginx --port=80
deployment.apps/nginx-test created

COMMAND 23: To expose your deployment to a Node port

[[email protected] ~]# kubectl expose deployment nginx-test --type=NodePort
service/nginx-test exposed

COMMAND 24: To Get Status of any deployment

[[email protected] ~]# kubectl get deployment
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
nginx-test 1 1 1 1 13m

Read cheatsheet-3 for more commands.

Kubernetes Series Links:

Understanding Kubernetes Concepts RHEL/CentOs K8s Part-1
Understanding Kubernetes Concepts RHEL/CentOs k8s: Part-2
How to Install Kubernetes on CentOS/RHEL k8s?: Part-3
How to Install Kubernetes on CentOS/RHEL k8s?: Part-4
How To Bring Up The Kubernetes Dashboard? K8s-Part: 5
How to Run Kubernetes Cluster locally (minikube)? K8s – Part: 6
How To Handle Minikube(Cheatsheet)-3? K8s – Part: 7
How To Handle Minikube(Cheatsheet)-3? K8s – Part: 8
How To Handle Minikube(Cheatsheet)-3? K8s – Part: 9