Skip to content

Commit 858cc74

Browse files
authored
Merge pull request #37708 from abrennan89/RHDEVDOCS-2664
RHDEVDOCS-2664: Add ODC docs for domain mapping
2 parents 85c3f49 + d532bed commit 858cc74

File tree

4 files changed

+135
-5
lines changed

4 files changed

+135
-5
lines changed

modules/serverless-access-custom-domain.adoc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
11
// Module included in the following assemblies:
22
//
3-
// * serverless/networking/serverless-ossm-custom-domains.adoc
3+
// * serverless/knative_serving/serverless-custom-domains.adoc
44

55
[id="serverless-access-custom-domain_{context}"]
66
= Accessing a service using your custom domain
77

88
.Procedure
99

10-
. Access the custom domain by using the `Host` header in a `curl` request. For example:
10+
* Access the custom domain by using the `Host` header in a `curl` request. For example:
1111
+
12-
12+
.Example command
1313
[source,terminal]
1414
----
1515
$ curl -H "Host: custom-ksvc-domain.example.com" http://<ip_address>
1616
----
17-
1817
+
1918
where `<ip_address>` is the IP address that the {product-title} ingress router is exposed to.
2019
+
21-
2220
.Example output
2321
[source,terminal]
2422
----
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+
// * serverless/knative_serving/serverless-custom-domains.adoc
4+
5+
[id="serverless-domain-mapping-odc-admin_{context}"]
6+
= Mapping a custom domain to a service by using the Administrator perspective
7+
8+
If you have cluster administrator permissions, you can create a `DomainMapping` custom resource (CR) by using the *Administrator* perspective in the {product-title} web console.
9+
10+
.Prerequisites
11+
12+
* You have logged in to the web console.
13+
* You are in the *Administrator* perspective.
14+
* You have installed the {ServerlessOperatorName}.
15+
* You have installed Knative Serving.
16+
* You have created a project or have access to a project with the appropriate roles and permissions to create applications and other workloads in {product-title}.
17+
* You have created a Knative service and control a custom domain that you want to map to that service.
18+
+
19+
[NOTE]
20+
====
21+
Your custom domain must point to the IP address of the {product-title} cluster.
22+
====
23+
24+
.Procedure
25+
26+
. Navigate to *CustomResourceDefinitions* and use the search box to find the *DomainMapping* custom resource definition (CRD).
27+
28+
. Click the *DomainMapping* CRD, then navigate to the *Instances* tab.
29+
30+
. Click *Create DomainMapping*.
31+
32+
. Modify the YAML for the `DomainMapping` CR so that it includes the following information for your instance:
33+
+
34+
[source,yaml]
35+
----
36+
apiVersion: serving.knative.dev/v1alpha1
37+
kind: DomainMapping
38+
metadata:
39+
name: <domain_name> <1>
40+
namespace: <namespace> <2>
41+
spec:
42+
ref:
43+
name: <target_name> <3>
44+
kind: <target_type> <4>
45+
apiVersion: serving.knative.dev/v1
46+
----
47+
<1> The custom domain name that you want to map to the target CR.
48+
<2> The namespace of both the `DomainMapping` CR and the target CR.
49+
<3> The name of the target CR to map to the custom domain.
50+
<4> The type of CR being mapped to the custom domain.
51+
+
52+
.Example domain mapping to a Knative service
53+
[source,yaml]
54+
----
55+
apiVersion: serving.knative.dev/v1alpha1
56+
kind: DomainMapping
57+
metadata:
58+
name: custom-ksvc-domain.example.com
59+
namespace: default
60+
spec:
61+
ref:
62+
name: example-service
63+
kind: Service
64+
apiVersion: serving.knative.dev/v1
65+
----
66+
67+
.Verification
68+
69+
* Access the custom domain by using a `curl` request. For example:
70+
+
71+
.Example command
72+
[source,terminal]
73+
----
74+
$ curl custom-ksvc-domain.example.com
75+
----
76+
+
77+
.Example output
78+
[source,terminal]
79+
----
80+
Hello OpenShift!
81+
----
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * serverless/knative_serving/serverless-custom-domains.adoc
4+
5+
[id="serverless-domain-mapping-odc-developer_{context}"]
6+
= Mapping a custom domain to a service by using the Developer perspective
7+
8+
You can use the *Developer* perspective of the {product-title} web console to map a `DomainMapping` custom resource (CR) to a Knative service.
9+
10+
.Prerequisites
11+
12+
* You have logged in to the web console.
13+
* You are in the *Developer* perspective.
14+
* The {ServerlessOperatorName} and Knative Serving are installed on your cluster. This must be completed by a cluster administrator.
15+
* You have created a project or have access to a project with the appropriate roles and permissions to create applications and other workloads in {product-title}.
16+
* You have created a Knative service and control a custom domain that you want to map to that service.
17+
+
18+
[NOTE]
19+
====
20+
Your custom domain must point to the IP address of the {product-title} cluster.
21+
====
22+
23+
.Procedure
24+
25+
. Navigate to the *Topology* page.
26+
27+
. Right-click on the service that you want to map to a domain, and select the *Edit* option that contains the service name. For example, if the service is named `example-service`, select the *Edit example-service* option.
28+
29+
. In the *Advanced options* section, click *Show advanced Routing options*.
30+
.. If the domain mapping CR that you want to map to the service already exists, you can select it from the *Domain mapping* drop-down.
31+
.. If you want to create a new domain mapping CR, type the domain name into the box, and select the *Create* option. For example, if you type in `example.com`, the *Create* option is *Create "example.com"*.
32+
33+
. Click *Save* to save the changes to your service.
34+
35+
.Verification
36+
37+
. Navigate to the *Topology* page.
38+
39+
. Click on the service that you have created.
40+
41+
. In the *Resources* tab of the service information window, you can see the domain you have mapped to the service listed under *Domain mappings*.

serverless/security/serverless-custom-domains.adoc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ You can customize the domain for your Knative service by mapping a custom domain
1414
include::modules/serverless-create-domain-mapping.adoc[leveloffset=+1]
1515
include::modules/serverless-create-domain-mapping-kn.adoc[leveloffset=+1]
1616

17+
// Using the web console
18+
19+
[id="serverless-custom-domains-odc"]
20+
== Creating a custom domain mapping by using the web console
21+
22+
You can use the *Administrator* or *Developer* perspective of the {product-title} web console to create a custom domain mapping for a Knative service.
23+
24+
include::modules/serverless-domain-mapping-odc-admin.adoc[leveloffset=+2]
25+
include::modules/serverless-domain-mapping-odc-developer.adoc[leveloffset=+2]
26+
1727
[id="serverless-custom-domains-private-services"]
1828
== Configuring custom domains for private Knative services
1929

0 commit comments

Comments
 (0)