Skip to content

Commit 9b5d6b2

Browse files
committed
Remove default custom certificate for Ingress Controller
- #27901
1 parent 6c425ff commit 9b5d6b2

File tree

3 files changed

+67
-4
lines changed

3 files changed

+67
-4
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * networking/ingress-operator.adoc
4+
5+
[id="nw-ingress-custom-default-certificate-remove_{context}"]
6+
= Removing a custom default certificate
7+
8+
As an administrator, you can remove a custom certificate that you configured an Ingress Controller to use.
9+
10+
.Prerequisites
11+
12+
* You have access to the cluster as a user with the `cluster-admin` role.
13+
* You have installed the OpenShift CLI (`oc`).
14+
* You previously configured a custom default certificate for the Ingress Controller.
15+
16+
.Procedure
17+
18+
* To remove the custom certificate and restore the certificate that ships with {product-title}, enter the following command:
19+
+
20+
[source,terminal]
21+
----
22+
$ oc patch -n openshift-ingress-operator ingresscontrollers/default \
23+
--type json -p $'- op: remove\n path: /spec/defaultCertificate'
24+
----
25+
+
26+
There can be a delay while the cluster reconciles the new certificate configuration.
27+
28+
.Verification
29+
30+
* To confirm that the original cluster certificate is restored, enter the following command:
31+
+
32+
[source,terminal]
33+
----
34+
$ echo Q | \
35+
openssl s_client -connect console-openshift-console.apps.<domain>:443 -showcerts 2>/dev/null | \
36+
openssl x509 -noout -subject -issuer -enddate
37+
----
38+
+
39+
where:
40+
+
41+
--
42+
`<domain>`:: Specifies the base domain name for your cluster.
43+
--
44+
+
45+
.Example output
46+
[source,text]
47+
----
48+
subject=CN = *.apps.<domain>
49+
issuer=CN = ingress-operator@1620633373
50+
notAfter=May 10 10:44:36 2023 GMT
51+
----

modules/nw-ingress-setting-a-custom-default-certificate.adoc

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,29 @@ $ oc patch --type=merge --namespace openshift-ingress-operator ingresscontroller
7676
+
7777
[source,terminal]
7878
----
79-
$ oc get --namespace openshift-ingress-operator ingresscontrollers/default \
80-
--output jsonpath='{.spec.defaultCertificate}'
79+
$ echo Q |\
80+
openssl s_client -connect console-openshift-console.apps.<domain>:443 -showcerts 2>/dev/null |\
81+
openssl x509 -noout -subject -issuer -enddate
8182
----
8283
+
84+
where:
85+
+
86+
--
87+
`<domain>`:: Specifies the base domain name for your cluster.
88+
--
89+
+
8390
.Example output
84-
[source,terminal]
91+
[source,text]
8592
----
86-
map[name:custom-certs-default]
93+
subject=C = US, ST = NC, L = Raleigh, O = RH, OU = OCP4, CN = *.apps.example.com
94+
issuer=C = US, ST = NC, L = Raleigh, O = RH, OU = OCP4, CN = example.com
95+
notAfter=May 10 08:32:45 2022 GM
8796
----
8897
+
8998
[TIP]
9099
====
91100
You can alternatively apply the following YAML to set a custom default certificate:
101+
92102
[source,yaml]
93103
----
94104
apiVersion: operator.openshift.io/v1

networking/ingress-operator.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ include::modules/nw-ingress-controller-status.adoc[leveloffset=+1]
4343

4444
include::modules/nw-ingress-setting-a-custom-default-certificate.adoc[leveloffset=+2]
4545

46+
include::modules/nw-ingress-custom-default-certificate-remove.adoc[leveloffset=+2]
47+
4648
include::modules/nw-scaling-ingress-controller.adoc[leveloffset=+2]
4749

4850
include::modules/nw-configure-ingress-access-logging.adoc[leveloffset=+2]

0 commit comments

Comments
 (0)