Setup a Kubernetes Cluster
In this module, you set up a Kubernetes cluster that has Istio installed and a namespace to use throughout the tutorial.
Ensure you have access to a Kubernetes cluster7. You can use the Google Kubernetes Engine8 or the IBM Cloud Kubernetes Service9.
Create an environment variable to store the name of a namespace that you will use when you run the tutorial commands. You can use any name, for example
tutorial
.Create the namespace:
Install Istio10 using the
demo
profile.The Kiali11 and Prometheus12 addons are used in this example and need to be installed. All addons are installed using:
Create a Kubernetes Ingress resource for these common Istio services using the
kubectl
command shown. It is not necessary to be familiar with each of these services at this point in the tutorial.- Grafana14
- Jaeger15
- Prometheus16
- Kiali17
The
kubectl
command can accept an in-line configuration to create the Ingress resources for each service:Create a role to provide read access to the
istio-system
namespace. This role is required to limit permissions of the participants in the steps below.Create a service account for each participant:
Limit each participant’s permissions. During the tutorial, participants only need to create resources in their namespace and to read resources from
istio-system
namespace. It is a good practice, even if using your own cluster, to avoid interfering with other namespaces in your cluster.Create a role to allow read-write access to each participant’s namespace. Bind the participant’s service account to this role and to the role for reading resources from
istio-system
:Each participant needs to use their own Kubernetes configuration file. This configuration file specifies the cluster details, the service account, the credentials and the namespace of the participant. The
kubectl
command uses the configuration file to operate on the cluster.Generate a Kubernetes configuration file for each participant:
Set the
KUBECONFIG
environment variable for the${NAMESPACE}-user-config.yaml
configuration file:Verify that the configuration took effect by printing the current namespace:
You should see the name of your namespace in the output.
If you are setting up the cluster for yourself, copy the
${NAMESPACE}-user-config.yaml
file mentioned in the previous steps to your local computer, where${NAMESPACE}
is the name of the namespace you provided in the previous steps. For example,tutorial-user-config.yaml
. You will need this file later in the tutorial.If you are an instructor, send the generated configuration files to each participant. The participants must copy their configuration file to their local computer.
Congratulations, you configured your cluster for the tutorial!
You are ready to setup a local computer6.