Skip to content

Commit 6f43bed

Browse files
authored
Merge pull request #58206 from jeana-redhat/OSDOCS-5532-gcp-aws-sample-creds
[OSDOCS-5532]: Manual creds YAML cleanup
2 parents 15f578b + fec8942 commit 6f43bed

File tree

1 file changed

+63
-106
lines changed

1 file changed

+63
-106
lines changed

modules/manually-create-identity-access-management.adoc

Lines changed: 63 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// * installing/installing_azure/manually-creating-iam-azure.adoc
55
// * installing/installing_gcp/manually-creating-iam-gcp.adoc
66
// * installing/installing_azure_stack_hub/installing-azure-stack-hub-default.adoc
7+
// * installing/installing_azure_stack_hub/installing-azure-stack-hub-network-customizations.adoc
78

89
ifeval::["{context}" == "manually-creating-iam-aws"]
910
:aws:
@@ -42,10 +43,7 @@ endif::cco-manual-mode[]
4243

4344
//For providers that support multiple modes of operation
4445
ifdef::cco-multi-mode[]
45-
The Cloud Credential Operator (CCO) can be put into manual mode prior to
46-
installation in environments where the cloud identity and access management
47-
(IAM) APIs are not reachable, or the administrator prefers not to store an
48-
administrator-level credential secret in the cluster `kube-system` namespace.
46+
The Cloud Credential Operator (CCO) can be put into manual mode prior to installation in environments where the cloud identity and access management (IAM) APIs are not reachable, or the administrator prefers not to store an administrator-level credential secret in the cluster `kube-system` namespace.
4947
endif::cco-multi-mode[]
5048

5149
//For providers who only support manual mode
@@ -56,7 +54,7 @@ endif::cco-manual-mode[]
5654
.Procedure
5755

5856
ifdef::cco-multi-mode[]
59-
. Change to the directory that contains the installation program and create the `install-config.yaml` file:
57+
. Change to the directory that contains the installation program and create the `install-config.yaml` file by running the following command:
6058
+
6159
[source,terminal]
6260
----
@@ -88,11 +86,9 @@ endif::cco-multi-mode[]
8886
$ openshift-install create manifests --dir <installation_directory>
8987
----
9088
+
91-
where:
92-
93-
`<installation_directory>`:: Specifies the directory in which the installation program creates files.
89+
where `<installation_directory>` is the directory in which the installation program creates files.
9490

95-
. From the directory that contains the installation program, obtain details of the {product-title} release image that your `openshift-install` binary is built to use:
91+
. From the directory that contains the installation program, obtain details of the {product-title} release image that your `openshift-install` binary is built to use by running the following command:
9692
+
9793
[source,terminal]
9894
----
@@ -105,42 +101,38 @@ $ openshift-install version
105101
release image quay.io/openshift-release-dev/ocp-release:4.y.z-x86_64
106102
----
107103

108-
. Locate all `CredentialsRequest` objects in this release image that target the cloud you are deploying on:
104+
. Locate all `CredentialsRequest` objects in this release image that target the cloud you are deploying on by running the following command:
109105
+
110106
[source,terminal]
111-
ifdef::aws[]
112-
----
113-
$ oc adm release extract quay.io/openshift-release-dev/ocp-release:4.y.z-x86_64 --credentials-requests --cloud=aws
114107
----
108+
$ oc adm release extract quay.io/openshift-release-dev/ocp-release:4.y.z-x86_64 \
109+
--credentials-requests \
110+
ifdef::aws[]
111+
--cloud=aws
115112
endif::aws[]
116113
ifdef::azure,ash[]
117-
----
118-
$ oc adm release extract quay.io/openshift-release-dev/ocp-release:4.y.z-x86_64 --credentials-requests --cloud=azure
119-
----
114+
--cloud=azure
120115
endif::azure,ash[]
121116
ifdef::google-cloud-platform[]
122-
----
123-
$ oc adm release extract quay.io/openshift-release-dev/ocp-release:4.y.z-x86_64 --credentials-requests --cloud=gcp
124-
----
117+
--cloud=gcp
125118
endif::google-cloud-platform[]
119+
----
126120
+
127121
This command creates a YAML file for each `CredentialsRequest` object.
128122
+
129-
ifdef::aws[]
130123
.Sample `CredentialsRequest` object
131124
[source,yaml]
132125
----
133126
apiVersion: cloudcredential.openshift.io/v1
134127
kind: CredentialsRequest
135128
metadata:
136-
name: cloud-credential-operator-iam-ro
129+
name: <component-credentials-request>
137130
namespace: openshift-cloud-credential-operator
131+
...
138132
spec:
139-
secretRef:
140-
name: cloud-credential-operator-iam-ro-creds
141-
namespace: openshift-cloud-credential-operator
142133
providerSpec:
143134
apiVersion: cloudcredential.openshift.io/v1
135+
ifdef::aws[]
144136
kind: AWSProviderSpec
145137
statementEntries:
146138
- effect: Allow
@@ -149,108 +141,62 @@ spec:
149141
- iam:GetUserPolicy
150142
- iam:ListAccessKeys
151143
resource: "*"
152-
----
153144
endif::aws[]
154145
ifdef::azure,ash[]
155-
.Sample `CredentialsRequest` object
156-
[source,yaml]
157-
----
158-
apiVersion: cloudcredential.openshift.io/v1
159-
kind: CredentialsRequest
160-
metadata:
161-
labels:
162-
controller-tools.k8s.io: "1.0"
163-
name: openshift-image-registry-azure
164-
namespace: openshift-cloud-credential-operator
165-
spec:
166-
secretRef:
167-
name: installer-cloud-credentials
168-
namespace: openshift-image-registry
169-
providerSpec:
170-
apiVersion: cloudcredential.openshift.io/v1
171146
kind: AzureProviderSpec
172147
roleBindings:
173148
- role: Contributor
174-
----
175149
endif::azure,ash[]
176150
ifdef::google-cloud-platform[]
177-
.Sample `CredentialsRequest` object
178-
[source,yaml]
179-
----
180-
apiVersion: cloudcredential.openshift.io/v1
181-
kind: CredentialsRequest
182-
metadata:
183-
labels:
184-
controller-tools.k8s.io: "1.0"
185-
name: openshift-image-registry-gcs
186-
namespace: openshift-cloud-credential-operator
187-
spec:
188-
secretRef:
189-
name: installer-cloud-credentials
190-
namespace: openshift-image-registry
191-
providerSpec:
192-
apiVersion: cloudcredential.openshift.io/v1
193151
kind: GCPProviderSpec
194152
predefinedRoles:
195153
- roles/storage.admin
196154
- roles/iam.serviceAccountUser
197155
skipServiceCheck: true
198-
----
199156
endif::google-cloud-platform[]
157+
...
158+
----
200159
201160
. Create YAML files for secrets in the `openshift-install` manifests directory that you generated previously. The secrets must be stored using the namespace and secret name defined in the `spec.secretRef` for each `CredentialsRequest` object.
202161
+
203-
ifdef::ash[]
204-
.Sample `CredentialsRequest` object
205-
[source,yaml]
206-
----
207-
apiVersion: cloudcredential.openshift.io/v1
208-
kind: CredentialsRequest
209-
metadata:
210-
annotations:
211-
include.release.openshift.io/ibm-cloud-managed: "true"
212-
include.release.openshift.io/self-managed-high-availability: "true"
213-
include.release.openshift.io/single-node-developer: "true"
214-
labels:
215-
controller-tools.k8s.io: "1.0"
216-
name: openshift-image-registry-azure
217-
namespace: openshift-cloud-credential-operator
218-
spec:
219-
providerSpec:
220-
apiVersion: cloudcredential.openshift.io/v1
221-
kind: AzureProviderSpec
222-
roleBindings:
223-
- role: Contributor
224-
secretRef:
225-
name: installer-cloud-credentials
226-
namespace: openshift-image-registry
227-
----
228-
+
229-
endif::ash[]
230-
231-
.Sample `CredentialsRequest` object
162+
.Sample `CredentialsRequest` object with secrets
232163
[source,yaml]
233164
----
234165
apiVersion: cloudcredential.openshift.io/v1
235166
kind: CredentialsRequest
236167
metadata:
237-
annotations:
238-
include.release.openshift.io/ibm-cloud-managed: "true"
239-
include.release.openshift.io/self-managed-high-availability: "true"
240-
include.release.openshift.io/single-node-developer: "true"
241-
labels:
242-
controller-tools.k8s.io: "1.0"
243-
name: openshift-image-registry-azure
168+
name: <component-credentials-request>
244169
namespace: openshift-cloud-credential-operator
170+
...
245171
spec:
246172
providerSpec:
247173
apiVersion: cloudcredential.openshift.io/v1
174+
ifdef::aws[]
175+
kind: AWSProviderSpec
176+
statementEntries:
177+
- effect: Allow
178+
action:
179+
- s3:CreateBucket
180+
- s3:DeleteBucket
181+
resource: "*"
182+
endif::aws[]
183+
ifdef::ash,azure[]
248184
kind: AzureProviderSpec
249185
roleBindings:
250186
- role: Contributor
187+
endif::ash,azure[]
188+
ifdef::gcp[]
189+
kind: GCPProviderSpec
190+
predefinedRoles:
191+
- roles/iam.securityReviewer
192+
- roles/iam.roleViewer
193+
skipServiceCheck: true
194+
endif::gcp[]
195+
...
251196
secretRef:
252-
name: installer-cloud-credentials
253-
namespace: openshift-image-registry
197+
name: <component-secret>
198+
namespace: <component-namespace>
199+
...
254200
----
255201
+
256202
.Sample `Secret` object
@@ -259,16 +205,27 @@ spec:
259205
apiVersion: v1
260206
kind: Secret
261207
metadata:
262-
namespace: openshift-image-registry
263-
name: installer-cloud-credentials
208+
name: <component-secret>
209+
namespace: <component-namespace>
210+
ifdef::aws[]
211+
data:
212+
aws_access_key_id: <base64_encoded_aws_access_key_id>
213+
aws_secret_access_key: <base64_encoded_aws_secret_access_key>
214+
endif::aws[]
215+
ifdef::azure,ash[]
264216
data:
265-
azure_subscription_id: <base64_encrypted_azure_subscription_id>
266-
azure_client_id: <base64_encrypted_azure_client_id>
267-
azure_client_secret: <base64_encrypted_azure_client_secret>
268-
azure_tenant_id: <base64_encrypted_azure_tenant_id>
269-
azure_resource_prefix: <base64_encrypted_azure_resource_prefix>
270-
azure_resourcegroup: <base64_encrypted_azure_resourcegroup>
271-
azure_region: <base64_encrypted_azure_region>
217+
azure_subscription_id: <base64_encoded_azure_subscription_id>
218+
azure_client_id: <base64_encoded_azure_client_id>
219+
azure_client_secret: <base64_encoded_azure_client_secret>
220+
azure_tenant_id: <base64_encoded_azure_tenant_id>
221+
azure_resource_prefix: <base64_encoded_azure_resource_prefix>
222+
azure_resourcegroup: <base64_encoded_azure_resourcegroup>
223+
azure_region: <base64_encoded_azure_region>
224+
endif::azure,ash[]
225+
ifdef::google-cloud-platform[]
226+
data:
227+
service_account.json: <base64_encoded_gcp_service_account_file>
228+
endif::google-cloud-platform[]
272229
----
273230
+
274231
[IMPORTANT]

0 commit comments

Comments
 (0)