Skip to content

Commit 521b9e7

Browse files
authored
Merge pull request #52191 from rh-tokeefe/OSSMDOC-702
OSSMDOC-702: Document gateway injection
2 parents 4a7162b + b5543d3 commit 521b9e7

File tree

3 files changed

+103
-4
lines changed

3 files changed

+103
-4
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * service_mesh/v2x/ossm-traffic-manage.adoc
4+
5+
:_content-type: CONCEPT
6+
[id="ossm-automatic-gateway-injection_{context}"]
7+
= Enabling gateway injection
8+
9+
Gateway configurations apply to standalone Envoy proxies running at the edge of the mesh, rather than sidecar Envoy proxies running alongside your service workloads. Because gateways are Envoy proxies, you can configure {SMProductShortName} to inject gateways automatically, similar to how you can inject sidecars.
10+
11+
Using automatic injection for gateways, you can deploy and manage gateways independent from the `ServiceMeshControlPlane` resource and manage the gateways with your user applications. Using auto-injection for gateway deployments gives developers full control over the gateway deployment while simplifying operations. When a new upgrade is available, or a configuration has changed, you restart the gateway pods to update them. Doing so makes the experience of operating a gateway deployment the same as operating sidecars.
12+
13+
[NOTE]
14+
====
15+
Injection is disabled by default for the `ServiceMeshControlPlane` namespace, for example the `istio-system` namespace. As a security best practice, deploy gateways in a different namespace from the control plane.
16+
====
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * service_mesh/v2x/ossm-traffic-manage.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="ossm-deploying-automatic-gateway-injection_{context}"]
7+
= Deploying automatic gateway injection
8+
9+
When deploying a gateway, you must opt-in to injection by adding an injection label or annotation to the gateway `deployment` object. The following example `ConfigMap` object deploys a gateway with automatic injection.
10+
11+
.Prerequisites
12+
13+
* The namespace must be a member of the mesh by defining it in the `ServiceMeshMemberRoll` or by creating a `ServiceMeshMember` resource.
14+
15+
.Example deployment with annotations
16+
[source,yaml]
17+
----
18+
apiVersion: v1
19+
kind: Service
20+
metadata:
21+
name: istio-ingressgateway
22+
namespace: istio-ingress
23+
spec:
24+
type: LoadBalancer
25+
selector:
26+
istio: ingressgateway
27+
ports:
28+
- port: 80
29+
name: http
30+
- port: 443
31+
name: https
32+
---
33+
apiVersion: apps/v1
34+
kind: Deployment
35+
metadata:
36+
name: istio-ingressgateway
37+
namespace: istio-ingress
38+
spec:
39+
selector:
40+
matchLabels:
41+
istio: ingressgateway
42+
template:
43+
metadata:
44+
annotations:
45+
inject.istio.io/templates: gateway <1>
46+
labels:
47+
istio: ingressgateway <2>
48+
sidecar.istio.io/inject: "true" <3>
49+
spec:
50+
containers:
51+
- name: istio-proxy
52+
image: auto <4>
53+
---
54+
apiVersion: rbac.authorization.k8s.io/v1 <5>
55+
kind: Role
56+
metadata:
57+
name: istio-ingressgateway-sds
58+
namespace: istio-ingress
59+
rules:
60+
- apiGroups: [""]
61+
resources: ["secrets"]
62+
verbs: ["get", "watch", "list"]
63+
---
64+
apiVersion: rbac.authorization.k8s.io/v1
65+
kind: RoleBinding
66+
metadata:
67+
name: istio-ingressgateway-sds
68+
namespace: istio-ingress
69+
roleRef:
70+
apiGroup: rbac.authorization.k8s.io
71+
kind: Role
72+
name: istio-ingressgateway-sds
73+
subjects:
74+
- kind: ServiceAccount
75+
name: default
76+
----
77+
<1> Select the gateway injection template rather than the default sidecar template.
78+
<2> Set a unique label for the gateway. This setting is required to ensure Gateways can select this workload.
79+
<3> Enable gateway injection. If connecting to a revisioned control plane, replace with `istio.io/rev: revision-name`.
80+
<4> The image automatically updates each time the pod starts.
81+
<5> Set up roles to allow reading credentials for TLS.

service_mesh/v2x/ossm-traffic-manage.adoc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,18 @@ include::_attributes/common-attributes.adoc[]
66

77
toc::[]
88

9-
{SMProductName} lets you control the flow of traffic and API calls between services. Some services in your service mesh may need to communicate within the mesh and others may need to be hidden. You can manage the traffic to hide specific backend services, expose services, create testing or versioning deployments, or add a security layer on a set of services.
9+
Using {SMProductName}, you can control the flow of traffic and API calls between services. Some services in your service mesh might need to communicate within the mesh and others might need to be hidden. You can manage the traffic to hide specific backend services, expose services, create testing or versioning deployments, or add a security layer on a set of services.
1010

11-
//NEW module
1211
include::modules/ossm-gateways.adoc[leveloffset=+1]
13-
//Gateway injection topic will go HERE
12+
13+
include::modules/ossm-automatic-gateway-injection.adoc[leveloffset=+2]
14+
15+
include::modules/ossm-deploying-automatic-gateway-injection.adoc[leveloffset=+2]
16+
1417
include::modules/ossm-routing-ingress.adoc[leveloffset=+2]
1518

1619
include::modules/ossm-routing-gateways.adoc[leveloffset=+2]
1720

18-
1921
[id="ossm-auto-route_{context}"]
2022
== Understanding automatic routes
2123

0 commit comments

Comments
 (0)