Skip to content

Commit d6ec4a2

Browse files
authored
Merge pull request #37123 from abrennan89/SRVKS-820
SRVKS-812 + SRVKS-813 + SRVKS-820: Update domainmapping docs and add deprecation notes
2 parents a192221 + 65c02a4 commit d6ec4a2

8 files changed

+118
-26
lines changed

_topic_map.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3193,6 +3193,18 @@ Topics:
31933193
# HA
31943194
- Name: High availability on OpenShift Serverless
31953195
File: serverless-ha
3196+
# Security
3197+
- Name: Security
3198+
Dir: security
3199+
Topics:
3200+
- Name: Configuring JSON Web Token authentication for Knative services
3201+
File: serverless-ossm-with-kourier-jwt
3202+
- Name: Configuring a custom domain for a Knative service
3203+
File: serverless-custom-domains
3204+
- Name: Configuring TLS for a custom domain using Kourier
3205+
File: serverless-ossm-tls-with-kourier
3206+
- Name: Using a custom TLS certificate for domain mapping
3207+
File: serverless-custom-tls-cert-domain-mapping
31963208
#
31973209
# TODO: Add developer guide
31983210
#
@@ -3216,14 +3228,6 @@ Topics:
32163228
# Tracing
32173229
- Name: Tracing requests using Jaeger
32183230
File: serverless-tracing
3219-
# JWT using kourier
3220-
- Name: Configuring JSON Web Token authentication for Knative services
3221-
File: serverless-ossm-with-kourier-jwt
3222-
# Custom domains
3223-
- Name: Configuring a custom domain for a Knative service
3224-
File: serverless-custom-domains
3225-
- Name: Configuring TLS for a custom domain
3226-
File: serverless-ossm-tls-with-kourier
32273231
# Routes
32283232
- Name: Configuring routes for Knative services
32293233
File: serverless-configuring-routes

modules/serverless-ossm-enable-sidecar-injection-with-kourier.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ spec:
3131
...
3232
----
3333
<1> Add the `sidecar.istio.io/inject="true"` annotation.
34-
<2> Optional: Add the `sidecar.istio.io/rewriteAppHTTPProbers="true"` annotation if you have enabled JSON Web Token (JWT) authentication.
34+
<2> You must set the annotation `sidecar.istio.io/rewriteAppHTTPProbers: "true"` in your Knative service as {ServerlessProductName} versions 1.14.0 and higher use an HTTP probe as the readiness probe for Knative services by default.
35+
3536
. Apply your `Service` resource YAML file:
3637
+
3738
[source,terminal]

modules/serverless-ossm-setup.adoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,14 @@ spec:
3636
====
3737
This list of namespaces must include the `knative-serving` namespace.
3838
====
39+
3940
. Apply the `ServiceMeshMemberRoll` resource:
4041
+
4142
[source,terminal]
4243
----
4344
$ oc apply -f <filename>
4445
----
46+
4547
. Create the necessary gateways so that {ProductShortName} can accept traffic:
4648
+
4749
.Example `knative-local-gateway` object using HTTP
@@ -123,12 +125,14 @@ spec:
123125
mode: SIMPLE
124126
credentialName: <wildcard_certs>
125127
----
128+
126129
. Apply the `Gateway` resources:
127130
+
128131
[source,terminal]
129132
----
130133
$ oc apply -f <filename>
131134
----
135+
132136
. Install Knative Serving by creating the following `KnativeServing` custom resource definition (CRD), which also enables the Istio integration:
133137
+
134138
[source,yaml]
@@ -154,12 +158,14 @@ spec:
154158
----
155159
<1> Enables Istio integration.
156160
<2> Enables sidecar injection for Knative Serving data plane pods.
161+
157162
. Apply the `KnativeServing` resource:
158163
+
159164
[source,terminal]
160165
----
161166
$ oc apply -f <filename>
162167
----
168+
163169
. Create a Knative Service that has sidecar injection enabled and uses a pass-through route:
164170
+
165171
[source,yaml]
@@ -184,6 +190,7 @@ spec:
184190
<1> A namespace that is part of the Service Mesh member roll.
185191
<2> Instructs Knative Serving to generate an {product-title} pass-through enabled route, so that the certificates you have generated are served through the ingress gateway directly.
186192
<3> Injects {ProductShortName} sidecars into the Knative service pods.
193+
187194
. Apply the `Service` resource:
188195
+
189196
[source,terminal]

serverless/admin_guide/serverless-ossm-setup.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ To complete and verify these procedures in your deployment, you need either a ce
2828

2929
You must configure the wildcard certificate to match the domain of your {product-title} cluster. For example, if your {product-title} console address is `https://console-openshift-console.apps.openshift.example.com`, you must configure the wildcard certificate so that the domain is `*.apps.openshift.example.com`. For more information about configuring wildcard certificates, see the following topic about _Creating a certificate to encrypt incoming external traffic_.
3030

31-
If you want to use any domain name, including those which are not subdomains of the default {product-title} cluster domain, you must set up domain mapping for those domains. For more information, see the {ServerlessProductName} documentation on xref:../../serverless/knative_serving/serverless-custom-domains.adoc#serverless-create-domain-mapping_serverless-custom-domains[Creating a custom domain mapping].
31+
If you want to use any domain name, including those which are not subdomains of the default {product-title} cluster domain, you must set up domain mapping for those domains. For more information, see the {ServerlessProductName} documentation about xref:../../serverless/security/serverless-custom-domains.adoc#serverless-create-domain-mapping_serverless-custom-domains[Creating a custom domain mapping].
3232

3333
include::modules/serverlesss-ossm-external-certs.adoc[leveloffset=+2]
3434
include::modules/serverless-ossm-setup.adoc[leveloffset=+2]

serverless/knative_serving/serverless-custom-domains.adoc renamed to serverless/security/serverless-custom-domains.adoc

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,8 @@ toc::[]
99

1010
Knative services are automatically assigned a default domain name based on your cluster configuration. For example, `<service_name>.<namespace>.example.com`.
1111

12-
You can customize the domain for your Knative service by using one of the following methods:
12+
You can customize the domain for your Knative service by mapping a custom domain name that you own to a Knative service, by creating a `DomainMapping` resource for the service. You can also create multiple `DomainMapping` resources to map multiple domains and subdomains to a single service.
1313

14-
* Configure the service as a private service and create the required {ProductShortName} resources.
15-
+
16-
[IMPORTANT]
17-
====
18-
This method of configuring custom domains is only supported for clusters that have Kourier enabled. If you want to configure custom domains using only {ServerlessProductName} with {ProductShortName}, without Kourier enabled, use the `DomainMapping` resources method instead.
19-
====
20-
* Map a custom domain name that you own to a Knative service by creating a `DomainMapping` resource for the service. You can also create multiple `DomainMapping` resources to map multiple domains and subdomains to a single service.
21-
+
2214
[IMPORTANT]
2315
====
2416
You can use `DomainMapping` resources to map custom domains either with or without Kourier enabled in your cluster, however TLS is not supported in clusters that have both Kourier and domain mapping enabled.
@@ -30,8 +22,24 @@ include::modules/serverless-create-domain-mapping-kn.adoc[leveloffset=+1]
3022
[id="serverless-custom-domains-private-services"]
3123
== Configuring custom domains for private Knative services
3224

25+
:FeatureName: Configuring custom domains for private Knative services
26+
27+
[IMPORTANT]
28+
====
29+
{FeatureName} is a deprecated feature. Deprecated functionality is still included in {product-title} and continues to be supported; however, it will be removed in a future release of this product and is not recommended for new deployments.
30+
31+
Refer to xref:../../serverless/security/serverless-custom-domains.adoc#serverless-create-domain-mapping_serverless-custom-domains[Creating a custom domain mapping] for the latest documentation.
32+
====
33+
34+
:!FeatureName:
35+
3336
You can configure a custom domain for an existing Knative service by completing the following procedures.
3437

38+
[IMPORTANT]
39+
====
40+
This method of configuring custom domains is only supported for clusters that have Kourier enabled. If you want to configure custom domains using only {ServerlessProductName} with {ProductShortName}, without Kourier enabled, use the `DomainMapping` resources method instead.
41+
====
42+
3543
.Prerequisites
3644

3745
* The {ServerlessOperatorName} and Knative Serving are installed on your {product-title} cluster.
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
include::modules/serverless-document-attributes.adoc[]
2+
include::modules/ossm-document-attributes.adoc[]
3+
[id="serverless-custom-tls-cert-domain-mapping"]
4+
= Using a custom TLS certificate for domain mapping
5+
:context: serverless-custom-tls-cert-domain-mapping
6+
include::modules/common-attributes.adoc[]
7+
8+
toc::[]
9+
10+
You can use an existing TLS certificate with a `DomainMapping` custom resource (CR) to secure the mapped service.
11+
12+
.Prerequisites
13+
14+
* You have completed the steps in xref:../../serverless/security/serverless-custom-domains.adoc#serverless-custom-domains[Configuring a custom domain for a Knative service], and have a working `DomainMapping` CR.
15+
16+
* You have a TLS certificate from your Certificate Authority provider, or a self-signed certificate.
17+
18+
* You have obtained the `cert` and `key` files from your Certificate Authority provider, or a self-signed certificate.
19+
20+
.Procedure
21+
22+
. Create a Kubernetes TLS secret:
23+
+
24+
[source,terminal]
25+
----
26+
$ oc create secret tls <tls_secret_name> --cert=<path_to_certificate_file> --key=<path_to_key_file>
27+
----
28+
29+
. Update the `DomainMapping` CR to use the TLS secret you have created:
30+
+
31+
[source,yaml]
32+
----
33+
apiVersion: serving.knative.dev/v1alpha1
34+
kind: DomainMapping
35+
metadata:
36+
name: <domain_name>
37+
namespace: <namespace>
38+
spec:
39+
ref:
40+
name: <service_name>
41+
kind: Service
42+
apiVersion: serving.knative.dev/v1
43+
# TLS block specifies the secret to be used
44+
tls:
45+
secretName: <tls_secret_name>
46+
----
47+
48+
.Verification
49+
50+
. Verify that the `DomainMapping` CR status is `True`, and that the `URL` column of the output shows the mapped domain with the scheme `https`:
51+
+
52+
[source,terminal]
53+
----
54+
$ oc get domainmapping <domain_name>
55+
----
56+
+
57+
.Example output
58+
[source,terminal]
59+
----
60+
NAME URL READY REASON
61+
example.com https://example.com True
62+
----
63+
64+
. Optional: If the service is exposed publicly, verify that it is available by running the following command:
65+
+
66+
[source,terminal]
67+
----
68+
$ curl https://<domain_name>
69+
----
70+
+
71+
If the certificate is self-signed, skip verification by adding the `-k` flag to the `curl` command.

serverless/knative_serving/serverless-ossm-tls-with-kourier.adoc renamed to serverless/security/serverless-ossm-tls-with-kourier.adoc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
include::modules/serverless-document-attributes.adoc[]
22
include::modules/ossm-document-attributes.adoc[]
33
[id="serverless-ossm-tls-with-kourier"]
4-
= Configuring Transport Layer Security for a custom domain using {ProductName} and Kourier
4+
= Configuring TLS for a custom domain using Kourier
55
:context: serverless-ossm-tls
66
include::modules/common-attributes.adoc[]
77

88
toc::[]
99

10+
:FeatureName: Configuring TLS for a custom domain using Kourier
11+
12+
include::modules/deprecated-feature.adoc[leveloffset=+1]
13+
14+
:!FeatureName:
15+
1016
You can create a Transport Layer Security (TLS) key and certificates for a custom domain and subdomain using {ProductName}.
1117

1218
[IMPORTANT]
@@ -25,7 +31,7 @@ You can create a Transport Layer Security (TLS) key and certificates for a custo
2531
{ServerlessProductName} is compatible only with full implementations of either {ProductName} 1.x or 2.x. {ServerlessProductName} does not support custom usage of some 1.x resources and some 2.x resources in the same deployment. For example, upgrading to 2.x while still using the control plane `maistra.io/v1` spec is not supported.
2632
====
2733
* Complete the configuration steps in xref:../../serverless/admin_guide/serverless-ossm-setup.adoc#serverless-ossm-setup-with-kourier_serverless-ossm-setup[Integrating {ProductShortName} and {ServerlessProductName} with Kourier enabled].
28-
* Configure a custom domain. See xref:../../serverless/knative_serving/serverless-custom-domains.adoc#serverless-custom-domains[Configuring a custom domain for a Knative service].
34+
* Configure a custom domain. See xref:../../serverless/security/serverless-custom-domains.adoc#serverless-custom-domains[Configuring a custom domain for a Knative service].
2935
* In this example, `openssl` is used to generate certificates, but you can use any certificate generation tool to create these.
3036

3137
[IMPORTANT]

serverless/knative_serving/serverless-ossm-with-kourier-jwt.adoc renamed to serverless/security/serverless-ossm-with-kourier-jwt.adoc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@ toc::[]
99

1010
After the {ProductShortName} integration with {ServerlessProductName} and Kourier has been configured on your cluster, you can enable JSON Web Token (JWT) authentication for your Knative services.
1111

12-
[IMPORTANT]
13-
====
14-
You must set the annotation `sidecar.istio.io/rewriteAppHTTPProbers: "true"` in your Knative service as {ServerlessProductName} versions 1.14.0 and higher use an HTTP probe as the readiness probe for Knative services by default.
15-
====
16-
1712
include::modules/serverless-ossm-enable-sidecar-injection-with-kourier.adoc[leveloffset=+1]
1813
include::modules/serverless-ossm-v2x-jwt.adoc[leveloffset=+1]
1914
include::modules/serverless-ossm-v1x-jwt.adoc[leveloffset=+1]

0 commit comments

Comments
 (0)