Skip to content
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

Add support for securityContext in controller #1112

Conversation

phantasm66
Copy link
Contributor

Is this a bug fix or adding new feature?
Bug fix for EKS kubernetes versions below 1.19.

What is this PR about? / Why do we need it?
Your compatibility matrix says that appVersion 1.2.1 of the Helm Chart supports Kubernetes versions 1.17 and above. In EKS this does not seem to be the case.

We are running appVersion 1.2.1 of the aws-ebs-csi-driver on EKS Kubernetes v1.18 and encountered the following error when the controller attempted to mount an EBS volume:

error listing AWS instances: "WebIdentityErr: failed fetching WebIdentity token: \ncaused by: WebIdentityErr: unable to read file at /var/run/secrets/eks.amazonaws.com/serviceaccount/token\ncaused by: open /var/run/secrets/eks.amazonaws.com/serviceaccount/token: permission denied"

This seems expected based on the AWS EKS doc I linked above, so we manually added the following to our controller Deployment live manifest and relaunched the controller pods:

controller:
  securityContext:
    fsGroup: 65534

Which immediately resulted in the EBS volume being successfully mounted:

  Normal  Provisioning           2m38s                  ebs.csi.aws.com_ebs-csi-controller-7b97794f89-kmhvx_c175a4ba-04a7-4508-a727-fb727d13bd58  External provisioner is provisioning volume for claim "workflow-engine/data-staging-green-zeebe-0"
  Normal  ProvisioningSucceeded  2m33s                  ebs.csi.aws.com_ebs-csi-controller-7b97794f89-kmhvx_c175a4ba-04a7-4508-a727-fb727d13bd58  Successfully provisioned volume pvc-37b7bc12-95af-4420-8f7d-a0bb2f026adc

What testing is done?
I ran through your make verify, make test and make test-integration but they all failed with ERROR: vendor check failed, which is not a directory I touched for this PR.

@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please sign in with your organization's credentials at https://identity.linuxfoundation.org/projects/cncf to be authorized.
  • If you have done the above and are still having issues with the CLA being reported as unsigned, please log a ticket with the Linux Foundation Helpdesk: https://support.linuxfoundation.org/
  • Should you encounter any issues with the Linux Foundation Helpdesk, send a message to the backup e-mail support address at: [email protected]

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. I understand the commands that are listed here.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Nov 15, 2021

CLA Signed

The committers are authorized under a signed CLA.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Nov 15, 2021
@k8s-ci-robot
Copy link
Contributor

Welcome @phantasm66!

It looks like this is your first PR to kubernetes-sigs/aws-ebs-csi-driver 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/aws-ebs-csi-driver has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Nov 15, 2021
@k8s-ci-robot
Copy link
Contributor

Hi @phantasm66. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Nov 15, 2021
@phantasm66
Copy link
Contributor Author

Not sure why the linux foundation CLA is still showing as incomplete. I completed the individual signup last night:

Authorized Accounts: Linux Foundation ID "phantasm66"
GitHub https://github.com/phantasm66

(From the signed PDF)

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Nov 16, 2021
@phantasm66
Copy link
Contributor Author

Hey there @ayberk @leakingtapan sorry for the at-mentions! I was hoping to get some eyes in this, if possible... Thanks!

@ayberk
Copy link
Contributor

ayberk commented Nov 23, 2021

/ok-to-test

This LGTM, but you might need to update the chart minor version.

I'll leave the approval to @wongma7 @AndyXiangLi.

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 23, 2021
@phantasm66
Copy link
Contributor Author

phantasm66 commented Nov 23, 2021

you might need to update the chart minor version.

I saw this as a bug fix (for EKS, specifically) so I bumped the patch version in the CHANGELOG.md and Chart.yaml, but I'm happy to change that view if others think differently.

charts/aws-ebs-csi-driver/templates/controller.yaml Outdated Show resolved Hide resolved
charts/aws-ebs-csi-driver/Chart.yaml Outdated Show resolved Hide resolved
@phantasm66
Copy link
Contributor Author

/assign @AndyXiangLi

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 30, 2021
@phantasm66 phantasm66 force-pushed the add-controller-security-context-support branch from aa684dc to a395239 Compare November 30, 2021 17:09
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 30, 2021
@phantasm66
Copy link
Contributor Author

Rebased.. friendly ping again to: @AndyXiangLi 😄

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 8, 2021
@phantasm66 phantasm66 force-pushed the add-controller-security-context-support branch from a395239 to e9f80cf Compare December 8, 2021 18:19
@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Dec 8, 2021
@phantasm66
Copy link
Contributor Author

I’ll rebase this again, but can someone authorized to approve this please do so?

@krmichel
Copy link
Contributor

@phantasm66 when you rebase will you please fix the version in the changelog. @ayberk or @wongma7 will one of you take a quick look at this after the rebase is done?

@phantasm66 phantasm66 force-pushed the add-controller-security-context-support branch from 0e6101e to 0aabbbe Compare December 14, 2021 17:28
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 14, 2021
@phantasm66
Copy link
Contributor Author

when you rebase will you please fix the version in the changelog. @ayberk or @wongma7 will one of you take a quick look at this after the rebase is done?

I've rebased and bumped the Chart and appVersion's appropriately 👍

@ayberk
Copy link
Contributor

ayberk commented Dec 16, 2021

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 16, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ayberk, krmichel, phantasm66

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 16, 2021
@k8s-ci-robot k8s-ci-robot merged commit 705b545 into kubernetes-sigs:master Dec 16, 2021
@gtxu
Copy link
Contributor

gtxu commented Dec 16, 2021

Hi @phantasm66 , there's no release v1.6.0 for now, can you bump up the chart version v2.5.1 and keeps the app version v1.5.0?

@phantasm66
Copy link
Contributor Author

phantasm66 commented Dec 16, 2021

Hi @phantasm66 , there's no release v1.6.0 for now, can you bump up the chart version v2.5.1 and keeps the app version v1.5.0?

@gtxu this was already merged.

@phantasm66
Copy link
Contributor Author

@gtxu How do you want to proceed? Do you want to revert the merge that @ayberk initiated and then I'll bump the versions down and you can re-approve/merge? I was originally told that this was adding new functionality and that the minor version should be bumped, not the patch version - which is why I went to 2.6.0 for the chart version (and it appears that the pattern for appVersion is 1 major less than whatever the chart version is, so 1.6.0).

I'm happy to do whatever you need me to do, but I've received conflicting info on how y'all want contributors to set versions.

@krmichel
Copy link
Contributor

krmichel commented Dec 16, 2021

2.6.0 was the correct chart version. The appVersion isn't tied to the chart version. I didn't catch that the last commit bumped the appVersion bump in this PR. PR #1145 has been created to fix the appVersion.

@gtxu
Copy link
Contributor

gtxu commented Dec 16, 2021

Hi @phantasm66 , No action needed for this now. It is fine to bump up chart version, but the appVersion need co-respond releasing and image publish, so the appVersion won't bump up with chart version usually.

@phantasm66
Copy link
Contributor Author

2.6.0 was the correct chart version. The appVersion isn't tied to the chart version. I didn't catch that the last commit bumped the appVersion bump in this PR. PR #1145 has been created to fix the appVersion.

Gotcha. Sorry about that. Thanks for opening that other PR to fix the versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants