Skip to content

Commit fa53a03

Browse files
authored
Merge pull request #32722 from jeana-redhat/OSDOCS-2197-STS-post-install
OSDOCS-2197 STS: delete OIDC keys post-installation
2 parents c7c9f17 + 9affe60 commit fa53a03

File tree

5 files changed

+58
-4
lines changed

5 files changed

+58
-4
lines changed

installing/installing_aws/uninstalling-cluster-aws.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ toc::[]
88
You can remove a cluster that you deployed to Amazon Web Services (AWS).
99

1010
include::modules/installation-uninstall-clouds.adoc[leveloffset=+1]
11+
12+
include::modules/cco-ccoctl-deleting-sts-resources.adoc[leveloffset=+1]

modules/cco-ccoctl-creating-individually.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ $ ccoctl aws create-key-pair
4141
2021/04/13 11:01:03 Copying signing key for use by installer
4242
----
4343
+
44-
Where `serviceaccount-signer.private` and `serviceaccount-signer.public` are the generated key files.
44+
where `serviceaccount-signer.private` and `serviceaccount-signer.public` are the generated key files.
4545
+
4646
This command also creates a private key that the cluster requires during installation in `/_<path_to_ccoctl_output_dir>_/tls/bound-service-account-signing-key.key`.
4747

@@ -52,7 +52,7 @@ This command also creates a private key that the cluster requires during install
5252
$ ccoctl aws create-identity-provider --name=__<name>__ --region=__<aws_region>__ --public-key-file=__<path_to_ccoctl_output_dir>__/serviceaccount-signer.public
5353
----
5454
+
55-
Where:
55+
where:
5656
+
5757
** `_<name>_` is the name used to tag any cloud resources that are created for tracking.
5858
** `_<aws-region>_` is the AWS region in which cloud resources will be created.
@@ -69,7 +69,7 @@ Where:
6969
2021/04/13 11:16:18 Identity Provider created with ARN: arn:aws:iam::__<aws_account_id>__:oidc-provider/__<name>__-oidc.s3.__<aws_region>__.amazonaws.com
7070
----
7171
+
72-
Where `02-openid-configuration` is a discovery document and `03-keys.json` is a JSON web key set file.
72+
where `02-openid-configuration` is a discovery document and `03-keys.json` is a JSON web key set file.
7373
+
7474
This command also creates a YAML configuration file in `/_<path_to_ccoctl_output_dir>_/manifests/cluster-authentication-02-config.yaml`. This file sets the issuer URL field for the service account tokens that the cluster generates, so that the AWS IAM identity provider trusts the tokens.
7575

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+
// * installing/installing_aws/uninstalling-cluster-aws.adoc
4+
5+
[id="cco-ccoctl-deleting-sts-resources_{context}"]
6+
= Deleting AWS resources with the Cloud Credential Operator utility
7+
8+
To clean up resources after uninstalling an {product-title} cluster with the Cloud Credential Operator (CCO) in manual mode with STS, you can use the CCO utility (`ccoctl`) to remove the AWS resources that `ccoctl` created during installation.
9+
10+
.Prerequisites
11+
12+
* Extract and prepare the `ccoctl` binary.
13+
* Install an {product-title} cluster with the CCO in manual mode with STS.
14+
15+
.Procedure
16+
17+
* Delete the AWS resources that `ccoctl` created:
18+
+
19+
[source,terminal,subs="+quotes"]
20+
----
21+
$ ccoctl aws delete --name=__<name>__ --region=__<aws_region>__
22+
----
23+
+
24+
where:
25+
+
26+
** `_<name>_` matches the name used to originally create and tag the cloud resources.
27+
** `_<aws-region>_` is the AWS region in which cloud resources will be deleted.
28+
+
29+
.Example output:
30+
+
31+
[source,terminal,subs="+quotes"]
32+
----
33+
2021/04/08 17:50:41 Identity Provider object .well-known/openid-configuration deleted from the bucket __<name>__-oidc
34+
2021/04/08 17:50:42 Identity Provider object keys.json deleted from the bucket __<name>__-oidc
35+
2021/04/08 17:50:43 Identity Provider bucket __<name>__-oidc deleted
36+
2021/04/08 17:51:05 Policy __<name>__-openshift-cloud-credential-operator-cloud-credential-o associated with IAM Role __<name>__-openshift-cloud-credential-operator-cloud-credential-o deleted
37+
2021/04/08 17:51:05 IAM Role __<name>__-openshift-cloud-credential-operator-cloud-credential-o deleted
38+
2021/04/08 17:51:07 Policy __<name>__-openshift-cluster-csi-drivers-ebs-cloud-credentials associated with IAM Role __<name>__-openshift-cluster-csi-drivers-ebs-cloud-credentials deleted
39+
2021/04/08 17:51:07 IAM Role __<name>__-openshift-cluster-csi-drivers-ebs-cloud-credentials deleted
40+
2021/04/08 17:51:08 Policy __<name>__-openshift-image-registry-installer-cloud-credentials associated with IAM Role __<name>__-openshift-image-registry-installer-cloud-credentials deleted
41+
2021/04/08 17:51:08 IAM Role __<name>__-openshift-image-registry-installer-cloud-credentials deleted
42+
2021/04/08 17:51:09 Policy __<name>__-openshift-ingress-operator-cloud-credentials associated with IAM Role __<name>__-openshift-ingress-operator-cloud-credentials deleted
43+
2021/04/08 17:51:10 IAM Role __<name>__-openshift-ingress-operator-cloud-credentials deleted
44+
2021/04/08 17:51:11 Policy __<name>__-openshift-machine-api-aws-cloud-credentials associated with IAM Role __<name>__-openshift-machine-api-aws-cloud-credentials deleted
45+
2021/04/08 17:51:11 IAM Role __<name>__-openshift-machine-api-aws-cloud-credentials deleted
46+
2021/04/08 17:51:39 Identity Provider with ARN arn:aws:iam::__<aws_account_id>__:oidc-provider/__<name>__-oidc.s3.__<aws_region>__.amazonaws.com deleted
47+
----
48+
49+
.Verification
50+
51+
You can verify that the resources are deleted by querying AWS. For more information, refer to AWS documentation.

modules/sts-mode-installing-manual-config.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ OPENID_BUCKET_URL="https://<oidc_bucket_name>.s3.<aws_region>.amazonaws.com"
6262
}
6363
----
6464
+
65-
Where:
65+
where:
6666

6767
*** `<public_signing_key_id>` is generated from the public key with:
6868
+

post_installation_configuration/cluster-tasks.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,7 @@ include::modules/nodes-pods-pod-disruption-configuring.adoc[leveloffset=+2]
589589

590590
[id="post-install-rotate-remove-cloud-creds"]
591591
== Rotating or removing cloud provider credentials
592+
592593
After installing {product-title}, some organizations require the rotation or removal of the cloud provider credentials that were used during the initial installation.
593594

594595
To allow the cluster to use the new credentials, you must update the secrets that the xref:../operators/operator-reference.adoc#cloud-credential-operator_red-hat-operators[Cloud Credential Operator (CCO)] uses to manage cloud provider credentials.

0 commit comments

Comments
 (0)