Maintaining cloud provider credentials
If your cloud provider credentials are changed for any reason, you must manually update the secret that the Cloud Credential Operator (CCO) uses to manage cloud provider credentials.
The process for rotating cloud credentials depends on the mode that the CCO is configured to use. After you rotate credentials for a cluster that is using mint mode, you must manually remove the component credentials that were created by the removed credential.
-
Your cluster is installed on a platform that supports rotating cloud credentials manually with the CCO mode that you are using:
-
For mint mode, Amazon Web Services (AWS) and Google Cloud are supported.
-
-
You have changed the credentials that are used to interface with your cloud provider.
-
The new credentials have sufficient permissions for the mode CCO is configured to use in your cluster.
-
In the Administrator perspective of the web console, navigate to Workloads → Secrets.
-
In the table on the Secrets page, find the root secret for your cloud provider.
Platform Secret name AWS
aws-credsGoogle Cloud
gcp-credentials -
Click the Options menu
in the same row as the secret and select Edit Secret.
-
Record the contents of the Value field or fields. You can use this information to verify that the value is different after updating the credentials.
-
Update the text in the Value field or fields with the new authentication information for your cloud provider, and then click Save.
-
Delete each component secret that is referenced by the individual
CredentialsRequestobjects.-
Log in to the Red Hat OpenShift Container Platform CLI as a user with the
cluster-adminrole. -
Get the names and namespaces of all referenced component secrets:
$ oc -n openshift-cloud-credential-operator get CredentialsRequest \ -o json | jq -r '.items[] | select (.spec.providerSpec.kind=="<provider_spec>") | .spec.secretRef'where
<provider_spec>is the corresponding value for your cloud provider:-
AWS:
AWSProviderSpec -
Google Cloud:
GCPProviderSpec
The following example is partial output for the command on an AWS cluster:
{ "name": "ebs-cloud-credentials", "namespace": "openshift-cluster-csi-drivers" } { "name": "cloud-credential-operator-iam-ro-creds", "namespace": "openshift-cloud-credential-operator" } -
-
Delete each of the referenced component secrets:
$ oc delete secret <secret_name> \-n <secret_namespace>
where:
<secret_name>-
Specifies the name of a secret.
<secret_namespace>-
Specifies the namespace that contains the secret.
The following example is a command to delete an AWS secret:
$ oc delete secret ebs-cloud-credentials -n openshift-cluster-csi-driversYou do not need to manually delete the credentials from your provider console. Deleting the referenced component secrets will cause the CCO to delete the existing credentials from the platform and create new ones.
-
-
In the Administrator perspective of the web console, navigate to Workloads → Secrets.
-
Verify that the contents of the Value field or fields have changed.