Uploaded image for project: 'OpenShift Cloud'
  1. OpenShift Cloud
  2. OCPCLOUD-2713

[AWS] Handle credentials secret conversion to CAPI

    • Icon: Story Story
    • Resolution: Unresolved
    • Icon: Critical Critical
    • None
    • None
    • CLOUD Sprint 262, CLOUD Sprint 268, CLOUD Sprint 269

      Background

      In MAPA, we provide a way for a user to specify the credentials to use for creating and managing AWS resources. This secret comes from a CredentialsRequest and is created either by CCO, or manually, with the name `aws-cloud-credentials`.

      Any Machine/MachineSet referencing these credentials is effectively using the "default".

      In CAPA, the default is to us the cluster identity ref to work out what to do. When not specified, it will fallback to using the controllers role, which we populate today using a credentials request.

      Therefore, any Machine using the default in MAPA/CAPA, has an option to be converted across.

      Where we then have an issue, is converting non-standard credentials.

      If any user has created a non-standard credential, we must set a static identity that would then be used for the entire cluster.

      We must work out how to message about this/how to handle this. Initially, we can block the conversion and suggest a KCS to allow the user to set the AWSCluster IdentityRef, once the identity ref is configured, we can ignore the credentials secret.

      Steps

      • Implement detection and conversion of the default credentials secret as described above
      • Add logic to detect non-default credentials and return an appropriate error message
      • Create a KCS to explain the steps necessary to use a custom credential

      Stakeholders

      • Cluster Infra

      Definition of Done

      • Credentials secrets are converted/users are told what to do/how to convert across
      • Docs
      • <Add docs requirements for this card>
      • Testing
      • <Explain testing that will be added>

            [OCPCLOUD-2713] [AWS] Handle credentials secret conversion to CAPI

            Joel Speed added a comment -

            Notes from today's standup:

            • With any custom credential, we must return an error and tell them how to fix it (create a static identity)
            • Could add a label to the static identity that provides the conversion the name of a secret in the MAPI namespace to convert back to
            • Prefer not to have many custom solutions for non-convertible things, but non-convertibles make it hard to remove MAPI controllers
            • Need to write up a KCS to be able to link that provides the solution of how to manually fix the issue

            Joel Speed added a comment - Notes from today's standup: With any custom credential, we must return an error and tell them how to fix it (create a static identity) Could add a label to the static identity that provides the conversion the name of a secret in the MAPI namespace to convert back to Prefer not to have many custom solutions for non-convertible things, but non-convertibles make it hard to remove MAPI controllers Need to write up a KCS to be able to link that provides the solution of how to manually fix the issue

            joelspeed thanks. I misinterpreted which controllers were falling back to the controllers role.

            Understood on the custom credential, makes total sense.

            Nolan Brubaker added a comment - joelspeed thanks. I misinterpreted which controllers were falling back to the controllers role. Understood on the custom credential, makes total sense.

            Joel Speed added a comment -

            We have https://github.com/openshift/cluster-capi-operator/blob/c5a5e4ef8e201b016e27c654f84ecf8bc77e9258/manifests/0000_30_cluster-api_01_credentials-request.yaml#L1-L62 on the CAPI side

            The MAO secret generates the credential in the MAPI namespace, this creates a secret in the CAPI namespace. I would expect we probably want to ignore the MAPI credential secret if the default is being used, and move over to using the default CAPI one instead.

            I'm concerned though what would happen if someone is using a custom secret. Do we need to copy this to the CAPI namespaces, what are the security concerns there

            Joel Speed added a comment - We have https://github.com/openshift/cluster-capi-operator/blob/c5a5e4ef8e201b016e27c654f84ecf8bc77e9258/manifests/0000_30_cluster-api_01_credentials-request.yaml#L1-L62 on the CAPI side The MAO secret generates the credential in the MAPI namespace, this creates a secret in the CAPI namespace. I would expect we probably want to ignore the MAPI credential secret if the default is being used, and move over to using the default CAPI one instead. I'm concerned though what would happen if someone is using a custom secret. Do we need to copy this to the CAPI namespaces, what are the security concerns there

            > When not specified, it will fallback to using the controllers role, which we populate today using a credentials request.

            Where is this particular credentials request? I see that there's a service account for AWS in https://github.com/openshift/machine-api-operator/blob/main/install/0000_30_machine-api-operator_00_credentials-request.yaml, but I believe that's the AWS service account associated with the `aws-cloud-credential` default secret.

            Nolan Brubaker added a comment - > When not specified, it will fallback to using the controllers role, which we populate today using a credentials request. Where is this particular credentials request? I see that there's a service account for AWS in https://github.com/openshift/machine-api-operator/blob/main/install/0000_30_machine-api-operator_00_credentials-request.yaml , but I believe that's the AWS service account associated with the `aws-cloud-credential` default secret.

              rh-ee-nbrubake Nolan Brubaker
              joelspeed Joel Speed
              Huali Liu Huali Liu
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: