Using Multiple profiles with Minikube

Kubernetes is the new Linux. K8s is the spec for the multi-poly cloud world. Running k8s could be very resource intensive, so is always a good idea being able to run things locally. For several reasons like Engineering Productivity, Tests and Experiments and so on and on. If you are working with Istio like I'm, you might realize it's a bit heavy to run local, especially if you do have other things running on k8s.  Minikube is the goto solution for local kubernetes clusters. However, as I said before, it can get pretty heavy when Istio gets involved. So the solution is pretty simple, it not much advertised. Minikube has a profile feature which allows you to create multiple profiles. Each profile will be a 2GB DISK VM created in Virtualbox. This is great because now you can run multiple kubernetes versions and multiple clusters doing multi experiments. IMHO is always great to have a k8s cluster ready to test things so I have multiple profiles like istio, lightweight, tests, etc... The first time you create the profile takes some time, up to 10min worst case but after the profile created things are super fast.

Running Multiple profiles with Minikube

Minikube has powerful feature called profiles, this feature allow we create different virtual machine based on a name, each profile cost avg ~2GB disk space. I found this super useful since have istio(heavy weight) proile and I need todo some quick local tests and want fast bootup and less resource consuption.

Profile 1

minikube profile test
minikube start -p test
๐Ÿ˜„  minikube v1.0.0 on linux (amd64)
๐Ÿคน  Downloading Kubernetes v1.14.0 images in the background ...
๐Ÿ”ฅ  Creating virtualbox VM (CPUs=2, Memory=2048MB, Disk=20000MB) ...
๐Ÿ’ฟ  Downloading Minikube ISO ...
2019/04/10 11:51:51 No matching credentials were found, falling back on anonymous
2019/04/10 11:51:51 No matching credentials were found, falling back on anonymous
2019/04/10 11:51:51 No matching credentials were found, falling back on anonymous
2019/04/10 11:51:51 No matching credentials were found, falling back on anonymous
2019/04/10 11:51:51 No matching credentials were found, falling back on anonymous
2019/04/10 11:51:51 No matching credentials were found, falling back on anonymous
2019/04/10 11:51:51 No matching credentials were found, falling back on anonymous
2019/04/10 11:51:51 No matching credentials were found, falling back on anonymous
2019/04/10 11:51:51 No matching credentials were found, falling back on anonymous
2019/04/10 11:51:51 No matching credentials were found, falling back on anonymous
2019/04/10 11:51:51 No matching credentials were found, falling back on anonymous
2019/04/10 11:51:51 No matching credentials were found, falling back on anonymous
2019/04/10 11:51:51 No matching credentials were found, falling back on anonymous
 142.88 MB / 142.88 MB [============================================] 100.00% 0s
๐Ÿ“ถ  "test" IP address is 192.168.99.100
๐Ÿณ  Configuring Docker as the container runtime ...
๐Ÿณ  Version of container runtime is 18.06.2-ce
โŒ›  Waiting for image downloads to complete ...
โœจ  Preparing Kubernetes environment ...
๐Ÿ’พ  Downloading kubeadm v1.14.0
๐Ÿ’พ  Downloading kubelet v1.14.0
๐Ÿšœ  Pulling images required by Kubernetes v1.14.0 ...
๐Ÿš€  Launching Kubernetes v1.14.0 using kubeadm ... 
โŒ›  Waiting for pods: apiserver proxy etcd scheduler controller dns
๐Ÿ”‘  Configuring cluster permissions ...
๐Ÿค”  Verifying component health .....
๐Ÿ’—  kubectl is now configured to use "test"
๐Ÿ„  Done! Thank you for using minikube!
alias k=kubectl
k get svc 
k get nodes
minikube stop
k get svc
NAME         TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
kubernetes   ClusterIP   10.96.0.1    <none>        443/TCP   26m

k get nodes
NAME       STATUS   ROLES    AGE   VERSION
minikube   Ready    master   26m   v1.14.0

โœ‹  Stopping "deploy" in virtualbox ...
๐Ÿ›‘  "deploy" stopped.

Profile 2

minikube profile deploy
minikube start -p deploy
๐Ÿ˜„  minikube v1.0.0 on linux (amd64)
๐Ÿคน  Downloading Kubernetes v1.14.0 images in the background ...
๐Ÿ”ฅ  Creating virtualbox VM (CPUs=2, Memory=2048MB, Disk=20000MB) ...
๐Ÿ“ถ  "deploy" IP address is 192.168.99.100
๐Ÿณ  Configuring Docker as the container runtime ...
๐Ÿณ  Version of container runtime is 18.06.2-ce
โŒ›  Waiting for image downloads to complete ...
โœจ  Preparing Kubernetes environment ...
๐Ÿšœ  Pulling images required by Kubernetes v1.14.0 ...
๐Ÿš€  Launching Kubernetes v1.14.0 using kubeadm ... 
โŒ›  Waiting for pods: apiserver proxy etcd scheduler controller dns
๐Ÿ”‘  Configuring cluster permissions ...
๐Ÿค”  Verifying component health .....
๐Ÿ’—  kubectl is now configured to use "deploy"
๐Ÿ„  Done! Thank you for using minikube!
alias k=kubectl
k get svc 
k get nodes
minikube stop
k get svc
NAME         TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
kubernetes   ClusterIP   10.96.0.1    <none>        443/TCP   26m

k get nodes
NAME       STATUS   ROLES    AGE   VERSION
minikube   Ready    master   26m   v1.14.0

โœ‹  Stopping "deploy" in virtualbox ...
๐Ÿ›‘  "deploy" stopped.


Cheers,
Diego Pacheco

Popular posts from this blog

Having fun with Zig Language

C Unit Testing with Check

Cool Retro Terminal