Skip to content

Commit 3c74ceb

Browse files
committed
SRVKS-719: Updating service mesh + serverless docs
1 parent 0834c10 commit 3c74ceb

24 files changed

+495
-261
lines changed

_topic_map.yml

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2998,6 +2998,9 @@ Topics:
29982998
File: upgrading-serverless
29992999
- Name: Removing OpenShift Serverless
30003000
File: removing-openshift-serverless
3001+
# Ingress options
3002+
- Name: Integrating Service Mesh with OpenShift Serverless
3003+
File: serverless-ossm-setup
30013004
# Eventing
30023005
- Name: Creating Knative Eventing components in the Administrator perspective
30033006
File: serverless-cluster-admin-eventing
@@ -3036,6 +3039,17 @@ Topics:
30363039
# Tracing
30373040
- Name: Tracing requests using Jaeger
30383041
File: serverless-tracing
3042+
# JWT using kourier
3043+
- Name: Configuring JSON Web Token authentication for Knative services
3044+
File: serverless-ossm-with-kourier-jwt
3045+
# Custom domains
3046+
- Name: Configuring a custom domain for a Knative service
3047+
File: serverless-custom-domains
3048+
- Name: Configuring TLS for a custom domain
3049+
File: serverless-ossm-tls-with-kourier
3050+
# Routes
3051+
- Name: Configuring routes for Knative services
3052+
File: serverless-configuring-routes
30393053
#
30403054
# Knative Eventing
30413055
- Name: Knative Eventing
@@ -3112,24 +3126,6 @@ Topics:
31123126
File: serverless-functions-eventing
31133127
- Name: Functions development reference guide
31143128
File: serverless-functions-reference-guide
3115-
#
3116-
# Networking
3117-
- Name: Networking
3118-
Dir: networking
3119-
Topics:
3120-
- Name: Mapping a custom domain name to a Knative service
3121-
File: serverless-domain-mapping
3122-
- Name: Configuring routes for Knative services
3123-
File: serverless-configuring-routes
3124-
- Name: Using Service Mesh with OpenShift Serverless
3125-
File: serverless-ossm
3126-
- Name: Using JSON Web Token authentication with Service Mesh and OpenShift Serverless
3127-
File: serverless-ossm-jwt
3128-
- Name: Using custom domains for Knative services with Service Mesh
3129-
File: serverless-ossm-custom-domains
3130-
- Name: Configuring TLS for a custom domain using Service Mesh
3131-
File: serverless-ossm-tls
3132-
#
31333129
# Integrations
31343130
- Name: Integrations
31353131
Dir: integrations

modules/serverless-config-replicas.adoc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33

44
High availability (HA) functionality is available by default on {ServerlessProductName} for the `autoscaler-hpa`, `controller`, `activator`, `kourier-control`, and `kourier-gateway` controllers. These components are configured with two replicas by default.
55

6-
You modify the number of replicas that are created per controller by changing the configuration of `KnativeServing.spec.highAvailability` in the KnativeServing custom resource definition.
7-
// This field also specifies the minimum number of _activators_ if you are using the horizontal pod autoscaler (HPA). For more information about HPA, see
6+
You can modify the number of replicas that are created per controller by changing the configuration of the `high-availability` spec in the `KnativeServing` custom resource definition (CRD).
87

98
.Prerequisites
109

11-
* An {product-title} account with cluster administrator access.
12-
* Installed the {ServerlessOperatorName} and Knative Serving.
10+
* You have access to an {product-title} cluster with cluster administrator permissions.
11+
* The {ServerlessOperatorName} and Knative Serving are installed on your cluster.
1312

1413
.Procedure
1514

@@ -27,7 +26,7 @@ image::serving-tab-created.png[Knative Serving tab]
2726
+
2827
image::serving-YAML-HA.png[Knative Serving YAML]
2928
+
30-
. Edit the custom resource definition YAML:
29+
. Modify the number of replicas in the `KnativeServing` CRD:
3130
+
3231
.Example YAML
3332
[source,yaml]

modules/serverless-create-domain-mapping.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ To map a custom domain name to a custom resource (CR), you must create a `Domain
1010
+
1111
[NOTE]
1212
====
13-
Your custom domain must point to the DNS of the {product-title} cluster.
13+
Your custom domain must point to the IP address of the {product-title} cluster.
1414
====
1515

1616
.Procedure

modules/serverless-openshift-routes.adoc

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
// Module included in the following assemblies:
2-
// * serverless/networking/serverless-configuring-routes.adoc
3-
41
[id="serverless-openshift-routes_{context}"]
52
= Configuring {product-title} routes for Knative services
63

@@ -10,11 +7,17 @@ If you want to configure a Knative service to use your TLS certificate on {produ
107

118
* The {ServerlessOperatorName} and Knative Serving component must be installed on your {product-title} cluster.
129

10+
[NOTE]
11+
====
12+
You must modify the replaceable values in the example commands for the following procedure.
13+
====
14+
1315
.Procedure
1416

1517
. Create a Knative service that includes the `serving.knative.openshift.io/disableRoute=true` annotation:
18+
.. Optional. Create a Knative service resource:
1619
+
17-
.Example YAML
20+
.Example resource
1821
[source,yaml]
1922
----
2023
apiVersion: serving.knative.dev/v1
@@ -29,11 +32,18 @@ spec:
2932
containers:
3033
- image: <image>
3134
----
35+
.. Apply the `Service` resource:
36+
+
37+
[source,terminal]
38+
----
39+
$ oc apply -f <filename>
40+
----
41+
.. Optional. Create a Knative service by using the `kn service create` command:
3242
+
3343
.Example `kn` command
3444
[source,terminal]
3545
----
36-
$ kn service create hello-example \
46+
$ kn service create <service_name> \
3747
--image=gcr.io/knative-samples/helloworld-go \
3848
--annotation serving.knative.openshift.io/disableRoute=true
3949
----
@@ -43,17 +53,20 @@ $ kn service create hello-example \
4353
.Example command
4454
[source,terminal]
4555
----
46-
$ oc get routes.route.openshift.io -l serving.knative.openshift.io/ingressName=$KSERVICE_NAME -l serving.knative.openshift.io/ingressNamespace=$KSERVICE_NAMESPACE -n knative-serving-ingress
56+
$ $ oc get routes.route.openshift.io \
57+
-l serving.knative.openshift.io/ingressName=$KSERVICE_NAME \
58+
-l serving.knative.openshift.io/ingressNamespace=$KSERVICE_NAMESPACE \
59+
-n knative-serving-ingress
4760
----
4861
+
49-
You should see the following output:
62+
You will see the following output:
5063
+
5164
[source,terminal]
5265
----
5366
No resources found in knative-serving-ingress namespace.
5467
----
5568

56-
. Create a `Route` object in the `knative-serving-ingress` namespace by copying the following sample YAML and modifying the replaceable values:
69+
. Create a `Route` resource in the `knative-serving-ingress` namespace:
5770
+
5871
[source,yaml]
5972
----
@@ -94,3 +107,9 @@ spec:
94107
<3> The namespace for the {product-title} route. This must be `knative-serving-ingress`.
95108
<4> The hostname for external access. You can set this to `<service_name>-<service_namespace>.<domain>`.
96109
<5> The certificates you want to use. Currently, only `edge` termination is supported.
110+
. Apply the `Route` resource:
111+
+
112+
[source,terminal]
113+
----
114+
$ oc apply -f <filename>
115+
----

modules/serverless-service-mesh-enable-sidecar-injection.adoc renamed to modules/serverless-ossm-enable-sidecar-injection-with-kourier.adoc

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,38 @@
1-
// Module included in the following assemblies:
2-
// * serverless/networking/serverless-ossm.adoc
3-
// * serverless/networking/serverless-ossm-jwt.adoc
4-
5-
[id="serverless-enable-sidecar_{context}"]
1+
[id="serverless-ossm-enable-sidecar-injection-with-kourier_{context}"]
62
= Enabling sidecar injection for a Knative service
73

84
You can add the `sidecar.istio.io/inject="true"` annotation to a Knative service to enable sidecar injection for that service.
95

106
[IMPORTANT]
117
====
12-
Adding sidecar injection to pods in system namespaces such as `knative-serving` and `knative-serving-ingress` is not supported.
8+
Adding sidecar injection to pods in system namespaces, such as `knative-serving` and `knative-serving-ingress`, is not supported when Kourier is enabled.
9+
10+
If you require sidecar injection for pods in these namespaces, see the {ServerlessProductName} documentation on _Integrating {ProductShortName} with {ServerlessProductName} natively_.
1311
====
12+
// Add an xref here once it's enabled for modules
1413

1514
.Procedure
1615

17-
. Add the `sidecar.istio.io/inject="true"` annotation to the `Service` resource YAML file:
16+
. Add the `sidecar.istio.io/inject="true"` annotation to your `Service` resource:
1817
+
19-
.Example service YAML
18+
.Example service
2019
[source,yaml]
2120
----
2221
apiVersion: serving.knative.dev/v1
2322
kind: Service
2423
metadata:
25-
name: hello-example-1
24+
name: <service_name>
2625
spec:
2726
template:
2827
metadata:
2928
annotations:
3029
sidecar.istio.io/inject: "true" <1>
3130
sidecar.istio.io/rewriteAppHTTPProbers: "true" <2>
32-
spec:
33-
containers:
34-
- image: docker.io/openshift/hello-openshift
35-
name: container
31+
...
3632
----
3733
<1> Add the `sidecar.istio.io/inject="true"` annotation.
3834
<2> Optional: Add the `sidecar.istio.io/rewriteAppHTTPProbers="true"` annotation if you have enabled JSON Web Token (JWT) authentication.
39-
40-
. Apply the `Service` resource YAML file:
35+
. Apply your `Service` resource YAML file:
4136
+
4237
[source,terminal]
4338
----
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
[id="serverless-ossm-setup-with-kourier_{context}"]
2+
= Integrating {ProductShortName} with {ServerlessProductName} when Kourier is enabled
3+
4+
.Prerequisites
5+
6+
* You have installed the {ServerlessOperatorName} on your {product-title} cluster.
7+
* You have installed {ProductName}. {ServerlessProductName} with {ProductShortName} and Kourier is supported for use with both {ProductName} versions 1.x and 2.x.
8+
* You have installed Knative Serving.
9+
10+
.Procedure
11+
12+
. Add the namespaces that you would like to integrate with {ProductShortName} to the `ServiceMeshMemberRoll` object as members:
13+
+
14+
[source,yaml]
15+
----
16+
apiVersion: maistra.io/v1
17+
kind: ServiceMeshMemberRoll
18+
metadata:
19+
name: default
20+
namespace: istio-system
21+
spec:
22+
members:
23+
- <namespace> <1>
24+
----
25+
<1> A list of namespaces to be integrated with {ProductShortName}.
26+
. Apply the `ServiceMeshMemberRoll` resource:
27+
+
28+
[source,terminal]
29+
----
30+
$ oc apply -f <filename>
31+
----
32+
. Create a network policy that permits traffic flow from Knative system pods to Knative services:
33+
.. Add the `serving.knative.openshift.io/system-namespace=true` label to the `knative-serving` namespace:
34+
+
35+
[source,terminal]
36+
----
37+
$ oc label namespace knative-serving serving.knative.openshift.io/system-namespace=true
38+
----
39+
.. Add the `serving.knative.openshift.io/system-namespace=true` label to the `knative-serving-ingress` namespace:
40+
+
41+
[source,terminal]
42+
----
43+
$ oc label namespace knative-serving-ingress serving.knative.openshift.io/system-namespace=true
44+
----
45+
.. For each namespace that you want to integrate with {ProductShortName}, create a `NetworkPolicy` resource:
46+
+
47+
[source,yaml]
48+
----
49+
apiVersion: networking.k8s.io/v1
50+
kind: NetworkPolicy
51+
metadata:
52+
name: allow-from-serving-system-namespace
53+
namespace: <namespace> <1>
54+
spec:
55+
ingress:
56+
- from:
57+
- namespaceSelector:
58+
matchLabels:
59+
serving.knative.openshift.io/system-namespace: "true"
60+
podSelector: {}
61+
policyTypes:
62+
- Ingress
63+
----
64+
<1> Add the namespace that you want to integrate with {ProductShortName}.
65+
.. Apply the `NetworkPolicy` resource:
66+
+
67+
[source,terminal]
68+
----
69+
$ oc apply -f <filename>
70+
----

0 commit comments

Comments
 (0)