Prepare for Service-Mesh-Workshop

Install Docker Desktop

Hint:
The demos in the workshop should also work with Minikube. Due to better user experience with Docker Desktop, the workshop was designed with Docker Desktop. Everybody who is experienced with Minikube can switch to Minikube.

Download and Install

Follow the link to start Docker Desktop installation:

https://www.docker.com/products/docker-desktop

Verify Installation

After installation and starting Docker Desktop you can verify a succesful installation by clicking on About Docker Desktop in the context menu. The following dialog will appear:

An alternative way to verify the installation is to use the following shell command:

docker version

Activate Kubernetes

Right click on Docker Desktop and open the Preferences (or Settings) dialog. A click on Kubernetes menu opens the following dialog:

Check Enable Kubernetes and Apply & Restart to activate Kubernetes. Depending on the internet speed, this step can take some time (only for the first time of execution). A download for all necessary Kubernetes containers gets started in the background. A succesful installed and started Kubernetes will be shown in the status area.

You can see the downloaded containers by clicking on Show system containers (advanced) :

➜  docker images | grep k8s
...

Docker Desktop also installs kubectl. To verify this part of the installation you can check kubectl with the following shell command:

➜  kubectl version

Setup Istio

We use Istio 1.15.0 in this workshop.
More background information can be found on this page:

https://istio.io/docs/setup/getting-started/

Change Settings in Docker Desktop

Recommended settings to run Istio in Docker Desktop:

https://istio.io/docs/setup/platform-setup/docker/

The recommended settings are 4 CPUs and 8 GB RAM, as shown on this screenshot:

Download Istio

➜ curl -L https://istio.io/downloadIstio | ISTIO_VERSION=1.15.0 sh -
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   102  100   102    0     0    143      0 --:--:-- --:--:-- --:--:--   143
100  4579  100  4579    0     0   5916      0 --:--:-- --:--:-- --:--:--  5916

Downloading istio-1.15.0 from https://github.com/istio/istio/releases/download/1.15.0/istio-1.15.0-osx.tar.gz ...
Istio 1.15.0 Download Complete!

Istio has been successfully downloaded into the istio-1.15.0 folder on your system.

Next Steps:
See https://istio.io/latest/docs/setup/install/ to add Istio to your Kubernetes cluster.

To configure the istioctl client tool for your workstation,
add the /Users/michael/Work/tools/istio-1.15.0/bin directory to your environment path variable with:
	 export PATH="$PATH:/Users/michael/Work/tools/istio-1.15.0/bin"

Begin the Istio pre-installation check by running:
	 istioctl x precheck

Need more information? Visit https://istio.io/latest/docs/setup/install/

Take the following snippet from the output of the previous download:

➜  export PATH="$PATH:/Users/michael/Temp/istio-1.15.0/bin"

Hint: the value of the download folder which will be set as PATH variable depends on the folder where you started the download.

Install Istio

Make sure your Kubernetes Context is set for Docker Desktop Kubernetes:

➜  kubectl config current-context
docker-desktop

or set the current context:

➜  kubectl config set current-context docker-desktop
Property "current-context" set.

Now it's time to install Istio into your new Kubernetes cluster. For demonstration purposes we use Istio's demo profile. Information about the profiles can be found here:

https://istio.io/docs/setup/install/istioctl/#install-a-different-profile

To install Istio with demo profile follow the instructions on this site:

https://istio.io/docs/setup/kubernetes/additional-setup/config-profiles/
➜  istioctl install --set profile=demo
This will install the Istio 1.15.0 demo profile with ["Istio core" "Istiod" "Ingress gateways" "Egress gateways"] components into the cluster. Proceed? (y/N) y
✔ Istio core installed
✔ Istiod installed
✔ Egress gateways installed
✔ Ingress gateways installed
✔ Installation complete

To verify our Istio installation we can enter this command:

➜  istioctl verify-install

Every line of this lengthy output should end with successfully and the last lines should look like this:

Checked 15 custom resource definitions
Checked 3 Istio Deployments
✔ Istio is installed and verified successfully

A shorter way to verify the Istio CRDs:

➜ kubectl get crds | grep 'istio.io' | wc -l
      15

Install Prometheus, Grafana, Jaeger, Kiali

Istio changed the way to install add ons. These add ons must be installed separately:

Prometheus

https://istio.io/latest/docs/ops/integrations/prometheus/

kubectl apply -f https://raw.githubusercontent.com/istio/istio/release-1.13/samples/addons/prometheus.yaml

Grafana

https://istio.io/latest/docs/ops/integrations/grafana/

kubectl apply -f https://raw.githubusercontent.com/istio/istio/release-1.13/samples/addons/grafana.yaml

Jaeger

https://istio.io/latest/docs/ops/integrations/jaeger/

kubectl apply -f https://raw.githubusercontent.com/istio/istio/release-1.13/samples/addons/jaeger.yaml

Kiali

https://istio.io/latest/docs/ops/integrations/kiali/

kubectl apply -f https://raw.githubusercontent.com/istio/istio/release-1.13/samples/addons/kiali.yaml

Check Installation

So lets check what happened during Istio installation:
A new namespace istio-system was created:

➜  kubectl get ns
NAME              STATUS   AGE
default           Active   126m
istio-system      Active   15m
kube-node-lease   Active   126m
kube-public       Active   126m
kube-system       Active   126m

and these pods where started in this namespace:

➜  kubectl get pods -n istio-system
NAME                                   READY   STATUS    RESTARTS   AGE
grafana-784c89f4cf-zd5cb               1/1     Running   0          4m20s
istio-egressgateway-96cf6b468-chd6x    1/1     Running   0          5m9s
istio-ingressgateway-57b94d999-pqz8s   1/1     Running   0          5m9s
istiod-58c5fdd87b-m4np9                1/1     Running   0          5m13s
jaeger-7f78b6fb65-v8fx9                1/1     Running   0          4m12s
kiali-dc84967d9-lgqq7                  1/1     Running   0          3m8s
prometheus-7bfddb8dbf-l4z6p            2/2     Running   0          4m31s

Hint: since Istio 1.5 the control plane consists of only one pod named istiod

Install Shell-Completion for Kubernetes and Istio

Working with Kuberntes and Istio is mainly done with shell commands. To avoid typing errors you should install the appropriate shell-completions.

Kubernetes:

https://kubernetes.io/de/docs/tasks/tools/install-kubectl/#aktivieren-der-automatischen-autovervollständigung-der-shell

Istio:

https://istio.io/docs/ops/troubleshooting/istioctl/#istioctl-auto-completion

IDE, Maven and Gradle

To change the Java code of the services in our exercises, everybody can use their preferred IDE. Building the services (war files) will be done with Maven Wrapper and Gradle Wrapper (both wrappers are part of the source projects).

Pre-Pull Base Docker Images

Just in case the network at the workshop location is slow, please pull the following Docker images to get it into your local Docker cache:

➜  docker pull michaelhofmann/smw-openliberty:latest
➜  docker pull michaelhofmann/smw-java:latest

We will use these images as base images for our services.

Log Streaming with Stern

Everybody who wants a better experience with log streaming can use stern:

https://github.com/wercker/stern