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

feat: Add option to provision StorageClasses #697

Merged
merged 1 commit into from
Feb 5, 2021

Conversation

gazal-k
Copy link
Contributor

@gazal-k gazal-k commented Jan 14, 2021

Is this a bug fix or adding new feature?
New feature in the helm chart

What is this PR about? / Why do we need it?
Most application charts don't usually create StorageClasses. They create PVCs.

What testing is done?
Installed the chart with the following custom values:

enableVolumeResizing: true
enableVolumeScheduling: true
enableVolumeSnapshot: true

serviceAccount:
  controller:
    name: ebs-csi-controller
    annotations:
      eks.amazonaws.com/role-arn: arn:aws:iam::123:role/cluster-name-kube-system-ebs-csi-controller
  snapshot:
    create: false
    name: ebs-csi-controller
    annotations:
      eks.amazonaws.com/role-arn: arn:aws:iam::123:role/cluster-name-kube-system-ebs-csi-controller

storageClasses:
- name: ebs-sc
  parameters:
    encrypted: "true"

Then tried creating a PVC and a pod that used it:

---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: ebs-claim
spec:
  storageClassName: ebs-sc
  accessModes:
    - "ReadWriteOnce"
  resources:
    requests:
      storage: 5Gi
---
apiVersion: v1
kind: Pod
metadata:
  name: ebs-app
spec:
  containers:
    - name: app
      image: centos
      command: ["/bin/sh"]
      args: ["-c", "while true; do echo $(date -u) >> /data/out; sleep 5; done"]
      volumeMounts:
        - name: persistent-storage
          mountPath: /data
  volumes:
    - name: persistent-storage
      persistentVolumeClaim:
        claimName: ebs-claim

Verified the following:

PV was provisioned.
New EBS gp3 volume was created as expected.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jan 14, 2021
@k8s-ci-robot
Copy link
Contributor

Welcome @gazal-k!

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
Copy link
Contributor

Hi @gazal-k. 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 needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jan 14, 2021
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jan 14, 2021
@gazal-k
Copy link
Contributor Author

gazal-k commented Jan 14, 2021

Similar to kubernetes-sigs/aws-efs-csi-driver#298

@coveralls
Copy link

coveralls commented Jan 14, 2021

Pull Request Test Coverage Report for Build 1547

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 81.196%

Totals Coverage Status
Change from base Build 1546: 0.0%
Covered Lines: 1697
Relevant Lines: 2090

💛 - Coveralls

@@ -98,3 +98,7 @@ serviceAccount:
create: true
name: ebs-snapshot-controller
annotations: {}

storageClasses: []
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be really nice if we include the options here similar to the efs PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean like an example? I do have an example storage class entry in comments just like the efs PR. Just that ebs doesn't really need much explicit config. I can provide a more detailed entry I suppose.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added reference parameters now. Should we also mention other options like volumeBindingMode & reclaimPolicy?

Copy link
Contributor

@ayberk ayberk Jan 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay here.

Yeah that would be great. Ideally we should note if they're optional and default value if they have one.

@ayberk
Copy link
Contributor

ayberk commented Jan 15, 2021

/ok-to-test

@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 Jan 15, 2021
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 30, 2021
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 31, 2021
@ayberk
Copy link
Contributor

ayberk commented Feb 2, 2021

/lgtm
/approve

thanks!

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Feb 2, 2021
@ayberk
Copy link
Contributor

ayberk commented Feb 2, 2021

/retest

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 2, 2021
@ayberk
Copy link
Contributor

ayberk commented Feb 3, 2021

/retest

@gazal-k
Copy link
Contributor Author

gazal-k commented Feb 3, 2021

I thought rebasing on master would fix the tests 🤦. So, please approve again @ayberk

@ayberk
Copy link
Contributor

ayberk commented Feb 4, 2021

Sorry for the back and forth, but we also need to update the chart version. Looks like I missed it when I was reviewing it. I'd wait for the 0.9.0 PR to be merged and than update the chart version to 0.9.1.

@gazal-k
Copy link
Contributor Author

gazal-k commented Feb 4, 2021

Sorry for the back and forth, but we also need to update the chart version. Looks like I missed it when I was reviewing it. I'd wait for the 0.9.0 PR to be merged and than update the chart version to 0.9.1.

No worries, that's what PRs are all about anyway 🙂. I've bumped it to 0.8.2, so this can go in before 0.9.0 if required. Or else, I'll just rebase & bump the version later

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 4, 2021
Most application charts don't usually create `StorageClass`es. They create PVCs.
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 4, 2021
@ayberk
Copy link
Contributor

ayberk commented Feb 5, 2021

/lgtm
/approve

Thank you!!

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ayberk, gazal-k

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 merged commit deac516 into kubernetes-sigs:master Feb 5, 2021
@gazal-k gazal-k deleted the storage-class branch February 5, 2021 00:55
@gazal-k
Copy link
Contributor Author

gazal-k commented Feb 5, 2021

not sure what happened here. the chart release seems to have failed; https://github.com/kubernetes-sigs/aws-ebs-csi-driver/runs/1835265236. It's trying to publish 0.9.0 again

@ayberk
Copy link
Contributor

ayberk commented Feb 5, 2021

Yeah interesting it's still 0.9.0 on master but in the diff I see it's 0.9.1.

@ayberk
Copy link
Contributor

ayberk commented Feb 5, 2021

Ah we updated the appVersion not the chart version, that's why.

@ayberk ayberk mentioned this pull request Feb 5, 2021
@gazal-k
Copy link
Contributor Author

gazal-k commented Feb 5, 2021

Ah we updated the appVersion not the chart version, that's why.

oops, let me fix that

gazal-k added a commit to gazal-k/aws-ebs-csi-driver that referenced this pull request Feb 5, 2021
@gazal-k
Copy link
Contributor Author

gazal-k commented Feb 5, 2021

@anilkumarpasupuleti @DeVysh @pradeesh-varghese @mfaridk you can start using 0.9.1 of aws-ebs-csi-driver from https://kubernetes-sigs.github.io/aws-ebs-csi-driver instead of the custom version which includes this change

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.

None yet

4 participants