Istio with minikube On Windows pt 1

AirwaveTech
5 min readSep 4, 2019

A simple installation guide updated to reflect using the latest istioctl.

For over a year, I’ve been meaning to put Istio into production but with everything I had on my plate, I barely had the chance to install it in a Kubernetes test cluster.

Now that I have some bandwidth, I thought I’d pick up from where I left off by taking a deeper dive with Istio and see what types of things it can do.

Installation

Step 1. Start minikube with more power

This post assumes you have minikube running properly on your computer. Too bad because if you want to edit the resources allocated to minikube, you have to delete your existing minikube instance. Simply adding flags to the start command won’t change the underlying VM’s settings.

I tried running through this exercise of installing and configuring Istio using the default Hyper-V settings of 2GB of RAM and 1 CPU. My app would not deploy inside Kubernetes. I also noticed kubectl and the dashboard were slow to respond. I eventually had to delete minikube and restart it with the following command. Your settings might be different.

minikube start --memory=4096 --cpus=4 --vm-driver hyperv --hyperv-virtual-switch "minikube"

The official documentation recommends using a minimum of 16GB of RAM. I don’t know about you but I’m not running around with 32GB of RAM stuffed in my local machine. Maybe I should be, but for now, I’m going to use 4GB of RAM and 4 CPUs because I think it's reasonable to believe that any person working with this technology is using a decently powered machine.

Step 2. Installing Istio

There are 2 ways to install Istio. You can use Helm, the Kubernetes package manager but it will be deprecated soon. You can also install it using istioctl. The catch here is that the official documentation is written up for only Linux and Mac systems regardless of which method you choose. I’ve translated the steps for Windows users.

Here’s a link to Github releases page for istio. https://github.com/istio/istio/releases

I found out Windows has Dark Mode!

Find your version and download the zip file.

Istioctl.exe is a binary that now allows you to administer istio. The following command will use a demo profile that will allow us to experiment with istio.

istioctl install --set profile=demo -y
istioctl install — set profile=demo -y

Step 3. Double-check the installation

kubectl get ns
You should see the istio-system namespace

Upon successful creation of the namespace, check the services in the istio-system namespace.

kubectl get svc -n istio-system
A closer look and your output should match this
The full output

Then check the pods

kubectl get pods -n istio-system
Everything up and running

If you what you see on your screen matches the image above, congratulations, you just installed Istio with minikube on Windows!

Step 5: Deploy an application

In order for your application to communicate, Istio will need to inject a sidecar container. Basically, the sidecar container allows for all the fancy Istio service mesh features. It’s a type of Envoy proxy agent if you will.

There are 2 ways to deploy applications.

  • use istioctl to apply a side-car to a pod
  • Automatic injection per namespace, as long as that namespace has the specific label of istio-injection=enabled set.

Let’s set the namespace up and deploy a config-map and our webapp.

kubectl label namespace default istio-injection=enabled && kubectl apply -f https://raw.githubusercontent.com/airwavetechio/hello-world/master/_k8s/configmap.yaml && kubectl apply -f https://raw.githubusercontent.com/airwavetechio/hello-world/master/_k8s/deployment.yml

Check out the status

kubectl get pods
There are now 2/2 of pods

See if you can find out more information using kubectl describe and the kubernetes dashboard.

Step 6: Make your webapp accessible via a browser

Earlier when we installed Istio, do you remember how the istio-ingressgateway had an External-IP that was pending?

This picture

We need to work around this so you can access services inside of your minikube cluster. This command that will get you the information you need to hit your webapp is:

minikube ip && kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name==\"http2\")].nodePort}'

The first output is your “external IP” and the second number is your Port.

This is specific to minikube. If you were running this in production, you would most likely have an external load balancer with an IP already setup.

I have a premade gateway.yml file ready to match the app you just deployed.

kubectl apply -f https://raw.githubusercontent.com/airwavetechio/hello-world/master/_k8s/gateway.yml

Give it a few seconds and then check your browser using the “external IP” and port.

If you can get your Hello World app to resolve, you just set up and configured Istio with minikube on Windows!

I know that was fast, but what just happened?

  1. I added enough resources to minikube and started it up
  2. I downloaded all the source files and installed Istio
  3. I setup auto sidecar injection and deployed my webapp
  4. I setup a Virtual Service and Gateway

I encourage everyone to check the links and look at the source files. I purposely made the ports different along with the names so you can see just how everything pieces together.

Clean-Up

Here’s a list of commands to uninstall the webapp

kubectl delete -f https://raw.githubusercontent.com/airwavetechio/hello-world/master/_k8s/gateway.ymlkubectl delete -f https://raw.githubusercontent.com/airwavetechio/hello-world/master/_k8s/deployment.ymlkubectl delete -f https://raw.githubusercontent.com/airwavetechio/hello-world/master/_k8s/configmap.yaml
Removing deployment and gateway

If you want to learn more, our next post will be taking a brief look into the toolset provided with Istio so we can understand what’s happening under the hood!

--

--

AirwaveTech

Helping you build the hardest parts of your Stack