You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/cert-manager-certificate-ingress.adoc
+50-19Lines changed: 50 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,20 @@
6
6
[id="cert-manager-certificate-ingress_{context}"]
7
7
= Creating certificates for the Ingress Controller
8
8
9
+
[role="_abstract"]
10
+
You can create a certificate for the Ingress Controller and then replace bootstrapped default self-signed certificates with cert-manager-managed external certificates.
11
+
12
+
[NOTE]
13
+
====
14
+
Before using the procedure, ensure you understand the following Ingress Controller behaviors:
15
+
16
+
* When certificates are renewed or rotated by using the cert-manager Operator, only the contents of the secret, such as the certificate and key, are updated. The secret name remains unchanged. Kubelet automatically propagates these updates to the mounted volume, allowing the router to detect the file changes and hot-reload the new certificate and key. As a result, no rolling update of the router deployment is triggered or required.
17
+
18
+
* The secret name is referenced in the Ingress Controller configuration. If you want to replace the default ingress certificate or use different secret name in Ingress Controller configuration, you must patch or edit the configuration to apply the change. This operation triggers a rolling update for router pods where new router pods load the new cert/key pair.
19
+
20
+
For more information, see this link:https://access.redhat.com/solutions/4542531[Red{nbsp}Hat Knowledgebase Solution].
21
+
====
22
+
9
23
.Prerequisites
10
24
11
25
* You have access to the cluster with `cluster-admin` privileges.
@@ -16,38 +30,41 @@
16
30
. Create an issuer. For more information, see "Configuring an issuer" in the "Additional resources" section.
17
31
18
32
. Create a certificate:
19
-
33
+
+
20
34
.. Create a YAML file, for example, `certificate.yaml`, that defines the `Certificate` object:
21
35
+
22
36
.Example `certificate.yaml` file
23
-
+
24
-
[source, yaml]
37
+
[source,yaml]
25
38
----
26
39
apiVersion: cert-manager.io/v1
27
40
kind: Certificate
28
41
metadata:
29
-
name: <tls_cert> #<1>
42
+
name: <tls_cert>
30
43
namespace: openshift-ingress
31
44
spec:
32
45
isCA: false
33
-
commonName: "apps.<cluster_base_domain>" #<2>
34
-
secretName: <secret_name> #<3>
46
+
commonName: "apps.<cluster_base_domain>"
47
+
secretName: <secret_name>
35
48
dnsNames:
36
-
- "apps.<cluster_base_domain>" #<4>
37
-
- "*.apps.<cluster_base_domain>" #<4>
49
+
- "apps.<cluster_base_domain>"
50
+
- "\*.apps.<cluster_base_domain>"
38
51
issuerRef:
39
-
name: <issuer_name> #<5>
52
+
name: <issuer_name>
40
53
kind: Issuer
41
54
----
42
-
<1> Provide a name for the certificate.
43
-
<2> Specify the common name (CN).
44
-
<3> Specify the name of the secret to create that contains the certificate.
45
-
<4> Specify the DNS name of the ingress.
46
-
<5> Specify the name of the issuer.
55
+
+
56
+
where:
57
+
+
58
+
`<tls_cert>`:: Specifies the name for the certificate.
59
+
`<cluster_base_domain>`:: Specifies the common name (CN).
60
+
`<secret_name>`:: Specifies the name of the secret to create that contains the certificate.
61
+
`<cluster_base_domain>`:: Specifies the DNS name of the ingress.
62
+
`<issuer_name>`:: Specifies the name of the issuer.
47
63
64
+
+
48
65
.. Create the `Certificate` object by running the following command:
Copy file name to clipboardExpand all lines: modules/customize-certificates-replace-default-router.adoc
+25-15Lines changed: 25 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,15 @@
8
8
9
9
You can replace the default ingress certificate for all applications under the `.apps` subdomain. After you replace the certificate, all applications, including the web console and CLI, have encryption provided by the specified certificate.
10
10
11
+
[NOTE]
12
+
====
13
+
Before using the procedure, ensure you understand the following Ingress Controller behaviors:
14
+
15
+
* When certificates are renewed or rotated by using external certificate management tools, only the contents of the secret, such as the certificate and key, are updated. The secret name remains unchanged. Kubelet automatically propagates these updates to the mounted volume, allowing the router to detect the file changes and hot-reload the new certificate and key. As a result, no rolling update of the router deployment is triggered or required.
16
+
17
+
* For secret renewal or rotation, the cert-manager Operator changes the secret content, such as a cert/key pair, but does not change the secret name. This happens because kubelet automatically propagates changes to the secret in the volume mount. The router pod detects the file change and then hot reloads the new cert/key pair. Updating the secret content does not trigger rolling update.
18
+
====
19
+
11
20
.Prerequisites
12
21
13
22
* You must have a wildcard certificate for the fully qualified `.apps` subdomain and its corresponding private key. Each should be in a separate PEM format file.
@@ -24,10 +33,13 @@ You can replace the default ingress certificate for all applications under the `
<1> `</path/to/example-ca.crt>` is the path to the root CA certificate file on your local file system. For example, `/etc/pki/ca-trust/source/anchors`.
39
+
+
40
+
where
41
+
+
42
+
`</path/to/example-ca.crt>`:: The path to the root CA certificate file on your local file system. For example, `/etc/pki/ca-trust/source/anchors`.
31
43
32
44
. Update the cluster-wide proxy configuration with the newly created config map:
33
45
+
@@ -49,28 +61,26 @@ If you change any other parameter in the `openshift-config-user-ca-bundle.crt` f
49
61
+
50
62
[source,terminal]
51
63
----
52
-
$ oc create secret tls <secret> \//<1>
53
-
--cert=</path/to/cert.crt> \//<2>
54
-
--key=</path/to/cert.key> \//<3>
64
+
$ oc create secret tls <secret> \
65
+
--cert=</path/to/cert.crt> \
66
+
--key=</path/to/cert.key> \
55
67
-n openshift-ingress
56
68
----
57
-
<1> `<secret>` is the name of the secret that will contain the certificate chain and private key.
58
-
<2> `</path/to/cert.crt>` is the path to the certificate chain on your local file system.
59
-
<3> `</path/to/cert.key>` is the path to the private key associated with this certificate.
69
+
+
70
+
where:
71
+
+
72
+
`<secret>`:: Specifies the name of the secret that will contain the certificate chain and private key.
73
+
`</path/to/cert.crt>`:: Specifies the path to the certificate chain on your local file system.
74
+
`</path/to/cert.key>`:: Specifies the path to the private key associated with this certificate.
60
75
61
76
. Update the Ingress Controller configuration with the newly created secret:
<1> Replace `<secret>` with the name used for the secret in the previous step.
71
85
+
72
-
[IMPORTANT]
73
-
====
74
-
To trigger the Ingress Operator to perform a rolling update, you must update the name of the secret.
75
-
Because the kubelet automatically propagates changes to the secret in the volume mount, updating the secret contents does not trigger a rolling update. For more information, see this link:https://access.redhat.com/solutions/4542531[Red{nbsp}Hat Knowledgebase Solution].
76
-
====
86
+
* `<secret>`:: Specifies the name used for the secret. Replace `<secret>` with the name used for the secret.
0 commit comments