Skip to content

Commit b5bc449

Browse files
authored
Merge pull request #48054 from Miciah/add-nw-ingress-edge-route-default-certificate
NE-989: Add nw-ingress-edge-route-default-certificate
2 parents 1f360be + 9cffb44 commit b5bc449

File tree

2 files changed

+73
-0
lines changed

2 files changed

+73
-0
lines changed
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
// This is included in the following assemblies:
2+
//
3+
// networking/routes/route-configuration.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="creating-edge-route-with-default-certificate_{context}"]
7+
= Creating a route using the default certificate through an Ingress object
8+
9+
If you create an Ingress object without specifying any TLS configuration, {product-title} generates an insecure route. To create an Ingress object that generates a secure, edge-terminated route using the default ingress certificate, you can specify an empty TLS configuration as follows.
10+
11+
.Prerequisites
12+
13+
* You have a service that you want to expose.
14+
* You have access to the OpenShift CLI (`oc`).
15+
16+
.Procedure
17+
18+
. Create a YAML file for the Ingress object. In this example, the file is called `example-ingress.yaml`:
19+
+
20+
.YAML definition of an Ingress object
21+
[source,yaml]
22+
----
23+
apiVersion: networking.k8s.io/v1
24+
kind: Ingress
25+
metadata:
26+
name: frontend
27+
...
28+
spec:
29+
rules:
30+
...
31+
tls:
32+
- {} <1>
33+
----
34+
+
35+
<1> Use this exact syntax to specify TLS without specifying a custom certificate.
36+
37+
. Create the Ingress object by running the following command:
38+
+
39+
[source,terminal]
40+
----
41+
$ oc create -f example-ingress.yaml
42+
----
43+
44+
.Verification
45+
* Verify that {product-title} has created the expected route for the Ingress object by running the following command:
46+
+
47+
[source,terminal]
48+
----
49+
$ oc get routes -o yaml
50+
----
51+
+
52+
.Example output
53+
[source,yaml]
54+
----
55+
apiVersion: v1
56+
items:
57+
- apiVersion: route.openshift.io/v1
58+
kind: Route
59+
metadata:
60+
name: frontend-j9sdd <1>
61+
...
62+
spec:
63+
...
64+
tls: <2>
65+
insecureEdgeTerminationPolicy: Redirect
66+
termination: edge <3>
67+
...
68+
----
69+
<1> The name of the route includes the name of the Ingress object followed by a random suffix.
70+
<2> In order to use the default certificate, the route should not specify `spec.certificate`.
71+
<3> The route should specify the `edge` termination policy.

networking/routes/route-configuration.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ include::modules/nw-route-admission-policy.adoc[leveloffset=+1]
6161
include::modules/nw-ingress-creating-a-route-via-an-ingress.adoc[leveloffset=+1]
6262
endif::[]
6363

64+
include::modules/nw-ingress-edge-route-default-certificate.adoc[leveloffset=+1]
65+
6466
include::modules/nw-ingress-reencrypt-route-custom-cert.adoc[leveloffset=+1]
6567

6668
include::modules/nw-router-configuring-dual-stack.adoc[leveloffset=+1]

0 commit comments

Comments
 (0)