aws-efs-csi-driver
aws-efs-csi-driver copied to clipboard
Add Ability to Set Tags on StorageClass, Expand Range of Characters Supported in Tags
Is this a bug fix or adding new feature? This allows users to set tags on the StorageClass so they can have more granular tagging for their accessPoints should they desire, this addresses the feature requested in #692. In doing so the parsing of tags has been expanded to include characters like ':' and ' ' and so addresses #613 as well. It doesn't go quite as far as the issue suggests (i.e. aligning with the EBS driver on a standard) but it allows tags to have ':' and ' ' in them with a modicum of effort on the part of the user. That being said if we did decide in future we wanted to align and both use "=" and the key/value separator and "," as the tag separator because they're pulled out into constants that would not be very difficult.
What is this PR about? / Why do we need it? This PR allows users to specify tags on StorageClasses and further, where tags could be specified previously, they can now include spaces, and colons as well as all the other special characters dictated by the AWS standard: https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html and https://docs.aws.amazon.com/efs/latest/ug/manage-fs-tags.html
What testing is done? I have added extra Unit tests to cover this behaviour. If it needs extra E2E tests adding please let me know
fixes #613
Hi @jonathanrainer. 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.
I have End-To-End tested this myself in an EKS cluster. Installed the driver with the following helm overrides
controller:
tags:
environment: prod
region: us-east-1
"'I have spaces'": "'and:I:have:colons'"
Then created a StorageClass to facilitate dynamic provisioning like so:
allowVolumeExpansion: true
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
creationTimestamp: "2022-06-12T08:40:57Z"
labels:
provisioning-type: dynamic
name: efs-dynamic
resourceVersion: "13482"
uid: eb329bc4-8a69-4a02-b523-3648cdb7ec67
parameters:
basePath: /dynamic
directoryPerms: "777"
extraTags: SCTag:'Look at the spaces'
fileSystemId: fs-0a2f099fa92ff360d
gidRangeEnd: "2000"
gidRangeStart: "1000"
provisioningMode: efs-ap
provisioner: efs.csi.aws.com
reclaimPolicy: Delete
volumeBindingMode: Immediate
Created a PVC in the cluster to kickoff dynamic provisioning and it created an Access Point with the following tags:
Then tweaked the Chart Overrides:
controller:
tags:
environment: prod
region: us-east-1
"'I have spaces'": "'and:I:have:colons'"
OverrideMe: foo
And the StorageClass to show the overriding behaviour:
allowVolumeExpansion: true
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
creationTimestamp: "2022-06-12T08:40:57Z"
labels:
provisioning-type: dynamic
name: efs-dynamic
resourceVersion: "13482"
uid: eb329bc4-8a69-4a02-b523-3648cdb7ec67
parameters:
basePath: /dynamic
directoryPerms: "777"
extraTags: SCTag:'Look at the spaces' OverrideMe:bar
fileSystemId: fs-0a2f099fa92ff360d
gidRangeEnd: "2000"
gidRangeStart: "1000"
provisioningMode: efs-ap
provisioner: efs.csi.aws.com
reclaimPolicy: Delete
volumeBindingMode: Immediate
And then got the following tags in AWS:
So very happy to say that this works exactly as expected, you can pass tags with spaces and colons through the values.yaml
, which resolves #613, or you can have them on a per-StorageClass basis, with the more specific StorageClass tags overriding the more general tags defined on the Controller, which addresses part of #692.
Before fixing the conflicts, will this PR support the below functionality like the ebs storage class has?
ebs storageclass can auto add the tags like this: parameters: tagSpecification_1: "pvc_namespace={{ .PVCNamespace }}" tagSpecification_2: "pvc_service={{ .PVCService }}" tagSpecification_3: "pvc_name={{ .PVCName }}" tagSpecification_4: "pv_name={{ .PVName }}"
would efs storageclass allow it as well like this? parameters: extraTags: "pvc_namespace={{ .PVCNamespace }} pvc_service={{ .PVCService }} pvc_name={{ .PVCName }} pv_name={{ .PVName }}
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: jonathanrainer
Once this PR has been reviewed and has the lgtm label, please assign d-nishi for approval by writing /assign @d-nishi
in a comment. For more information see:The Kubernetes Code Review Process.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve
in a comment
Approvers can cancel approval by writing /approve cancel
in a comment
@Ben-Mark I'm not sure that the functionality described is the best fit for this PR, but I think #689 does what you want?
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/stale
is applied - After 30d of inactivity since
lifecycle/stale
was applied,lifecycle/rotten
is applied - After 30d of inactivity since
lifecycle/rotten
was applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle stale
- Mark this issue or PR as rotten with
/lifecycle rotten
- Close this issue or PR with
/close
- Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/stale
is applied - After 30d of inactivity since
lifecycle/stale
was applied,lifecycle/rotten
is applied - After 30d of inactivity since
lifecycle/rotten
was applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle rotten
- Close this issue or PR with
/close
- Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten
/remove-lifecycle rotten
@Ashley-wenyizha Could we get an ok to test here as well?
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: jonathanrainer Once this PR has been reviewed and has the lgtm label, please assign d-nishi for approval. For more information see the Kubernetes Code Review Process.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve
in a comment
Approvers can cancel approval by writing /approve cancel
in a comment
PR needs rebase.
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.
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.
This bot triages PRs according to the following rules:
- After 90d of inactivity,
lifecycle/stale
is applied - After 30d of inactivity since
lifecycle/stale
was applied,lifecycle/rotten
is applied - After 30d of inactivity since
lifecycle/rotten
was applied, the PR is closed
You can:
- Mark this PR as fresh with
/remove-lifecycle stale
- Close this PR with
/close
- Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs.
This bot triages PRs according to the following rules:
- After 90d of inactivity,
lifecycle/stale
is applied - After 30d of inactivity since
lifecycle/stale
was applied,lifecycle/rotten
is applied - After 30d of inactivity since
lifecycle/rotten
was applied, the PR is closed
You can:
- Mark this PR as fresh with
/remove-lifecycle rotten
- Close this PR with
/close
- Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages PRs according to the following rules:
- After 90d of inactivity,
lifecycle/stale
is applied - After 30d of inactivity since
lifecycle/stale
was applied,lifecycle/rotten
is applied - After 30d of inactivity since
lifecycle/rotten
was applied, the PR is closed
You can:
- Reopen this PR with
/reopen
- Mark this PR as fresh with
/remove-lifecycle rotten
- Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/close
@k8s-triage-robot: Closed this PR.
In response to this:
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages PRs according to the following rules:
- After 90d of inactivity,
lifecycle/stale
is applied- After 30d of inactivity since
lifecycle/stale
was applied,lifecycle/rotten
is applied- After 30d of inactivity since
lifecycle/rotten
was applied, the PR is closedYou can:
- Reopen this PR with
/reopen
- Mark this PR as fresh with
/remove-lifecycle rotten
- Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/close
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.