Istio + Kubernetes on Windows

23534644

I’ve been recently looking into Istio, an open platform to connect and manage microservices. After Containers and Kubernetes, I believe that Istio is the next step in our microservices journey where we standardize on tools and methods on how to manage and secure microservices. Naturally, I was very excited to get my hands on Istio.

While setting up Istio on Google Kubernetes Engine (GKE) is pretty straightforward, it’s always useful to have a local setup for debugging and testing. I specifically wanted to setup Istio on my local Minikube Kubernetes cluster on my Windows machine. I ran into a few minor issues that I want to outline here in case it is useful to someone out there.

I assume you have a Minikube cluster setup already and running. If not, you can check out my previous post on how to setup and run a Minikube cluster on your Windows machine. Istio has a Quickstart tutorial for Kubernetes. I’ll follow that but it’s Linux-centric and some of the commands have to be adopted for Windows.

Download Istio

Here is the command to download Istio from Quickstart:

curl -L https://git.io/getLatestIstio | sh -

This is a Linux shell command and it won’t work on Windows cmd or PowerShell. Thankfully, someone already wrote an equivalent PowerShell script here. I used the script as is, only changed the IstioVersion to 0.5.1, the latest Istio version as of today:

param(
 [string] $IstioVersion = "0.5.1"
)

The script downloads Istio and sets an ISTIO_HOME as environment variable.

PS C:\dev\local\istio> .\getLatestIstio.ps1
Downloading Istio from https://github.com/istio/istio/releases/download/
0.5.1/istio_0.5.1_win.zip to path C:\dev\local\istio

Then, I added %ISTIO_HOME%\bin to PATH  to make sure I can run istoctl commands.

Install and Verify Istio

To install Istio and enable mutual TLS authentication between sidecars, I ran the same command in the quickstart:

PS C:\istio-0.5.1> kubectl apply -f install/kubernetes/istio-auth.yaml
namespace "istio-system" created
clusterrole "istio-pilot-istio-system" created
clusterrole "istio-sidecar-injector-istio-system" created
clusterrole "istio-mixer-istio-system" created
clusterrole "istio-ca-istio-system" created
clusterrole "istio-sidecar-istio-system" created

And verify that all the Istio pods are running:

PS C:\istio-0.5.1> kubectl get pods -n istio-system
NAME                           READY STATUS  RESTARTS AGE
istio-ca-797dfb66c5-x4bzs      1/1   Running  0       2m
istio-ingress-84f75844c4-dc4f9 1/1   Running  0       2m
istio-mixer-9bf85fc68-z57nq    3/3   Running  0       2m
istio-pilot-575679c565-wpcrf   /2    Running  0       2m

Deploy the sample app

Deploying an app is a little different on Windows as well. To deploy the BookSample app with Envoy container injection, this is the command you would normally run on Linux:

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

The redirection causes problems on PowerShell. Instead, you can first run the istioctl command and save it to an intermediate yaml:

istioctl kube-inject -f .\samples\bookinfo\kube\bookinfo.yaml > bookinfo_inject.yaml

Then, you can apply the intermediate yaml:

PS C:\istio-0.5.1> kubectl create -f .\bookinfo_inject.yaml
service "details" created
deployment "details-v1" created
service "ratings" created
deployment "ratings-v1" created
service "reviews" created
deployment "reviews-v1" created
deployment "reviews-v2" created
deployment "reviews-v3" created
service "productpage" created
deployment "productpage-v1" created
ingress "gateway" created

 

With that, you will have BookInfo app deployed and managed by Istio. Hope this was useful to get Istio + Kubernetes running in Minikube on Windows.

Advertisements

Minikube on Windows

When I’m playing with Kubernetes, I usually get a cluster from Google Kubernetes Engine (GKE) because it’s literally a single gcloud command to get a Kubernetes cluster up and running on GKE.  It is sometimes useful though to have a Kubernetes cluster running locally for testing and debugging. Minikube is perfect for this.

logo

Minikube runs a single-node Kubernetes cluster inside a VM on your laptop. There are instructions on how to install it on Linux, Mac and Windows. Unfortunately, instructions for Windows is a little lacking, so I want to document how I got Minikube up and running on my Windows 10 machine.

First, you need to download the minikube-windows-amd64.exe file, rename it to minikube.exe and add it to your path, as explained in the instructions for Windows. Instructions make it sound like you’re done at this point but if you try to start minikube in PowerShell admin mode, you will get an error like this:

carbon

This is because Minikube needs a VM and by default, it tries to use VirtualBox. On Windows, you can either use Hyper-V (available natively on Windows 10) or you can install VirtualBox. Many people (here and here) recommend VirtualBox to avoid issues but I didn’t want to install something extra like VirtualBox, so I decided to go with Hyper-V. You can tell Minikube via –vm-driver=hyperv flag to use Hyper-V but this also failed with the same error earlier.

carbon (1)

What’s happening? Turns out, there’s a bug on Minikube and Windows 10. This GitHub issue explains the details if you’re interested and this very useful comment explains what you need to do. You basically need to create a Virtual Switch in Hyper-V and allow your actual internet connection share its connection with this Virtual Switch.

After you create the Virtual Switch, you can start minikube with Hyper-V with additional –hyperv-virtual-switch flag. It’s a good idea to also delete .minikube folder under your home folder and don’t forget to start PowerShell in admin mode.

carbon

This takes a while for the first time as it needs to download ISO images etc. but once done, you can test the local cluster by creating a deployment and deploying an echoserver pod:

carbon (1)

That’s it! Hope this was useful for you to get Minikube up and running on Windows.

Little Mermaid and the Balkans

I don’t get to visit this many new places in this short amount of time usually but last week I got to visit 4 cities in 4 countries. The amazing thing was that I had never been to any of these cities or countries before!

My journey started in Copenhagen, Denmark on Monday. I had been in all countries around Denmark but not in Denmark itself, so I was happy to finally add Denmark to the list of visited countries. I had to work on Monday, so I paid a visit the Google office in Copenhagen. This was my the 27th Google office I ever visited 🙂

IMG_20171016_192415-01

Monday evening, we organised a meetup with the Google Developer Group (GDG) in the Google. I talked about .NET apps on Gooogle Cloud to a group of about 30 people. It was nice to connect with GDG members in Copenhagen. I even met someone who lived in northern Cyprus, my home country, before.

The main reason to be in Copenhagen was for DockerCon Europe conference. DockerCon is one of the largest tech conferences I’ve been this year with focus on Docker and Containers. DockerCon US happened earlier in the year in Austin, Texas and this was the second edition of the conference in Europe. Google Cloud was a sponsor, so we had a booth and I got to hang out with other Googlers from New York, San Francisco and Seattle offices. I also delivered a talk on Google Cloud and Containers to a full room of about 200 people probably. Overall, it was a nice event with lots of sessions. The highlight for me was when Docker announced Kubernetes support in the keynote on the first day. This was big news and a lot of people asked me about it at our booth after the announcement.

I only had Tuesday evening after the conference to see Copenhagen. I walked around the city a little bit and visited the Little Mermaid statue in the northern part of the town. Copenhagen is a nice little city but I didn’t find anything remarkable about it. I probably need to spend more time next time.

 

Wednesday evening, I flew to Belgrade, Serbia. This was the first time I ever visited a Balkan country. I grew up watching the breakup of Yugoslavia and the wars around them on TV when I was a boy in 1990s. It was nice to see that things are back to normal in that part of the world now.

I was there for Voxxed Days Belgrade on Thursday. Voxxed Days is another series of conferences that happen all around Europe. I spoke at Voxxed Days in Vienna and Luxembourg earlier this year, so this was my third Voxxed Days event. We had strong Google presence at the conference with 5 speakers. I got to meet my co-worker, Casey West, for the first time at the conference 🙂

Overall, I really enjoyed the conference. There were more than 500/600 people and my session on Kubernetes was well attended by probably around 200 or so people. After my talk, I answered questions for half an hour or more which is always nice. I also liked the artwork and slogans at the conference. Here’s an example.

IMG_20171019_134307-02

We received the same slogan as a t-shirt and a bag. We even received a rose liquor, a local beer and a Street Art in Belgrade book as gifts. Organisers went above and beyond to make sure people received good gifts.

On Friday, I had half a day in Belgrade, so I did what I always do in a new city: walk around. I went to the Belgrade Fortress, visited a couple of churches, tried some local cuisine and of course took some pictures. I was lucky that it was a gorgeous sunny and warm day.

 

Friday afternoon, I flew to Zagreb, Croatia with Edson Yanaga from RedHat for ChangeCon. This was a small but nicely organised event. Edson did the opening keynote and then I had my talk on Kubernetes again. It was unique that the conference happened at a local chocolate factory called Kras. Speakers also received a lot of chocolate as gifts, I probably have enough chocolate to last me for a year now 🙂

 

After Zagreb, I decided to take a day off on Monday and see the neighboring country, Slovenia. I took the bus from Zagreb to the capital of Slovenia: Ljubljana. It’s one of the nicest cities I’ve been with a nice fortress, cute old town. I only had a day there, so I just walked around the city, visited the main touristy areas and tried some local food.

 

As I head to the airport, I was quite happy about my little marathon of 4 cities in 4 countries.

Ada Lovelace Day in London, Unter den Linden in Berlin and DevFest in beautiful Lviv

October 10 was Ada Lovelace Day, a special day to celebrate women in science, technology, engineering and maths. Unfortunately, there are not enough women in software engineering and technology in general. Programs like Women Techmakers do a good job to encourage more women participation in technology with meetups, conferences and hackathons. One of those conferences, Tech(k)now Day, happened in London on Ada Lovelace Day and I was happy that Google Cloud was a sponsor. We had a booth and I was there with other Googlers answering questions. I also gave a talk on Containers and Kubernetes to a small group of 30+ people.

IMG_20171010_093939

After my talk, I had to rush to another conference, JAX London. It had been a while since I gave 2 talks in 1 day but at least, it was on the same topic. JAX is mainly a Java conference in a few different cities in Germany and London. I spoke at JAX conference in Mainz, Germany before. Like in Mainz, the event in London was well organised and my session was full with 100+ people, some standing (sorry!).

IMG_20171010_175742

Wednesday was travel day for Codemotion Berlin conference. I have been to Berlin before once about 5 years ago and I remember really liking it. It’s a nice city with a good vibe, good beer and lots of places to see. The tech scene in Berlin is pretty good as well. I’ve been to Germany a number of times since then but never to Berlin, so I was excited to visit again. After I finished some work at the hotel, I walked around the city a little bit. Brandenburg Gate, Reichstag Building and the Tiergarten were all near, so I didn’t waste the chance to take some pictures. Google also has an office in Berlin, I stopped by quickly to get lunch. This was my 26th Google office that I visited in my travels 🙂

Codemotion is a generalist IT/Tech conference that happens in multiple cities throughout Europe. I spoke at their events in Milan, Tel Aviv and Amsterdam before, so Berlin was the fourth Codemotion that I had the chance to speak. I again talked about containers and Kubernetes to a small group of about 40 people.

After my 24 hours in Berlin, it was time to fly to beautiful Lviv in western Ukraine to speak at DevFest Ukraine. DevFests are community organised conferences organised by Google Developer Groups (GDGs). They usually happen from September until December and some of them are like big meetups of 100 people and some of them are quite big, more than 1000 people.

I visited Lviv for the first time last year in September. At that time, I hadn’t heard anything about Lviv and I had never been to Ukraine before. I also did not know what DevFests were, so I had zero expectations. As they say, when you have zero expectations, you always get nice surprises and that’s exactly what happened with Lviv last year. I had a really good time there. The city was beautiful, I met a lot of good people that I kept in touch throughout the year and the DevFest Ukraine was one of the best and fun conferences that I attended last year.

As you can imagine, I was looking forward to visiting Lviv again and of course, DevFest Ukraine did not disappoint. This year it was more than 1000 people at the conference. There were a lot of great speakers from different companies. I did a talk on Apache Beam and Dataflow, got to meet a number of friends again, visited my favorite places in Lviv, took lots of pictures and drank quite a bit of cherry liquor at the speaker’s dinner evening after the conference 😉

It was also a little bit sad. Organisers announced that 2018 will be the last year the current committee will organise a DevFest. These people put a lot of time and effort into organising DevFest Ukraine in the last 5 years and I guess they want to take a break. While I understand it, it is still quite sad that such an amazing community event will come to an end in 2018.

This was one of those weeks that I wished did not end but as they say, all good things come to an end.

Autumn in London, Stockholm’s Nordic charm and the independence dilemma in Catalunya

Last week has been pretty eventful with conferences & travel.

First, I got to spend some time in London on the weekend. It was nice to be home and not travelling for once. After travelling all around, I now feel like a tourist coming back to London and as a result, I get to plan my time much better and I’ve been enjoying London more lately. A good side effect of travel is the appreciation of your own city, I suppose 🙂

One of the things that I truly love about London is the amazing parks. I don’t know any other big city with some much green space. When I first moved to London, I chose to live in Greenwich and the Greenwich park played a big part in that decision. It also felt like an interesting place with the Prime Meridian and the Royal Observatory. I’m still in Greenwich, so I must have made the right decision.

I hadn’t been to the Greenwich park lately, so I decided to pay a visit with a good friend. The park was beautiful and peaceful, as it always is. The changing colours of the leaves reminded me that we are unmistakably in autumn.

A post shared by Mete Atamel (@meteatamel) on

I also visited Regent’s Park, another great park in London with another friend. I always visit this park at least once in the summer to see the fantastic rose garden. This time around, there were no roses left.

Two parks in one weekend got me ready for the busy week ahead. On Monday, I flew to Stockholm for Google Cloud Summit. Back in February 2016, Stockholm was the first city I travelled to for a conference as a Googler, so it’s kind of special for me. My co-worker, Ray, took me there for a conference called JFokus. At the time, I had no idea about JFokus but it’s one of the best Java and Software Engineering conferences in Europe. I applied to speak at JFokus in 2018, who knows, maybe I’ll get to visit again.

The Google Cloud Summit was on Tuesday. It was in a big waterfront conference hall in downtown. This time I wasn’t speaking but just helping with the Kubernetes booth and demo. It was nice to enjoy a conference once without the stress of a talk.

IMG_20171003_112530-01

I also had a very nice surprise in Stockholm. Whenever I visit a place, I usually try to ping people I know in that place. This time I pinged Jacob, an ex-coworker of mine from Skype, who is from Sweden but he now lives in Thailand. I had zero hope that he’d be around but turns out, he was visiting Sweden for a few days and he happened to be in town! We ended up meeting after probably 3 years, had a drink and talked about the good old Skype days.

A post shared by Mete Atamel (@meteatamel) on

On Wednesday, I was back in London and I was due to speak at IPExpo Europe. It was at Excel, one of the biggest conference halls of London. I love visiting Excel because it’s literally across the Thames river from my flat, so very close to me. Better yet, I get to take the Emirates Cable Car from my side of the river to the other side where Excel is 🙂 The views of Greenwich, Docklands and Canary Wharf from the cable car never get old.

IMG_20171004_132638-01IMG_20171004_162414-01

IPExpo was a big conference with a unique setup. It was pretty much a big technology fair with lots of booths from different companies. The talks happened in the big expo area out in the open. People in my talk had to wear headsets to hear me because there was a lot of background noise from hundreds of people around. To be honest, it was quite distracting and challenging for me to speak in an open area with all the background noise. I also had only 30 minutes for my talk, but in the end, I think I did a good job.

IMG_20171004_160831
I was in the office on Thursday after a couple of weeks but it was only for one day. On Friday, I flew to one of my favorite cities in Europe: Barcelona. This was my third time in Barcelona but I can visit this city many more times. The city has a good vibe, friendly people, amazing food and the weather is always nicer than London! This Barcelona song captures my mood every time I go there.

When I arrived to Barcelona, it was already late afternoon and I was starving, so I visited my favorite tapas place: Maitea. This is a small tapas place that I discovered when I first visited Barcelona 5 years ago. They have amazing tapas and my favourite Pimientos did not disappoint.

IMG_20171006_165006-02

On Saturday, I spoke at Polycon Conference. Polycon is a mid-size software conference. It does not have a strong theme. There were talks on different kinds of topics and programming languages and they had workshops in the afternoon. I had the first talk of the day which is always nice. I talked about containers, Kubernetes and Google Cloud. The good food and the 8 hours of sleep the day before definitely helped me to deliver a good relaxed talk and I got feedback from attendees afterwards.

IMG_20171007_091521

After the conference, I got to explore Barcelona more. The weather was good, so I walked all over the city. When I got tired, I got to the beach and had a couple of drinks on the beach.

A post shared by Mete Atamel (@meteatamel) on

Like Stockholm, Barcelona had a nice surprise for me in store. Sevki, a friend whom I met in my first visit to Stockholm back in 2016, saw my status on Facebook and messaged me. He apparently moved from Stockholm and now lives in Barcelona and asked if I wanted to have a drink. We ended up having not one but many drinks in the end. It was nice to catch up with him.

Sunday, I had a little more time to walk around the city before my flight. There were demonstrations all over the city about the Catalan independence referandum. This time, pro-Spain and pro-European Union people were demonstrating against independence. I was amazed how many people were out in the streets with Spanish and Catalan flags.

A post shared by Mete Atamel (@meteatamel) on

It was also good to see the other side of the story. I was under the impression that every Catalan wanted independence but the huge number of people in the streets against independence showed me that it’s actually not that clear cut.

I wrapped up my Barcelona trip with a visit to the beach and of course to The Sagrada Familia.

A post shared by Mete Atamel (@meteatamel) on

Wow, this was a much longer post than I expected but I guess it’s a sign of a good week with 3 conferences in 3 great cities and 2 unexpected friends…