Skip to content

Instantly share code, notes, and snippets.

@xwlee
Last active September 23, 2019 14:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xwlee/94d5ae152d3c9553f98ae2c3ffffb49f to your computer and use it in GitHub Desktop.
Save xwlee/94d5ae152d3c9553f98ae2c3ffffb49f to your computer and use it in GitHub Desktop.
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