Skip to content

Instantly share code, notes, and snippets.

@worldofprasanna
Last active September 15, 2020 10:48
Show Gist options
  • Save worldofprasanna/e5647adf41a6f6908c795ad01c987dc1 to your computer and use it in GitHub Desktop.
Save worldofprasanna/e5647adf41a6f6908c795ad01c987dc1 to your computer and use it in GitHub Desktop.
Minikube commands
# Start minikube cluster in local
minikube start
# optionally start with cpu s and memory
minikube start --cpus=4 --memory=4096
# to change the docker machine to point to the kubernetes cluster
eval $(minikube docker-env)
# Note: Kubernetes supports docker version - 1.11.1.
# So if you have latest docker in local, then this might fail saying client version is greater than server version.
# To avoid this use, dvm
# to list available docker versions
dvm list
# to install docker version 1.11.1
docker install 1.11.1
# Note: dvm is not installed properly. After lot of struggle hardcoded the dvm helper path and made it work.
# 1. dvm_helper path is hard coded
# 2. cd -q option is changed to cd in dvm.sh file (ie., removed the DVM_OPTS flag)
# build all the docker images / pull the docker images
# to start the deployment
kubectl run hello-node --image=hello-node:v1 --port=8080
# to view the pods
kubectl get pods
# to view the deployments
kubectl get deployments
# to view the services
kubectl get services
# to expose the service for the deployment
kubectl expose deployment hello-node --type=NodePort
# to delete the service and deployment
kubectl delete service,deployment hello-node
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment