|
| 1 | +--- |
| 2 | +description: This page explains how to deploy Calico's bundled version of Istio in ambient mode. |
| 3 | +--- |
| 4 | + |
| 5 | +# Deploy Istio Ambient Mode on your cluster |
| 6 | + |
| 7 | +You can deploy Calico's bundled version of Istio in ambient mode to provide mTLS encryption to your workloads. |
| 8 | + |
| 9 | +:::note |
| 10 | + |
| 11 | +Istio Ambient Mode is a tech preview feature. |
| 12 | +Tech preview features are subject to significant changes before they become GA. |
| 13 | + |
| 14 | +::: |
| 15 | + |
| 16 | +## Limitations |
| 17 | + |
| 18 | +* [Application layer network policies](../../network-policy/application-layer-policies/alp.mdx) are not compatible with the Istio service mesh. |
| 19 | +* Istio Ambient Mode does not work together with [workload-based web application firewalls](../../threat/web-application-firewall.mdx). |
| 20 | +* The service mesh is not supported for use on clusters that are also part of a [cluster mesh](../../multicluster/index.mdx). |
| 21 | +* Destination ports are preserved only when Istio is deployed without Waypoint. |
| 22 | + If you deploy Waypoint, all traffic through Waypoint will show port 15008 as its destination port. |
| 23 | +* Connect-time load balancing is not compatible with Istio Ambient Mode. |
| 24 | + |
| 25 | +## Prerequisites |
| 26 | + |
| 27 | +* $[prodname] is installed and managed by the Tigera Operator. |
| 28 | + |
| 29 | +## Install Istio in ambient mode on your cluster |
| 30 | + |
| 31 | +You can create an Istio service mesh in ambient mode by creating the `Istio` custom resource. |
| 32 | + |
| 33 | +* To install Istio in ambient mode, apply the `Istio` custom resource to your cluster: |
| 34 | + |
| 35 | + ```bash |
| 36 | + cat <<EOF | kubectl apply -f - |
| 37 | + apiVersion: operator.tigera.io/v1 |
| 38 | + kind: Istio |
| 39 | + metadata: |
| 40 | + name: default |
| 41 | + EOF |
| 42 | + ``` |
| 43 | +
|
| 44 | + :::note |
| 45 | + To customize resource requirements for your Istio deployment, see the options available in the [installation API documentation](../../reference/installation/api.mdx). |
| 46 | + ::: |
| 47 | +
|
| 48 | + To verify the installation: |
| 49 | +
|
| 50 | + ```bash |
| 51 | + kubectl get tigerastatus |
| 52 | + ``` |
| 53 | +
|
| 54 | + ```shell title='Example output' |
| 55 | + NAME AVAILABLE PROGRESSING DEGRADED SINCE |
| 56 | + apiserver True False False 9m59s |
| 57 | + calico True False False 9m4s |
| 58 | + intrusion-detection True False False 5m39s |
| 59 | + ippools True False False 10m |
| 60 | + // highlight-next-line |
| 61 | + istio True False False 19s |
| 62 | + log-collector True False False 8m34s |
| 63 | + log-storage True False False 10m |
| 64 | + log-storage-access True False False 4m24s |
| 65 | + log-storage-dashboards True False False 4m58s |
| 66 | + log-storage-elastic True False False 5m4s |
| 67 | + log-storage-esmetrics True False False 4m54s |
| 68 | + log-storage-kubecontrollers True False False 5m9s |
| 69 | + log-storage-secrets True False False 10m |
| 70 | + manager True False False 8m24s |
| 71 | + monitor True False False 9m44s |
| 72 | + policy-recommendation True False False 9m24s |
| 73 | + tiers True False False 9m44s |
| 74 | + ``` |
| 75 | + Now you can add your workloads to the Istio service mesh. |
| 76 | +
|
| 77 | +## Add a workload to the Istio service mesh |
| 78 | +
|
| 79 | +You can add workloads to the mesh by labeling them. |
| 80 | +Communication between labelled namespaces and pods goes through the mesh and uses mTLS encryption. |
| 81 | +
|
| 82 | +:::warning |
| 83 | +
|
| 84 | +Don't label $[prodname] resources to add them to the service mesh. |
| 85 | +Doing this can cause interruptions and failure to your cluster network. |
| 86 | +
|
| 87 | +If you want to secure $[prodname] components, see [Secure Calico component communications](../../operations/comms/index.mdx). |
| 88 | +::: |
| 89 | +
|
| 90 | +1. To add workloads to your Istio service mesh, add the `istio.io/dataplane-mode=ambient` label to a pod or namespace resource: |
| 91 | +
|
| 92 | + ```bash title='Adding a namespace to the Istio service mesh' |
| 93 | + kubectl label namespace <namespace> istio.io/dataplane-mode=ambient |
| 94 | + ``` |
| 95 | + Replace `<namespace>` with the namespace you want to include in the mesh. |
| 96 | +
|
| 97 | + ```bash title='Adding a pod to the Istio service mesh' |
| 98 | + kubectl label pod --namespace=<namespace> <pod> istio.io/dataplane-mode=ambient |
| 99 | + ``` |
| 100 | + Replace the following: |
| 101 | + * `<pod>`: The name of the pod you want to include in the mesh. |
| 102 | + * `<namespace>`: The namespace your pod is in. |
| 103 | +
|
| 104 | +## Removing Istio |
| 105 | +
|
| 106 | +If you want to remove Istio, first remove the labels you applied to pods and namespaces. |
| 107 | +When that's done, you can delete the `Istio` custom resource. |
| 108 | +
|
| 109 | +1. Remove the label from namespaces and pods by running the following commands: |
| 110 | +
|
| 111 | + ```bash |
| 112 | + kubectl label namespaces --all istio.io/dataplane-mode=ambient- |
| 113 | + kubectl label pods --all --all-namespaces istio.io/dataplane-mode=ambient- |
| 114 | + ``` |
| 115 | +1. Remove the `Istio` custom resource: |
| 116 | +
|
| 117 | + ```bash |
| 118 | + kubectl delete istio.operator.tigera.io default |
| 119 | + ``` |
| 120 | +
|
| 121 | +## Troubleshooting commands |
| 122 | +
|
| 123 | +Check whether Istio pods are deployed: |
| 124 | +
|
| 125 | +```bash |
| 126 | +kubectl get pods -n calico-system | grep 'istio\|ztunnel' |
| 127 | +``` |
| 128 | +
|
| 129 | +Check whether Istio CRDs are deployed: |
| 130 | +
|
| 131 | +```bash |
| 132 | +kubectl get crd | grep istio |
| 133 | +``` |
| 134 | +
|
| 135 | +Check which pods and namespaces are in the mesh: |
| 136 | +
|
| 137 | +* Requires [istioctl](https://istio.io/latest/docs/ops/diagnostic-tools/istioctl/). |
| 138 | +
|
| 139 | +```bash |
| 140 | +istioctl ztunnel-config workloads -n calico-system |
| 141 | +``` |
| 142 | +
|
| 143 | +Check for errors logged by the zTunnel component: |
| 144 | +
|
| 145 | +```bash |
| 146 | +ZTUNNEL_PODS=$(kubectl get pod -n calico-system \ |
| 147 | + -l app.kubernetes.io/name=ztunnel \ |
| 148 | + -o jsonpath='{.items[*].metadata.name}') |
| 149 | +
|
| 150 | +for P in $ZTUNNEL_PODS; do |
| 151 | + echo "--- Checking logs for pod: $P ---" |
| 152 | + kubectl logs $P -n calico-system 2>/dev/null | \ |
| 153 | + grep -i error | \ |
| 154 | + grep -i app1 |
| 155 | +done |
| 156 | +``` |
| 157 | +
|
| 158 | +## Additional resources |
| 159 | +
|
| 160 | +* [Overview of Istio ambient mode](https://istio.io/latest/docs/ambient/overview/). |
| 161 | +* [Configuration options](../../reference/installation/api). |
0 commit comments