In my previous post, I wrote a go application that displays the GPS location of any IP address. Here in this post, I’ll explain how to deploy the same in minikube.

Prerequisites

  • understanding of kubernetes components (pods, deployment, etc.)
  • minikube installed in your laptop

Kubernetes tutorial

If you are new to kubernetes and want to learn, I recommend this youtube playlist.

Minikube

Minikube is a tool that makes it easy to run Kubernetes locally. Minikube runs a single-node Kubernetes cluster inside a Virtual Machine (VM) on your laptop for users looking to try out Kubernetes or develop with it day-to-day.

_if you don’t have minikube installed in your laptop, you can do it by following the instructions _here.

Desired Deployment State

  • 2 instances of our web application.
  • **a load balancer **that balances the load on our two web application instances.
  • a redis cluster with a master-slave replication.

Image for post

Image for post

desired deployment state

I’m going to list down 7 steps I did to get to the above shown desired state. I hope you can replicate what I did very easily in your own minikube environment.

Step 1: start minikube

minikube start

you should receive an output like this

MacBook-Pro-2:Desktop jeshocarmel$ minikube start
😄  minikube v1.12.3 on Darwin 10.14.3
✨  Using the hyperkit driver based on existing profile
👍  Starting control plane node minikube in cluster minikube
🏃  Updating the running hyperkit "minikube" VM ...
🐳  Preparing Kubernetes v1.18.3 on Docker 19.03.12 ...
🔎  Verifying Kubernetes components...
🌟  Enabled addons: default-storageclass, storage-provisioner
🏄  Done! kubectl is now configured to use "minikube"

To ensure minikube has started successfully, run the command below

minikube status

and you should receive an output like this.

#kubernetes #redis #golang #containers #minikube

Deploying a go application and a redis cluster in minikube
1.55 GEEK