First steps with Istio on Kubernetes on Minikube on Windows 10 image 139

First steps with Istio on Kubernetes on Minikube on Windows 10

In this article, I discuss my steps to get going with Istio [service mesh] on Kubernetes running on Minikube on Windows 10. Unfortunately, I have ran into an issue with Istio. This article describes the steps leading up to the issue. I will continue with the article once the issue is resolved. For now, it is a dead end street.

Note: my preparations – install Minikube and Kubernetes on Windows 10 are described in this previous article: https://technology.amis.nl/2017/10/24/installing-minikube-and-kubernetes-on-windows-10/.

Clone Git repository with samples

git clone https://github.com/istio/istio

Start minikube

set MINIKUBE_HOME=C:\Users\lucas_j\.minikube

minikube start

image

Run Bookinfo

cd c:\data\bookinfo\istio\samples\bookinfo\kube

kubectl apply -f bookinfo.yaml

image

Show productpage. First find port on which product page is exposed:

image

productpage is a service of type ClusterIP, which is only available inside the cluster – which is not good for me.

So to expose the service to outside the cluster:

kubectl edit svc productpage

and in the editor that pops up, change the type from ClusterIP to NodePort:

image

After changing the type and saving the change, get services indicates the port on which the productpage service is now exposed:

image

So now we can go to URL:  http://192.168.99.100:9080/productpage

image

Installing Istio into the Kubernetes Cluster

Now that we’ve seen the app, we’ll adjust our deployment slightly to make it work with Istio. We first need to install Istio in our cluster. To see all of the metrics and tracing features in action, we also install the optional Prometheus, Grafana, and Zipkin addons.

First, download Istio for Windows from https://github.com/istio/istio/releases and extract the contents of the zip file.

image

Add the directory that contains the client binary istioctl.exe to the PATH variable.

image

Open a new command line window. Navigate to the installation location of Istio.

To install Istio to the minikube Kubernetes cluster:

kubectl apply -f install/kubernetes/istio.yaml

SNAGHTML3324bb4

ending with:

image

To verify the success of the installation:

kubectl get svc -n istio-system

image

On Minikube – that does not support services of type LoadBalancer – the external IP for the istio-ingress will stay on pending. You must access the application using the service NodePort, or use port-forwarding instead.

Check on the pods:

kubectl get pods -n istio-system

image

On the dashboard, when I switch to the istio-system Namespace, I can see more details 

image

When I try to run istio commands, I run into issues:

istio version

image

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x30 pc=0x121513f]

goroutine 1 [running]:
main.getDefaultNamespace(0x14b878a, 0xd, 0x0, 0x0)

I am not sure yet what is the underlying cause and if there is a solution. The issue report https://github.com/istio/pilot/issues/1336 seems related – perhaps.

The next command I tried was:

kubectl apply -f <(istioctl kube-inject -f samples/bookinfo/kube/bookinfo.yaml)

this one fails with: the system cannot find the file specified

image

I do not know where to get more detailed logging about what happens prior to the exception.

Note: I decided to give an earlier version of Istios a try: 0.2.7. This worked flawlessly.

Switching to Istio 0.2.7

So again the Istio installation steps – this time for 0.2.7:

(first I have to remove Istio from minikube: in directory c:\ProgramFiles\Kubernetes\istio-0.2.9

kubectl delete -f install/kubernetes/istio-auth.yaml

and remove the 0.2.9 directory and PATH setting

Add c:\ProgramFiles\Kubernetes\istio-0.2.7 to PATH

Try istioctl:

image

And install isthio on Minikube:

image

image

Install Book Info Application and inject Istio

To install the Bookinfo application and inject Istio into it, I first take the original yaml –  bookinfo.yaml – and have istio inject its interception logic and save the result to a temporary file (bi2.yaml). Note: it is important to pass the correct location of the .kube/config file – because the default value is not applicable to my environment:

istioctl kube-inject –kubeconfig “C:\Users\lucas_j\.kube\config”   -f samples/bookinfo/kube/bookinfo.yaml > bi2.yaml

Next I install the application plus Istio injection stuff into Minikube:

kubectl apply -f bi2.yaml

image

Create ingress.yaml file:

Apply yaml file:

kubectl create -f ingress.yaml

image

Enable Ingress addon on minikube (see https://medium.com/@Oskarr3/setting-up-ingress-on-minikube-6ae825e98f82)

minikube addons enable ingress

ingres.yaml

apiVersion: extensions/v1beta1

kind: Ingress

metadata:

name: bookinfo

annotations:

ingress.kubernetes.io/rewrite-target: /

spec:

backend:

serviceName: default-http-backend

servicePort: 80

rules:

– host: mykube.info

http:

paths:

– path: /productpage

backend:

serviceName: productpage

servicePort: 9080

Create ingres based on this file:

kubectl create -f ingress.yaml

Check on the ingres:

kubectl describe ing  bookinfo

image

curl -L –resolve mykube.info:80:192.168.99.100 http://mykube.info/productpage

image

Edit hosts file:

image

and now

image

Visualizing in Dashboard

Based on https://istio.io/docs/tasks/telemetry/using-istio-dashboard.html

Install Prometheus

kubectl apply -f install/kubernetes/addons/prometheus.yaml

image

To view Istio metrics in a graphical dashboard install the Grafana add-on.

kubectl apply -f install/kubernetes/addons/grafana.yaml

image

Verify that the service is running in your cluster.

kubectl -n istio-system get svc grafana

image

kubectl -n istio-system get pod -l app=grafana -o jsonpath='{.items[0].metadata.name}’

image

kubectl -n istio-system port-forward  grafana-2894277879-b9ljj 3000:3000

image

image

Resources

Git Repository for Istio – with samples: https://github.com/istio/istio 

Guide for Istio introduction – Managing microservices with the Istio service mesh – http://blog.kubernetes.io/2017/05/managing-microservices-with-istio-service-mesh.html?m=1 

Installation of Istio into Kubernetes Cluster – https://istio.io/docs/setup/kubernetes/index.html

Tutorial  Istio is not just for microservices  – https://developer.ibm.com/recipes/tutorials/istio-is-not-just-for-microservices

Istio: Traffic Management for your Microservices – https://github.com/IBM/microservices-traffic-management-using-istio/blob/master/README.md

Istio Guide – getting started with sample application Bookinfo – https://istio.io/docs/guides/bookinfo.html

On Ingress on Minikube:

https://medium.com/@Oskarr3/setting-up-ingress-on-minikube-6ae825e98f82

https://www.ibm.com/support/knowledgecenter/en/SS5PWC/front_end_config_minikube_task.html

https://medium.com/@rothgar/exposing-services-using-ingress-with-on-prem-kubernetes-clusters-f413d87b6d34

On line course:  https://www.katacoda.com/courses/istio/deploy-istio-on-kubernetes

One Response

  1. Sibendu Das October 26, 2017