Skip to content

Commit 5c65465

Browse files
authored
Merge pull request #75107 from gwynnemonahan/OSSM-3157
OSSM-3157 Update section Enabling automatic sidecar injection
2 parents 67eefd0 + 4477aa3 commit 5c65465

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

modules/ossm-automatic-sidecar-injection.adoc

+11-6
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
[id="ossm-automatic-sidecar-injection_{context}"]
88
= Enabling automatic sidecar injection
99

10-
When deploying an application, you must opt-in to injection by configuring the annotation `sidecar.istio.io/inject` in `spec.template.metadata.annotations` to `true` in the `deployment` object. Opting in ensures that the sidecar injection does not interfere with other {product-title} features such as builder pods used by numerous frameworks within the {product-title} ecosystem.
10+
When deploying an application, you must opt-in to injection by configuring the label `sidecar.istio.io/inject` in `spec.template.metadata.labels` to `true` in the `deployment` object. Opting in ensures that the sidecar injection does not interfere with other {product-title} features such as builder pods used by numerous frameworks within the {product-title} ecosystem.
1111

1212
.Prerequisites
1313

@@ -22,16 +22,16 @@ When deploying an application, you must opt-in to injection by configuring the a
2222
$ oc get deployment -n <namespace>
2323
----
2424
+
25-
For example, to view the deployment file for the 'ratings-v1' microservice in the `bookinfo` namespace, use the following command to see the resource in YAML format.
25+
For example, to view the `Deployment` YAML file for the 'ratings-v1' microservice in the `bookinfo` namespace, use the following command to see the resource in YAML format.
2626
+
2727
[source,terminal]
2828
----
2929
oc get deployment -n bookinfo ratings-v1 -o yaml
3030
----
3131
+
32-
. Open the application's deployment configuration YAML file in an editor.
32+
. Open the application's `Deployment` YAML file in an editor.
3333

34-
. Add `spec.template.metadata.annotations.sidecar.istio/inject` to your Deployment YAML and set `sidecar.istio.io/inject` to `true` as shown in the following example.
34+
. Add `spec.template.metadata.labels.sidecar.istio/inject` to your Deployment YAML file and set `sidecar.istio.io/inject` to `true` as shown in the following example.
3535
+
3636
.Example snippet from bookinfo deployment-ratings-v1.yaml
3737
[source,yaml]
@@ -47,11 +47,16 @@ metadata:
4747
spec:
4848
template:
4949
metadata:
50-
annotations:
50+
labels:
5151
sidecar.istio.io/inject: 'true'
5252
----
5353
+
54-
. Save the Deployment configuration file.
54+
[NOTE]
55+
====
56+
Using the `annotations` parameter when enabling automatic sidecar injection is deprecated and is replaced by using the `labels` parameter.
57+
====
58+
+
59+
. Save the `Deployment` YAML file.
5560

5661
. Add the file back to the project that contains your app.
5762
+

0 commit comments

Comments
 (0)