Skip to content

Commit 327ba2b

Browse files
Merge pull request #60433 from xenolinux/cert-manager-gcp-non--sts
OSDOCS#6057: Authenticating cert-manager Operator on the GCP (without workload identity)
2 parents 6f3c0c2 + de4714d commit 327ba2b

File tree

3 files changed

+111
-0
lines changed

3 files changed

+111
-0
lines changed

_topic_maps/_topic_map.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,6 +1019,8 @@ Topics:
10191019
File: cert-manager-customizing-api-fields
10201020
- Name: Configuring log levels for cert-manager and the cert-manager Operator for Red Hat OpenShift
10211021
File: cert-manager-log-levels
1022+
- Name: Authenticating the cert-manager Operator for Red Hat OpenShift on GCP
1023+
File: cert-manager-authenticate-non-sts-gcp
10221024
- Name: Uninstalling the cert-manager Operator for Red Hat OpenShift
10231025
File: cert-manager-operator-uninstall
10241026
- Name: Viewing audit logs
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * security/cert_manager_operator/cert-manager-authenticate-non-sts-gcp.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="cert-manager-prepare-cloud-credentials-gcp-non-sts_{context}"]
7+
= Configuring cloud credentials for the {cert-manager-operator} on GCP
8+
9+
To configure the cloud credentials for the {cert-manager-operator} on a GCP cluster you must create a `CredentialsRequest` object, and allow the Cloud Credential Operator to generate the cloud credentials secret.
10+
11+
.Prerequisites
12+
13+
* The {cert-manager-operator} 1.11.1 or later is installed.
14+
* You have configured the Cloud Credential Operator to operate in _mint_ or _passthrough_ mode.
15+
16+
.Procedure
17+
18+
. Create a `CredentialsRequest` resource YAML file, such as, `sample-credential-request.yaml` by applying the following yaml:
19+
+
20+
[source,yaml]
21+
----
22+
apiVersion: cloudcredential.openshift.io/v1
23+
kind: CredentialsRequest
24+
metadata:
25+
name: cert-manager
26+
namespace: openshift-cloud-credential-operator
27+
spec:
28+
providerSpec:
29+
apiVersion: cloudcredential.openshift.io/v1
30+
kind: GCPProviderSpec
31+
predefinedRoles:
32+
- roles/dns.admin
33+
secretRef:
34+
name: gcp-credentials
35+
namespace: cert-manager
36+
serviceAccountNames:
37+
- cert-manager
38+
----
39+
40+
. Create a `CredentialsRequest` resource by running the following command:
41+
+
42+
[source,terminal]
43+
----
44+
$ oc create -f sample-credential-request.yaml
45+
----
46+
47+
. Update the subscription object for {cert-manager-operator} by running the following command:
48+
+
49+
[source,terminal]
50+
----
51+
$ oc -n cert-manager-operator patch subscription openshift-cert-manager-operator --type=merge -p '{"spec":{"config":{"env":[{"name":"CLOUD_CREDENTIALS_SECRET_NAME","value":"gcp-credentials"}]}}}'
52+
----
53+
54+
.Verification
55+
56+
. Get the name of the redeployed cert-manager controller pod by running the following command:
57+
+
58+
[source,terminal]
59+
----
60+
$ oc get pods -l app.kubernetes.io/name=cert-manager -n cert-manager
61+
----
62+
+
63+
.Example output
64+
[source,terminal]
65+
----
66+
NAME READY STATUS RESTARTS AGE
67+
cert-manager-bd7fbb9fc-wvbbt 1/1 Running 0 15m39s
68+
----
69+
70+
. Verify that the cert-manager controller pod is updated with GCP workload identity credential volumes that are mounted under the path specified in `mountPath` by running the following command:
71+
+
72+
[source,terminal]
73+
----
74+
$ oc get -n cert-manager pod/<cert-manager_controller_pod_name> -o yaml
75+
----
76+
+
77+
.Example output
78+
[source,terminal]
79+
----
80+
spec:
81+
containers:
82+
- args:
83+
...
84+
volumeMounts:
85+
...
86+
- mountPath: /.config/gcloud
87+
name: cloud-credentials
88+
....
89+
volumes:
90+
...
91+
- name: cloud-credentials
92+
secret:
93+
...
94+
items:
95+
- key: service_account.json
96+
path: application_default_credentials.json
97+
secretName: gcp-credentials
98+
----
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
:_content-type: ASSEMBLY
2+
[id="cert-manager-authenticate-non-sts-gcp"]
3+
= Authenticating the {cert-manager-operator} on GCP
4+
include::_attributes/common-attributes.adoc[]
5+
:context: cert-manager-authenticate-non-sts-gcp
6+
7+
toc::[]
8+
9+
You can configure cloud credentials for the {cert-manager-operator} on a GCP cluster. The cloud credentials are generated by the Cloud Credential Operator.
10+
11+
include::modules/cert-manager-configure-cloud-credentials-gcp-non-sts.adoc[leveloffset=+1]

0 commit comments

Comments
 (0)