Istio Service Mesh Workshop: Setup Requirements
This page is for the instructor or cluster administrator who prepares the lab environment. It lists everything that the exercises rely on, derived from the commands and manifests in the modules. It has two audiences: the admin preparation (cluster, operators, attendee projects, roles and images, which need cluster-admin permissions and are done once before the lab) and the attendee workstation (the command-line tools that each attendee runs, as a project user without cluster-level permissions). Attendees can skip to Attendee Workstation and Verification Checklist.
The exercises are written for Red Hat OpenShift Service Mesh 3.4, which is based on Istio 1.30. Attendees work as project users in their own namespace <user>-sandbox on a shared cluster.
Cluster
-
OpenShift version: an OpenShift Container Platform 4 release that OpenShift Service Mesh 3.4 supports (see the OpenShift Service Mesh 3.4 release notes for the supported versions). The content does not depend on a specific OpenShift minor version.
-
Topology and size: the exercises do not need a specific number of worker nodes. No exercise depends on pods running on different nodes, so a compact or single-node cluster works if it has capacity for all attendees. Plan capacity per attendee: when an attendee has completed all modules, the attendee namespace runs about 24 pods (Module 1: 3, Module 2: 7 including the ingress gateway, Module 3: 12, Module 4: 2), each with an Envoy sidecar. With the default Istio sidecar resource requests (100m CPU and 128Mi memory per proxy), this is roughly 2.4 CPU cores and 3 GiB of memory requested per attendee, before the application containers. If the attendee projects have a
ResourceQuotaorLimitRange, size them accordingly or ask attendees to delete the workloads of earlier modules. -
Cluster features: the exercises use only the Kubernetes API and the Envoy sidecars. They do not need the metrics API, user workload monitoring, an external load balancer, Routes or the Kubernetes Gateway API. The ingress gateway Service is of type
ClusterIP, and attendees reach it withoc port-forward. -
Security context constraints: the attendee workloads run under the default
restricted-v2SCC. The workshop uses thenginx-unprivilegedimage (port 8080) for that reason, and Istio CNI removes the need for privileged init containers. -
Network policies: if the attendee projects get default
NetworkPolicyobjects (for example from a project template), they must allow traffic between pods in the same namespace, ingress from the sidecars of the same namespace on the application and gateway ports, and egress toistiodinistio-system(port 15012).
Operators and Cluster Components
| Component | Install source | Namespace | Configuration needed | Used in |
|---|---|---|---|---|
Red Hat OpenShift Service Mesh 3 Operator ( |
OperatorHub, |
|
Default subscription. |
All modules |
|
Created from the Service Mesh operator ( |
|
Named |
All modules |
|
Created from the Service Mesh operator ( |
|
Named |
All modules (Module 1, Exercise 1 checks it) |
Sidecar injector (part of |
Included in the |
|
Injects sidecars into namespaces labeled |
All modules |
Kiali, Prometheus, Grafana, Tempo and Jaeger are described in Module 4 (Content) as options, but no exercise uses them. You do not need to install them. The ingress gateway is not installed by the administrator: each attendee deploys their own with gateway injection in Module 2.
Install the Control Plane
After you install the operator, create the namespaces and the Istio and IstioCNI resources:
oc create namespace istio-system
oc create namespace istio-cni
oc apply -f - <<EOF
apiVersion: sailoperator.io/v1
kind: Istio
metadata:
name: default
spec:
namespace: istio-system
updateStrategy:
type: InPlace
---
apiVersion: sailoperator.io/v1
kind: IstioCNI
metadata:
name: default
spec:
namespace: istio-cni
EOF
Without spec.version, the operator installs its default Istio version. If the operator offers several versions, set spec.version in both resources to an Istio 1.30 version.
Cluster That Already Runs Istio
If the cluster already has a Service Mesh control plane, do not run the install block above: applying it would overwrite the existing Istio resource.
Attendees can use the existing mesh instead. Check these points first:
-
Discovery selectors: if the
Istioresource setsspec.values.meshConfig.discoverySelectors, the control plane ignores namespaces that do not match. Label each attendee namespace to match (for exampleistio-discovery=enabled) when you create it in Attendee Accounts, Projects and Roles; attendees cannot label their own namespaces. -
Revision: use the existing revision for
istio.io/revand set theistio_revisionattribute to it (see Control Plane Revision). Do not add anistio-injectionlabel as well. -
Access log format: the exercises read the default text access-log format. If
spec.values.meshConfig.accessLogEncodingisJSON, the log lines in Modules 1 and 4 look different, and thegrepandawkfilters in Module 4, Exercises 3 and 4 print nothing. -
Mesh-wide Telemetry: a
Telemetryresource in the root namespace (istio-system) can filter access logs or disable metrics. The namespace-levelTelemetryfrom Module 4 overrides the access-log settings; check thatistio_requests_totalis still reported. -
Multi-cluster meshes: in a multi-cluster mesh, attendee services also become visible to the other clusters in the mesh.
To find these settings:
oc get istio -o yaml
oc get telemetry -n istio-system
Control Plane Revision
Attendee namespaces are labeled with the revision of the control plane (istio.io/rev). Look up the revision name:
oc get istiorevisions
With the InPlace update strategy the revision is named after the Istio resource, default. With the RevisionBased strategy the name includes the version, for example default-v1-30-5. Set the istio_revision attribute (see Content Attributes) to this name.
Content Attributes
The following AsciiDoc attributes control the values that the pages show. Set them in both content/antora.yml, which the full site uses, and workshops/istio/antora.yml, which applies when this workshop is built alone:
| Attribute | Default | Purpose |
|---|---|---|
|
|
Istio version in prose and in links to the Istio repository ( |
|
|
OpenShift Service Mesh version in prose. |
|
|
Control plane revision that attendee namespaces are labeled with ( |
|
|
Attendee username. Showroom sets it per attendee. The pages derive the namespace ( |
Attendee Accounts, Projects and Roles
Each attendee needs a user account (for example user1) and a namespace named <user>-sandbox (for example user1-sandbox). Attendees do not create the namespace; the exercises start by setting NAMESPACE=user1-sandbox. No provisioning files exist in this repository; run the following commands as a cluster administrator, with the list of attendee usernames.
-
Create the attendee namespaces and make each attendee an
adminof their own namespace. The exercises create Deployments, Services, ConfigMaps and Istio resources, delete AuthorizationPolicies, and useoc exec,oc logsandoc port-forward, which theadmin(oredit) role allows:for u in user1 user2 user3; do oc create namespace "${u}-sandbox" oc adm policy add-role-to-user admin "${u}" -n "${u}-sandbox" done -
Label every attendee namespace for sidecar injection with the revision from Control Plane Revision. Project users cannot label namespaces or list IstioRevisions, so the attendees cannot do this themselves:
REVISION=default for u in user1 user2 user3; do oc label namespace "${u}-sandbox" istio.io/rev="${REVISION}" \ --overwrite done -
Grant every attendee the read-only
viewrole inistio-systemandistio-cni. Module 1, Exercise 1, Step 1 lists the pods and DaemonSets there to check that the mesh is running:for u in user1 user2 user3; do oc adm policy add-role-to-user view "${u}" -n istio-system oc adm policy add-role-to-user view "${u}" -n istio-cni done -
Check that the
adminrole in the attendee namespaces covers the Istio APIs. The exercises create resources in the API groupsnetworking.istio.io(Gateway, VirtualService, DestinationRule),security.istio.io(PeerAuthentication, RequestAuthentication, AuthorizationPolicy) andtelemetry.istio.io(Telemetry):for r in \ gateways.networking.istio.io \ virtualservices.networking.istio.io \ destinationrules.networking.istio.io \ peerauthentications.security.istio.io \ requestauthentications.security.istio.io \ authorizationpolicies.security.istio.io \ telemetries.telemetry.istio.io; do echo -n "$r: " oc auth can-i create "$r" \ -n user1-sandbox \ --as=user1 doneEvery line must print
yes. If a line printsno, the cluster does not aggregate the Istio APIs into theadminrole. Create a ClusterRole for them and bind it in every attendee namespace:oc apply -f - <<EOF apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: workshop-istio-editor rules: - apiGroups: ["networking.istio.io", "security.istio.io", "telemetry.istio.io"] resources: ["*"] verbs: ["get", "list", "watch", "create", "update", "patch", "delete", "deletecollection"] EOF for u in user1 user2 user3; do oc adm policy add-role-to-user workshop-istio-editor "${u}" \ -n "${u}-sandbox" done
The following stays instructor-only: installing the operator, creating and changing the Istio and IstioCNI resources, listing IstioRevisions, labeling namespaces, and any change in istio-system and istio-cni. Attendees only read those two namespaces. Module 1, Exercise 1, Step 3 shows the labeling command for attendees who use their own cluster with cluster administrator permissions.
Attendee Workstation
Attendees need a shell with the following tools. The commands work in a web terminal or a tools pod in the cluster, as long as oc port-forward and the following curl http://localhost:... run in the same shell (Module 2, Exercises 3 and 5; Module 4, Exercises 1 and 7). In a Showroom environment that includes the shared OpenShift 102 CLI tools, the index page shows how to use that container.
| Tool | Version | Where it is used |
|---|---|---|
|
Matching the cluster version (tested with OpenShift Service Mesh 3.4) |
All modules. Must be logged in as the attendee user ( |
|
Istio 1.30, matching the control plane (Red Hat build or upstream release) |
Module 1, Exercise 3, Step 2 ( |
|
Any recent version |
Module 2 (requests through the port-forwarded ingress gateway); Module 4 (port-forwarded Envoy metrics and admin endpoints). Requests inside the mesh run |
|
Standard POSIX/GNU versions |
Loops and log analysis in Modules 2 to 4 ( |
Network and Image Access
The attendee workloads pull the following images:
| Image | Used by |
|---|---|
|
Demo applications in all modules ( |
|
Test clients ( |
OpenShift Service Mesh proxy image ( |
Sidecars and the attendee ingress gateways ( |
OpenShift Service Mesh operator, |
Control plane, installed by the administrator |
External URLs: the exercises do not fetch anything from the internet at run time. The JWT key set in Module 3 is inline in the RequestAuthentication (jwks), and the test token is part of the page. The link to the Istio repository (github.com/istio/istio, Module 3) is reference reading only. All other host names (myapp-{user}.example.com, auth.example.com) are only sent as Host headers or appear in examples that are not applied.
Disconnected or restricted-egress clusters:
-
Mirror the OpenShift Service Mesh 3 operator catalog and its images with
oc-mirror, as for any Red Hat operator. -
Mirror
quay.io/nginx/nginx-unprivileged:latestandquay.io/curl/curl:latestand add anImageDigestMirrorSet(orImageTagMirrorSet, because the exercises use tags), or allow egress toquay.io. -
Attendees need
ocand, for Module 4, Exercise 5,istioctlon their workstation or in the web terminal before the lab.
Verification Checklist
Run as the instructor (cluster administrator):
oc get istio default # Ready/Healthy, one revision in use
oc get istiocni default # Ready/Healthy
oc get istiorevisions # one revision, name equals
# istio_revision, READY True
oc get pods \
-n istio-system \
-l app=istiod # istiod pods Running
oc get daemonset -n istio-cni # DESIRED equals READY
# (one pod per node)
oc get namespace -l istio.io/rev --show-labels |
grep -- -sandbox # every attendee namespace listed
oc auth can-i create virtualservices.networking.istio.io \
-n user1-sandbox \
--as=user1 # yes
oc auth can-i create pods/portforward \
-n user1-sandbox \
--as=user1 # yes
oc auth can-i list pods \
-n istio-system \
--as=user1 # yes
oc auth can-i patch namespace/user1-sandbox --as=user1 # no
Run as an attendee (or as the instructor with one attendee namespace):
export NAMESPACE=user1-sandbox
oc whoami # user1
oc get namespace $NAMESPACE \
--show-labels # contains
# istio.io/rev=default
oc get pods \
-n istio-system \
-l app=istiod # istiod pods Running (no Forbidden)
istioctl version --remote=false # client version 1.30.x
# (needed for Module 4, Exercise 5)
Then deploy the test application of Module 1, Exercise 1, Step 5. The pod must become Running with an istio-proxy container next to the application container (Step 6); this confirms the image pulls, the namespace label and the sidecar injection.