Minikube Setup with Harness!

Background

Harness documentation suggests to leverage a free tier Google Cloud Platform instance and spin up a Google Kubernetes Engine instance. Can run through the Quick Start with minikube.

First Steps

To get started is pretty easy. Can run through a few pre-reqs which would not be too bad.

  1. Sign up for a free Harness.io account. I just used my Google Credentials.

  2. I am using a Mac, leveraging HomeBrew for the package manager makes MiniKube install pretty seamless.

  3. Grab the latest version of VirtualBox, can try out your newly installed HomeBrew!

  4. -> brew cask install virtualbox

  5. Make sure to grab one of the 5.2.x versions. Can also go download from VirtualBox themselves.

  6. https://download.virtualbox.org/virtualbox/5.2.28/VirtualBox-5.2.28-130011-OSX.dmg

Second Steps

Once HomeBrew and VirtualBox are set up, can get to installing minikube. Some of these steps take into account having to run this again. If this is your first install, can skip those.

  1. Install minikube

  2. -> brew cask install minikube

  3. Install kubectl which is the Kubernetes CLI. Important to have the same version of kubectl and minikube kubernetes.

  4. Remove old installs if you have -> rm ‘/usr/local/bin/kubectl’

  5. Install new -> brew install kubernetes-cli

  6. If coming from a previous version re-link -> brew link kubernetes-cli

  7. Validate version -> kubectl version

  8. Can start minikube now. Minikube will automatically create a KubeCTL context called “minikube” to start. The Harness Delegate and Sample App takes about 4g of memory.

  9. Tune the MiniKube install to have a VM with 8g of mem: -> minikube config set memory 8128

  10. Start minikube: -> minikube start

  11. If leveraging kubectl for other kubernetes clusters, set the context again -> kubectl config use-context minikube

  12. Fireup the kubernetes web dashboard from minikube -> minikube dashboard

Harness K8s Steps

The Harness documentation does a pretty good job in the wiring. Basically after setting up a free account, you will be getting your first delegate which will interface with your minikube cluster.

  1. Can follow the Google Cloud Platform steps by skipping to the GKE cluster set-up steps and going straight to delegate steps since you are using minikube.

  2. https://docs.harness.io/article/9hd68pg5rs-quick-start-setup-guide#1_install_and_run_the_harness_delegate

  3. Run through the naming and downloading of the delegate.

  4. Download the delegate tar.gz of the delegate then change the resource limit in the harness delegate container spec which is in the harness-delegate.yaml. This will boot fine.

  5. memory: “4Gi”

  6. Use kubectl to apply the delegate -> kubectl apply -f harness-delegate.yaml

  7. Should be cooking with gas! Can get status -> kubectl get pods -n harness-delegate

  8. Having some trouble? (no shame K8s is funny!)

  9. Make sure the same version of kubectl and K8s inside minikube are running. Can assume latest and latest. At time of this document this is 1.14.1.

  10. Can describe the pod to see status -> kubectl describe pods -n harness-delegate

  11. Can delete the pod and try again -> kubectl delete pods -n harness-delegate

Your First Deploy!

Harness makes this very easy. Your free account has a Harness Manager [e.g the controller] hosted on Harness’s SaaS. This will communicate with your minikube cluster!

  1. Harness documentation goes through pretty well on deploying the sample app. The pre-reqs for the Docker Registry was already set up for me in my free account.

  2. https://docs.harness.io/article/9hd68pg5rs-quick-start-setup-guide#4_deploy_the_harness_sample_application

  3. Deploy and prosper!

  4. Phew kept the memory in check on my 16g MBP!

  5. The sample app has a workflow approval which is pretty intuitive.

  6. Can check out the K8’s cluster to see some new stuff on there.

  7. Harness Delegate:

  8. Harness Sample App:

  9. Sit back and watch your hard work.

Cleanup Steps

Like a good citizen, clean up after yourself. Can do this pretty quickly.

  1. Stop minikube -> minikube stop

  2. Can also delete your VM -> minikube delete

  3. Can make tweaks directly on Virtual Box by firing up VB -> VirtualBox

1 Like