-
Notifications
You must be signed in to change notification settings - Fork 814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow customization of aws-secret name and keys in Helm Chart #1668
Conversation
|
Welcome @AndrewSirenko! |
Hi @AndrewSirenko. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/ok-to-test |
/lgtm |
docs/install.md
Outdated
@@ -31,7 +31,7 @@ There are several methods to grant the driver IAM permissions: | |||
* Using IAM [instance profile](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2_instance-profiles.html) - attach the policy to the instance profile IAM role and turn on access to [instance metadata](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html) for the instance(s) on which the driver Deployment will run | |||
* EKS only: Using [IAM roles for ServiceAccounts](https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html) - create an IAM role, attach the policy to it, then follow the IRSA documentation to associate the IAM role with the driver Deployment service account, which if you are installing via Helm is determined by value `controller.serviceAccount.name`, `ebs-csi-controller-sa` by default. If you are using k8s 1.24 or higher, the ServiceAccountToken is not mounted because the `LegacyServiceAccountTokenNoAutoGeneration` feature gate is enabled. | |||
Therefore, if you are using k8s 1.24 or higher, you need to set `true` to `controller.serviceAccount.autoMountServiceAccountToken`. | |||
* Using secret object - create an IAM user, attach the policy to it, then create a generic secret called `aws-secret` in the `kube-system` namespace with the user's credentials | |||
* Using secret object - create an IAM user, attach the policy to it, then create a generic secret in the `kube-system` namespace with the user's credentials. The snippet below creates the generic secret named `aws-secret` that the driver accepts by default. You can customize this default name via Helm by setting `Value.awsAccessSecret.name` to a custom secret name. Additionally, you may use an existing secret with an AWS access key by configuring `Value.awsAccessSecret.name` with the name of your existing secret, `Value.awsAccessSecret.keyId` with the key of the AWS_ACCESS_KEY_ID, and `Value.awsAccessSecret.accessKey` with the key of the AWS_SECRET_ACCESS_KEY. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
configuring Value.awsAccessSecret.name
-> configuring the Helm parameter awsAccessSecret.name
Value.awsAccessSecret.keyId
-> awsAccessSecret.keyId
Value.awsAccessSecret.accessKey
-> awsAccessSecret.accessKey
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @AndrewSirenko /lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: torredil The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Is this a bug fix or adding new feature?
Feature
What is this PR about? / Why do we need it?
Closes #1492; supersedes #1571
Currently, users that grant the driver IAM permissions with a secret object are only allowed to use the secret name
aws-secret
, and key nameskey_id
andaccess_key
due to charts/aws-ebs-csi-driver/templates/controller.yaml not templating those parameters.This PR would allow users to customize their secret and key names via the helm parameters
awsAccessSecret.name
,awsAccessSecret.keyId
, andawsAccessSecret.accessKey
in this PR's values.yaml.What testing is done?
Granted CSI-driver IAM permissions using a secret object with custom secret, Key ID, and Access Key names. Manually installed CSI-Driver via helm with changed default values, leading to the following CSI Driver controller deployment description (see screenshot).