|
| 1 | +// Module included in the following assemblies: |
| 2 | + |
| 3 | +// * service-mesh-docs-main/install/ossm-istio-ambient-mode.adoc |
| 4 | + |
| 5 | +:_mod-docs-content-type: PROCEDURE |
| 6 | +[id="ossm-deploying-bookinfo-application-istio-ambient-mode_{context}"] |
| 7 | += Deploying the Bookinfo application in Istio ambient mode |
| 8 | + |
| 9 | +You can deploy the `bookinfo` sample application in {istio} ambient mode without sidecar injection by using the `ZTunnel` proxy. For more information on `bookinfo` application, see "About the Bookinfo application". |
| 10 | + |
| 11 | +.Prerequisites |
| 12 | + |
| 13 | +* You have deployed a cluster on {ocp-product-title} 4.15 or later, which includes the supported {k8s} Gateway API custom resource definitions (CRDs) required for {istio} ambient mode. |
| 14 | +* You are logged in to the {ocp-product-title} cluster either through the web console as a user with the `cluster-admin` role, or with the `oc login` command, depending on the installation method. |
| 15 | +* You have installed the {SMProductName} Operator, created the {istio} resource, and the Operator has deployed {istio}. |
| 16 | +* You have created an `IstioCNI` resource, and the Operator has deployed the necessary `IstioCNI` pods. |
| 17 | +* You have created a `Ztunnel` resource, and the Operator has deployed the necessary `Ztunnel` pods. |
| 18 | +
|
| 19 | +.Procedure |
| 20 | + |
| 21 | +. Create the `bookinfo` namespace by running the following command: |
| 22 | ++ |
| 23 | +[source,terminal] |
| 24 | +---- |
| 25 | +$ oc create namespace bookinfo |
| 26 | +---- |
| 27 | + |
| 28 | +. Add the `istio-discovery=enabled` label to the `bookinfo` namespace by running the following command: |
| 29 | ++ |
| 30 | +[source,terminal] |
| 31 | +---- |
| 32 | +$ oc label namespace bookinfo istio-discovery=enabled |
| 33 | +---- |
| 34 | + |
| 35 | +. Apply the `bookinfo` YAML file to deploy the `bookinfo` application by running the following command: |
| 36 | ++ |
| 37 | +[source,terminal] |
| 38 | +---- |
| 39 | +$ oc apply -n bookinfo -f https://raw.githubusercontent.com/openshift-service-mesh/istio/release-1.26/samples/bookinfo/platform/kube/bookinfo.yaml |
| 40 | +---- |
| 41 | + |
| 42 | +. Apply the `bookinfo-versions` YAML file to deploy the `bookinfo` application by running the following command: |
| 43 | ++ |
| 44 | +[source,terminal] |
| 45 | +---- |
| 46 | +$ oc apply -n bookinfo -f https://raw.githubusercontent.com/openshift-service-mesh/istio/release-1.26/samples/bookinfo/platform/kube/bookinfo-versions.yaml |
| 47 | +---- |
| 48 | + |
| 49 | +. Verify that the `bookinfo` pods are running by entering the following command: |
| 50 | ++ |
| 51 | +[source,terminal] |
| 52 | +---- |
| 53 | +$ oc -n bookinfo get pods |
| 54 | +---- |
| 55 | ++ |
| 56 | +.Example output |
| 57 | +[source,terminal] |
| 58 | +---- |
| 59 | +NAME READY STATUS RESTARTS AGE |
| 60 | +details-v1-54ffdd5947-8gk5h 1/1 Running 0 5m9s |
| 61 | +productpage-v1-d49bb79b4-cb9sl 1/1 Running 0 5m3s |
| 62 | +ratings-v1-856f65bcff-h6kkf 1/1 Running 0 5m7s |
| 63 | +reviews-v1-848b8749df-wl5br 1/1 Running 0 5m6s |
| 64 | +reviews-v2-5fdf9886c7-8xprg 1/1 Running 0 5m5s |
| 65 | +reviews-v3-bb6b8ddc7-bvcm5 1/1 Running 0 5m5s |
| 66 | +---- |
| 67 | + |
| 68 | +. Verify that the `bookinfo` application is running by entering the following command: |
| 69 | ++ |
| 70 | +[source,terminal] |
| 71 | +---- |
| 72 | +$ oc exec "$(oc get pod -l app=ratings -n bookinfo \ |
| 73 | + -o jsonpath='{.items[0].metadata.name}')" \ |
| 74 | + -c ratings -n bookinfo \ |
| 75 | + -- curl -sS productpage:9080/productpage | grep -o "<title>.*</title>" |
| 76 | +---- |
| 77 | +
|
| 78 | +. Add the bookinfo application to the {istio} ambient mesh by labeling either the entire namespace or the individual pods: |
| 79 | +
|
| 80 | +.. To include all workloads in the bookinfo namespace, apply the `istio.io/dataplane-mode=ambient` label to the `bookinfo` namespace, by running the following command: |
| 81 | ++ |
| 82 | +[source,terminal] |
| 83 | +---- |
| 84 | +$ oc label namespace bookinfo istio.io/dataplane-mode=ambient |
| 85 | +---- |
| 86 | +
|
| 87 | +.. To include only specific workloads, apply the `istio.io/dataplane-mode=ambient` label directly to individual pods. See the "Additional resources" section for more details on the labels used to add or exclude workloads in a mesh. |
| 88 | +
|
| 89 | ++ |
| 90 | +[NOTE] |
| 91 | +==== |
| 92 | +Adding workloads to the ambient mesh does not require restarting or redeploying application pods. Unlike sidecar mode, the number of containers in each pod remains unchanged. |
| 93 | +==== |
| 94 | +
|
| 95 | +. Confirm that Ztunnel proxy has successfully opened listening sockets in the pod network namespace by running the following command: |
| 96 | ++ |
| 97 | +[source,terminal] |
| 98 | +---- |
| 99 | +$ istioctl ztunnel-config workloads --namespace ztunnel |
| 100 | +---- |
| 101 | ++ |
| 102 | +.Example output |
| 103 | +[source,terminal] |
| 104 | +---- |
| 105 | +NAMESPACE POD NAME ADDRESS NODE WAYPOINT PROTOCOL |
| 106 | +bookinfo details-v1-54ffdd5947-cflng 10.131.0.69 ip-10-0-47-239.ec2.internal None HBONE |
| 107 | +bookinfo productpage-v1-d49bb79b4-8sgwx 10.128.2.80 ip-10-0-24-198.ec2.internal None HBONE |
| 108 | +bookinfo ratings-v1-856f65bcff-c6ldn 10.131.0.70 ip-10-0-47-239.ec2.internal None HBONE |
| 109 | +bookinfo reviews-v1-848b8749df-45hfd 10.131.0.72 ip-10-0-47-239.ec2.internal None HBONE |
| 110 | +bookinfo reviews-v2-5fdf9886c7-mvwft 10.128.2.78 ip-10-0-24-198.ec2.internal None HBONE |
| 111 | +bookinfo reviews-v3-bb6b8ddc7-fl8q2 10.128.2.79 ip-10-0-24-198.ec2.internal None HBONE |
| 112 | +istio-cni istio-cni-node-7hwd2 10.0.61.108 ip-10-0-61-108.ec2.internal None TCP |
| 113 | +istio-cni istio-cni-node-bfqmb 10.0.30.129 ip-10-0-30-129.ec2.internal None TCP |
| 114 | +istio-cni istio-cni-node-cv8cw 10.0.75.71 ip-10-0-75-71.ec2.internal None TCP |
| 115 | +istio-cni istio-cni-node-hj9cz 10.0.47.239 ip-10-0-47-239.ec2.internal None TCP |
| 116 | +istio-cni istio-cni-node-p8wrg 10.0.24.198 ip-10-0-24-198.ec2.internal None TCP |
| 117 | +istio-system istiod-6bd6b8664b-r74js 10.131.0.80 ip-10-0-47-239.ec2.internal None TCP |
| 118 | +ztunnel ztunnel-2w5mj 10.128.2.61 ip-10-0-24-198.ec2.internal None TCP |
| 119 | +ztunnel ztunnel-6njq8 10.129.0.131 ip-10-0-75-71.ec2.internal None TCP |
| 120 | +ztunnel ztunnel-96j7k 10.130.0.146 ip-10-0-61-108.ec2.internal None TCP |
| 121 | +ztunnel ztunnel-98mrk 10.131.0.50 ip-10-0-47-239.ec2.internal None TCP |
| 122 | +ztunnel ztunnel-jqcxn 10.128.0.98 ip-10-0-30-129.ec2.internal None TCP |
| 123 | +---- |
0 commit comments