Skip to content

Commit e0a9066

Browse files
authored
Merge pull request #101095 from sslocket/OCPBUGS-61221
OCPBUGS-61221-63545# Ensure new keypairs are not generated and public-key-file flag is used where appropriate
2 parents 50315cf + 24e23de commit e0a9066

File tree

2 files changed

+57
-28
lines changed

2 files changed

+57
-28
lines changed

modules/cco-ccoctl-upgrading.adoc

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,23 @@ On AWS clusters, some `ccoctl` commands make AWS API calls to create or modify A
2222
2323
.Procedure
2424

25+
. Create the output directory if it does not already exist by running the following command:
26+
+
27+
[source,terminal]
28+
----
29+
$ mkdir -p <path_to_ccoctl_output_dir>
30+
----
31+
32+
. Extract the bound service account signing key from the cluster and save it to the output directory by running the following command:
33+
+
34+
[source,terminal]
35+
----
36+
$ oc get secret bound-service-account-signing-key \
37+
-n openshift-kube-apiserver \
38+
-ojsonpath='{ .data.service-account\.pub }' | base64 \
39+
-d > <path_to_ccoctl_output_dir>/serviceaccount-signer.public
40+
----
41+
2542
. Use the `ccoctl` tool to process all `CredentialsRequest` objects by running the command for your cloud provider. The following commands process `CredentialsRequest` objects:
2643
+
2744
.Amazon Web Services (AWS)
@@ -34,14 +51,16 @@ $ ccoctl aws create-all \// <1>
3451
--region=<aws_region> \// <3>
3552
--credentials-requests-dir=<path_to_credentials_requests_directory> \// <4>
3653
--output-dir=<path_to_ccoctl_output_dir> \// <5>
37-
--create-private-s3-bucket <6>
54+
--public-key-file=<path_to_ccoctl_output_dir>/serviceaccount-signer.public \// <6>
55+
--create-private-s3-bucket <7>
3856
----
3957
<1> To create the AWS resources individually, use the "Creating AWS resources individually" procedure in the "Installing a cluster on AWS with customizations" content. This option might be useful if you need to review the JSON files that the `ccoctl` tool creates before modifying AWS resources, or if the process the `ccoctl` tool uses to create AWS resources automatically does not meet the requirements of your organization.
4058
<2> Specify the name used to tag any cloud resources that are created for tracking.
4159
<3> Specify the AWS region in which cloud resources will be created.
4260
<4> Specify the directory containing the files for the component `CredentialsRequest` objects.
43-
<5> Optional: Specify the directory in which you want the `ccoctl` utility to create objects. By default, the utility creates objects in the directory in which the commands are run.
44-
<6> Optional: By default, the `ccoctl` utility stores the OpenID Connect (OIDC) configuration files in a public S3 bucket and uses the S3 URL as the public OIDC endpoint. To store the OIDC configuration in a private S3 bucket that is accessed by the IAM identity provider through a public CloudFront distribution URL instead, use the `--create-private-s3-bucket` parameter.
61+
<5> Specify the path to the output directory.
62+
<6> Specify the path to the `serviceaccount-signer.public` file that you extracted from the cluster.
63+
<7> Optional: By default, the `ccoctl` utility stores the OpenID Connect (OIDC) configuration files in a public S3 bucket and uses the S3 URL as the public OIDC endpoint. To store the OIDC configuration in a private S3 bucket that is accessed by the IAM identity provider through a public CloudFront distribution URL instead, use the `--create-private-s3-bucket` parameter.
4564
====
4665
+
4766
.{gcp-first}
@@ -54,13 +73,15 @@ $ ccoctl gcp create-all \
5473
--region=<gcp_region> \// <2>
5574
--project=<gcp_project_id> \// <3>
5675
--credentials-requests-dir=<path_to_credentials_requests_directory> \// <4>
57-
--output-dir=<path_to_ccoctl_output_dir> <5>
76+
--output-dir=<path_to_ccoctl_output_dir> \// <5>
77+
--public-key-file=<path_to_ccoctl_output_dir>/serviceaccount-signer.public \// <6>
5878
----
5979
<1> Specify the user-defined name for all created {gcp-short} resources used for tracking.
6080
<2> Specify the {gcp-short} region in which cloud resources will be created.
6181
<3> Specify the {gcp-short} project ID in which cloud resources will be created.
6282
<4> Specify the directory containing the files of `CredentialsRequest` manifests to create {gcp-short} service accounts.
63-
<5> Optional: Specify the directory in which you want the `ccoctl` utility to create objects. By default, the utility creates objects in the directory in which the commands are run.
83+
<5> Specify the path to the output directory.
84+
<6> Specify the path to the `serviceaccount-signer.public` file that you extracted from the cluster.
6485
====
6586
+
6687
.{ibm-cloud-title}
@@ -87,19 +108,21 @@ $ ccoctl ibmcloud create-service-id \
87108
----
88109
$ ccoctl azure create-managed-identities \
89110
--name <azure_infra_name> \// <1>
90-
--output-dir ./output_dir \
91-
--region <azure_region> \// <2>
92-
--subscription-id <azure_subscription_id> \// <3>
93-
--credentials-requests-dir <path_to_directory_for_credentials_requests> \
94-
--issuer-url "${OIDC_ISSUER_URL}" \// <4>
95-
--dnszone-resource-group-name <azure_dns_zone_resourcegroup_name> \// <5>
96-
--installation-resource-group-name "${AZURE_INSTALL_RG}" <6>
111+
--output-dir=<path_to_ccoctl_output_dir> \// <2>
112+
--region <azure_region> \// <3>
113+
--subscription-id <azure_subscription_id> \// <4>
114+
--credentials-requests-dir <path_to_directory_for_credentials_requests> \// <5>
115+
--issuer-url "${OIDC_ISSUER_URL}" \// <6>
116+
--dnszone-resource-group-name <azure_dns_zone_resourcegroup_name> \// <7>
117+
--installation-resource-group-name "${AZURE_INSTALL_RG}" <8>
97118
----
98119
<1> The value of the `name` parameter is used to create an Azure resource group.
99120
To use an existing Azure resource group instead of creating a new one, specify the `--oidc-resource-group-name` argument with the existing group name as its value.
100-
<2> Specify the region of the existing cluster.
101-
<3> Specify the subscription ID of the existing cluster.
102-
<4> Specify the OIDC issuer URL from the existing cluster.
121+
<2> Specify the path to the output directory.
122+
<3> Specify the region of the existing cluster.
123+
<4> Specify the subscription ID of the existing cluster.
124+
<5> Specify the directory containing the files for the component `CredentialsRequest` objects.
125+
<6> Specify the OIDC issuer URL from the existing cluster.
103126
You can obtain this value by running the following command:
104127
+
105128
[source,terminal]
@@ -108,8 +131,8 @@ $ oc get authentication cluster \
108131
-o jsonpath \
109132
--template='{ .spec.serviceAccountIssuer }'
110133
----
111-
<5> Specify the name of the resource group that contains the DNS zone.
112-
<6> Specify the {azure-short} resource group name.
134+
<7> Specify the name of the resource group that contains the DNS zone.
135+
<8> Specify the {azure-short} resource group name.
113136
You can obtain this value by running the following command:
114137
+
115138
[source,terminal]

modules/rotating-bound-service-keys.adoc

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -187,14 +187,16 @@ ifdef::rotate-aws[]
187187
[source,terminal]
188188
----
189189
$ ccoctl aws create-identity-provider \
190-
--dry-run \// <1>
190+
--dry-run \// <1>
191191
--output-dir ${TEMPDIR} \
192-
--name fake \// <2>
193-
--region us-east-1 <3>
192+
--public-key-file=${TEMPDIR}/serviceaccount-signer.public \// <2>
193+
--name fake \// <3>
194+
--region us-east-1 <4>
194195
----
195196
<1> The `--dry-run` option outputs files, including the new `keys.json` file, to the disk without making API calls.
196-
<2> Because the `--dry-run` option does not make any API calls, some parameters do not require real values.
197-
<3> Specify any valid {aws-short} region, such as `us-east-1`.
197+
<2> Specify the path to the public key that you downloaded in the previous step.
198+
<3> Because the `--dry-run` option does not make any API calls, some parameters do not require real values.
199+
<4> Specify any valid {aws-short} region, such as `us-east-1`.
198200
This value does not need to match the region the cluster is in.
199201
endif::rotate-aws[]
200202
ifdef::rotate-gcp[]
@@ -204,12 +206,14 @@ ifdef::rotate-gcp[]
204206
$ ccoctl gcp create-workload-identity-provider \
205207
--dry-run \// <1>
206208
--output-dir=${TEMPDIR} \
207-
--name fake \// <2>
209+
--public-key-file=${TEMPDIR}/serviceaccount-signer.public \// <2>
210+
--name fake \// <3>
208211
--project fake \
209212
--workload-identity-pool fake
210213
----
211214
<1> The `--dry-run` option outputs files, including the new `keys.json` file, to the disk without making API calls.
212-
<2> Because the `--dry-run` option does not make any API calls, some parameters do not require real values.
215+
<2> Specify the path to the public key that you downloaded in the previous step.
216+
<3> Because the `--dry-run` option does not make any API calls, some parameters do not require real values.
213217
endif::rotate-gcp[]
214218
ifdef::rotate-azure[]
215219
+
@@ -218,14 +222,16 @@ ifdef::rotate-azure[]
218222
$ ccoctl aws create-identity-provider \// <1>
219223
--dry-run \// <2>
220224
--output-dir ${TEMPDIR} \
221-
--name fake \// <3>
222-
--region us-east-1 <4>
225+
--public-key-file=${TEMPDIR}/serviceaccount-signer.public \// <3>
226+
--name fake \// <4>
227+
--region us-east-1 <5>
223228
----
224229
<1> The `ccoctl azure` command does not include a `--dry-run` option.
225230
To use the `--dry-run` option, you must specify `aws` for an {azure-short} cluster.
226231
<2> The `--dry-run` option outputs files, including the new `keys.json` file, to the disk without making API calls.
227-
<3> Because the `--dry-run` option does not make any API calls, some parameters do not require real values.
228-
<4> Specify any valid {aws-short} region, such as `us-east-1`.
232+
<3> Specify the path to the public key that you downloaded in the previous step.
233+
<4> Because the `--dry-run` option does not make any API calls, some parameters do not require real values.
234+
<5> Specify any valid {aws-short} region, such as `us-east-1`.
229235
This value does not need to match the region the cluster is in.
230236
endif::rotate-azure[]
231237

0 commit comments

Comments
 (0)