Skip to content

Commit

Permalink
mc tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
leandroberetta committed Aug 8, 2023
1 parent bd2eca7 commit fe911df
Show file tree
Hide file tree
Showing 17 changed files with 461 additions and 280 deletions.
15 changes: 15 additions & 0 deletions content/en/docs/Tutorials/multicluster/01-Introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: "Introduction"
description: "Observe the Travels application deployed in multiple clusters with the new capabilities of Kiali."
weight: 1
---

So far, we know how good Kiali can be to understand applications, their relationships with itself and also with external applications.

In the past, Kiali was installed just to observe one cluster with all the applications that conforms to it. Today, we are expanding its capabilities to also observe more than one cluster. The extra clusters are remotes, meaning that there is not a control plane in them, they only have applications.

This topology is called [primary-remote](https://istio.io/latest/docs/setup/install/multicluster/primary-remote/) and it is very useful to spread applications into different clusters having just one primary cluster, which is where Istio and Kiali are installed.

This scenario is a good choice when as an application administrator or architect, you want to give a different set of clusters to different sets of developers and you also want that all these applications belong to the same mesh. This scenario is also very helpful to give applications high availability capabilities while keeping the observability together (we are referring to just applications in terms of high availability, for Istio, we might want to install a multi-primary deployment model, which is on the [roadmap](https://github.com/kiali/kiali/issues/5618) for the multicluster journey for Kiali).

At first, we will install one cluster, and then we will add a new cluster, the remote, and we will join it to the mesh and we will see how Kiali allows us to observe and manage both of them and their applications.
277 changes: 0 additions & 277 deletions content/en/docs/Tutorials/multicluster/01-Prerequisites.md

This file was deleted.

43 changes: 43 additions & 0 deletions content/en/docs/Tutorials/multicluster/02-Prerequisites.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: "Prerequisites"
description: "How to prepare for running the tutorial."
weight: 2
---

This tutorial is a walkthrough guide to install everything. For this reason, we will need:

* minikube
* istioctl
* helm

This tutorial was tested on:

* Minikube v1.30.1
* Istio v1.18.1
* Kiali v1.70

Clusters are provided by minikube instances, but we can choose others instead, like OpenShift or just vanilla Kubernetes installations.

We will set up some environment variables for the following commands:

```
CLUSTER_EAST="east"
CLUSTER_WEST="west"
ISTIO_DIR=""
```

As Istio will be installed on more than one cluster and it needs to communicate between clusters, we will need to create certificates for the Istio installation. We will follow the [Istio documentation related to certificates](https://istio.io/latest/docs/tasks/security/cert-management/plugin-ca-cert/) to achieve this:

```
mkdir -p certs
pushd certs
make -f $ISTIO_DIR/tools/certs/Makefile.selfsigned.mk root-ca
make -f $ISTIO_DIR/tools/certs/Makefile.selfsigned.mk $CLUSTER_EAST-cacerts
make -f $ISTIO_DIR/tools/certs/Makefile.selfsigned.mk $CLUSTER_WEST-cacerts
popd
```

The result is two certificates for then use when installing Istio in the future.
44 changes: 44 additions & 0 deletions content/en/docs/Tutorials/multicluster/03-Deploy-east-cluster.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
title: "Deploy East cluster"
description: "Deploy the East cluster which will be the primary cluster"
weight: 3
---

Run the following commands to deploy the first cluster:

```
minikube start -p $CLUSTER_EAST --network istio --memory 8g --cpus 4
```

For both clusters, we need to configure MetalLB, which is a load balancer. This is because we need to assign an external IP to the required ingress gateways to enable cross cluster communication between Istio and the applications installed.

```
minikube addons enable metallb -p $CLUSTER_EAST
```

We set up some environment variables with IP ranges that MetalLB will then assign to the services:

```
MINIKUBE_IP=$(minikube ip -p $CLUSTER_EAST)
echo $MINIKUBE_IP
MINIKUBE_IP_NETWORK=$(echo $MINIKUBE_IP | sed -E 's/([0-9]+\.[0-9]+\.[0-9]+)\.[0-9]+/\1/')
echo $MINIKUBE_IP_NETWORK
MINIKUBE_LB_RANGE="${MINIKUBE_IP_NETWORK}.20-${MINIKUBE_IP_NETWORK}.29"
echo $MINIKUBE_LB_RANGE
cat <<EOF | kubectl --context $CLUSTER_EAST apply -f -
apiVersion: v1
kind: ConfigMap
metadata:
namespace: metallb-system
name: config
data:
config: |
address-pools:
- name: default
protocol: layer2
addresses: [${MINIKUBE_LB_RANGE}]
EOF
```

We should have the first cluster deployed and ready to use.
Loading

0 comments on commit fe911df

Please sign in to comment.