Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Using Minikube Cluster

Install minikube

brew install minikube

Create minikube cluster

minikube start

Get all nodes

kubectl get nodes

Describe all nodes

kubectl describe nodes

Deploy a simple application on minikube

kubectl create deployment web --image nginx

Check what happen under the hood by querying the events

kubectl get events

Check the deployment status

kubectl get deploy

Get the application pods info

kubectl get pods
kubectl get pods -o wide

Expose the application through service

kubectl expose deployment/web --port 80 --type NodePort

Get the application exposed port

kubectl get svc

Get the IP of the minikube cluster

minikube ip

Scale the application

kubectl scale deployment/web --replicas 2

Create a template by creating a deployment and output the definition as yaml

kubectl create deployment web --image=nginx --dry-run -o yaml

Create a deployment using config file

kubectl apply -f <config>.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment