|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * security/external_secrets_operator/external-secrets-operator-migrate-downstream-upstream.adoc |
| 4 | + |
| 5 | +:_mod-docs-content-type: PROCEDURE |
| 6 | +[id="external-secrets-operator-create-externalsecretsconfig_{context}"] |
| 7 | += Creating the ExternalSecretsConfig Operator |
| 8 | + |
| 9 | +[role="_abstract"] |
| 10 | +The purpose of creating the `ExternalSecretsConfig` is to install and configure the `external-secrets`. The configuration ensures that cert-manager and Bitwarden support are enabled. |
| 11 | + |
| 12 | +.Prerequisites |
| 13 | + |
| 14 | +* {external-secrets-operator} is installed. |
| 15 | +
|
| 16 | +* {cert-manager-operator} is installed. |
| 17 | +
|
| 18 | +* You have access to the cluster with `cluster-admin` privileges. |
| 19 | +
|
| 20 | +.Procedure |
| 21 | + |
| 22 | +. Create an `externalsecretsconfig` file by defining a YAML file with the following content: |
| 23 | ++ |
| 24 | +[source,yml] |
| 25 | +---- |
| 26 | +apiVersion: operator.openshift.io/v1alpha1 |
| 27 | +kind: ExternalSecretsConfig |
| 28 | +metadata: |
| 29 | + labels: |
| 30 | + app.kubernetes.io/name: cluster |
| 31 | + name: cluster |
| 32 | +spec: |
| 33 | + appConfig: |
| 34 | + logLevel: 3 |
| 35 | + webhookConfig: |
| 36 | + certificateCheckInterval: 5m0s |
| 37 | + controllerConfig: |
| 38 | + certProvider: |
| 39 | + certManager: |
| 40 | + certificateDuration: 8760h0m0s |
| 41 | + certificateRenewBefore: 30m0s |
| 42 | + injectAnnotations: "true" |
| 43 | + issuerRef: |
| 44 | + group: cert-manager.io |
| 45 | + kind: Issuer |
| 46 | + name: _<created_issuer_name>_ |
| 47 | + mode: Enabled |
| 48 | + networkPolicies: |
| 49 | + - componentName: ExternalSecretsCoreController |
| 50 | + egress: |
| 51 | + - ports: |
| 52 | + - port: 443 |
| 53 | + protocol: TCP |
| 54 | + - port: 9998 |
| 55 | + protocol: TCP |
| 56 | + name: allow-external-secrets-egress |
| 57 | + plugins: |
| 58 | + bitwardenSecretManagerProvider: |
| 59 | + mode: Enabled |
| 60 | +---- |
| 61 | + |
| 62 | +. Create the `ExternalSecretsConfig` object by running the following command: |
| 63 | ++ |
| 64 | +[source,terminal] |
| 65 | +---- |
| 66 | +$ oc create -f externalsecretsconfig.yaml |
| 67 | +---- |
| 68 | + |
| 69 | +.Verification |
| 70 | + |
| 71 | +Verify that all custom resources (CRs) are present and that the APIs are using `v1` instead of `v1beta1`. There CRs are retained and automatically converted by the new Operator. |
| 72 | + |
| 73 | +. To verify that the `external-secrets` pods are in a `running` state, run the following command: |
| 74 | ++ |
| 75 | +[source,terminal] |
| 76 | +---- |
| 77 | +$ oc get pods -n external-secret |
| 78 | +---- |
| 79 | ++ |
| 80 | +The following is example output that the `external-secrets` pods are in a `running` state |
| 81 | ++ |
| 82 | +[source,terminal] |
| 83 | +---- |
| 84 | +NAME READY STATUS RESTARTS AGE |
| 85 | +bitwarden-sdk-server-5b4cf48766-w7zp7 1/1 Running 0 5m |
| 86 | +external-secrets-5854b85dd5-m6zf9 1/1 Running 0 5m |
| 87 | +external-secrets-webhook-5cb85b8fdb-6jtqb 1/1 Running 0 5m |
| 88 | +---- |
| 89 | + |
| 90 | +. To verify that the `SecretStore` CR is present, run the following command: |
| 91 | ++ |
| 92 | +[source,terminal] |
| 93 | +---- |
| 94 | +$ oc get secretstores.external-secrets.io -A |
| 95 | +---- |
| 96 | ++ |
| 97 | +The following is example output from validating that the `SecretStore` is present: |
| 98 | ++ |
| 99 | +[source,terminal] |
| 100 | +---- |
| 101 | +NAMESPACE NAME AGE STATUS CAPABILITIES READY |
| 102 | +external-secrets-1 gcp-store 18min Valid ReadWrite True |
| 103 | +external-secrets-2 aws-secretstore 11min Valid ReadWrite True |
| 104 | +external-secrets bitwarden-secretsmanager 20min Valid Readwrite True |
| 105 | +---- |
| 106 | + |
| 107 | +. To verify that the `ExternalSecret` CR is present, run the following command: |
| 108 | ++ |
| 109 | +[source,terminal] |
| 110 | +---- |
| 111 | +$ oc get externalsecrets.external-secrets.io -A |
| 112 | +---- |
| 113 | ++ |
| 114 | +The following is example output from validating that the `SecretStore` is present: |
| 115 | ++ |
| 116 | +[source,terminal] |
| 117 | +---- |
| 118 | +NAMESPACE NAME STORE REFRESH INTERVAL STATUS READY |
| 119 | +external-secrets-1 gcp-externalsecret gcp-store 1hr SecretSynced True |
| 120 | +external-secrets-2 aws-external-secret aws-secret-store 1hr SecretSynced True |
| 121 | +external-secrets bitwarden bitwarden-secretsmanager 1hr SecretSynced True |
| 122 | +---- |
| 123 | + |
| 124 | +. To verify that the `SecretStore` is `apiVersion: external-secrets.io/v1`, run the following command: |
| 125 | ++ |
| 126 | +[source,terminal] |
| 127 | +---- |
| 128 | +$ oc get secretstores.external-secrets.io -n external-secrets-1 gcp-store -o yaml |
| 129 | +---- |
| 130 | ++ |
| 131 | +The following is example output that the `SecretStore` is `apiVersion: external-secrets.io/v1`. |
| 132 | ++ |
| 133 | +[source,yml] |
| 134 | +---- |
| 135 | +apiVersion: external-secrets.io/v1 |
| 136 | +kind: SecretStore |
| 137 | +metadata: |
| 138 | + creationTimestamp: "2025-10-27T11:38:19Z" |
| 139 | + generation: 1 |
| 140 | + name: gcp-store |
| 141 | + namespace: external-secrets-1 |
| 142 | + resourceVersion: "104519" |
| 143 | + uid: 7bccb0cc-2557-4f4a-9caa-1577f0108f4b |
| 144 | +spec: |
| 145 | +. |
| 146 | +. |
| 147 | +. |
| 148 | +status: |
| 149 | + capabilities: ReadWrite |
| 150 | + conditions: |
| 151 | + - lastTransitionTime: "2025-10-27T11:38:19Z" |
| 152 | + message: store validated |
| 153 | + reason: Valid |
| 154 | + status: "True" |
| 155 | + type: Ready |
| 156 | +---- |
| 157 | + |
| 158 | +. To verify that the `ExternalSecret` is `apiVersion: external-secrets.io/v1`, run the following command: |
| 159 | ++ |
| 160 | +[source,terminal] |
| 161 | +---- |
| 162 | +$ oc get externalsecrets.external-secrets.io -n external-secrets-1 gcp-externalsecret -o yaml |
| 163 | +---- |
| 164 | ++ |
| 165 | +The following is example output that the `ExternalSecret` is `apiVersion: external-secrets.io/v1`. |
| 166 | ++ |
| 167 | +[source,yml] |
| 168 | +---- |
| 169 | +apiVersion: external-secrets.io/v1 |
| 170 | +kind: ExternalSecret |
| 171 | +metadata: |
| 172 | + creationTimestamp: "2025-10-27T11:39:03Z" |
| 173 | + generation: 1 |
| 174 | + name: gcp-externalsecret |
| 175 | + namespace: external-secrets-1 |
| 176 | + resourceVersion: "104532" |
| 177 | + uid: 93a3295a-a3ad-4304-90e1-1328d951e5fb |
| 178 | +spec: |
| 179 | +. |
| 180 | +. |
| 181 | +. |
| 182 | +status: |
| 183 | + binding: |
| 184 | + name: k8s-secret-gcp |
| 185 | + conditions: |
| 186 | + - lastTransitionTime: "2025-10-27T11:39:03Z" |
| 187 | + message: secret synced |
| 188 | + reason: SecretSynced |
| 189 | + status: "True" |
| 190 | + type: Ready |
| 191 | + refreshTime: "2025-10-27T12:13:15Z" |
| 192 | + syncedResourceVersion: 1-f47fe3c0b255b6dd8047cdffa772587bb829efe7a1cb70febeda2eb2 |
| 193 | +---- |
| 194 | + |
| 195 | + |
0 commit comments