aws-efs-csi-driver icon indicating copy to clipboard operation
aws-efs-csi-driver copied to clipboard

Allow setting extra, non-selector labels on pods

Open den-is opened this issue 1 year ago • 13 comments

Is this a bug fix or adding new feature? New minor feature.

What is this PR about? / Why do we need it? My recent deployment of efs-csi-driver in k8s cluster required me to set special labels on pods. I was not able to do that using official chart. So here is my PR. Proposed changes do not interfere with or alter existing deployments.

What testing is done? test values.yaml

controller:
  podLabels:
    controllerlabel: "true"
node:
  podLabels:
    nodelabel: "true"

Render chart:

helm template efs-csi-driver ./src/charts/aws-efs-csi-driver -f ./test-values.yaml --dry-run --debug

Output:

# omitted
---
kind: DaemonSet
apiVersion: apps/v1
metadata:
  name: efs-csi-node
  labels:
    app.kubernetes.io/name: aws-efs-csi-driver
spec:
  selector:
    matchLabels:
      app: efs-csi-node
      app.kubernetes.io/name: aws-efs-csi-driver
      app.kubernetes.io/instance: efs-csi-driver
  template:
    metadata:
      labels:
        app: efs-csi-node
        app.kubernetes.io/name: aws-efs-csi-driver
        app.kubernetes.io/instance: efs-csi-driver
        nodelabel: "true"
# omitted
---
kind: Deployment
apiVersion: apps/v1
metadata:
  name: efs-csi-controller
  labels:
    app.kubernetes.io/name: aws-efs-csi-driver
spec:
  replicas: 2
  selector:
    matchLabels:
      app: efs-csi-controller
      app.kubernetes.io/name: aws-efs-csi-driver
      app.kubernetes.io/instance: efs-csi-driver
  template:
    metadata:
      labels:
        app: efs-csi-controller
        app.kubernetes.io/name: aws-efs-csi-driver
        app.kubernetes.io/instance: efs-csi-driver
        controllerlabel: "true"
# omitted

Skipping setting additional pod labels, renders templates just fine.

den-is avatar Jan 05 '24 12:01 den-is

Welcome @den-is!

It looks like this is your first PR to kubernetes-sigs/aws-efs-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-efs-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. :smiley:

k8s-ci-robot avatar Jan 05 '24 12:01 k8s-ci-robot

Hi @den-is. 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 avatar Jan 05 '24 12:01 k8s-ci-robot

This PR is also a duplicate of https://github.com/kubernetes-sigs/aws-efs-csi-driver/pull/926 But IMHO mine is a little bit smarter, with a better description.

den-is avatar Jan 16 '24 15:01 den-is

/ok-to-test

mskanth972 avatar Jan 16 '24 20:01 mskanth972

Hi @den-is thanks for the PR. Could you please exclude the Helm version update from chart.yaml? We prefer to handle version changes in the release PRs.

mskanth972 avatar Jan 16 '24 20:01 mskanth972

Hi @den-is thanks for the PR. Could you please exclude the Helm version update from chart.yaml? We prefer to handle version changes in the release PRs.

@mskanth972 Sure! Done.

den-is avatar Jan 17 '24 07:01 den-is

can you please squash the commits to one

mskanth972 avatar Jan 17 '24 14:01 mskanth972

@mskanth972 but GitHub merge PR has the option to merge commits on merge, is not it? np. will do.

den-is avatar Jan 17 '24 14:01 den-is

@mskanth972 Done.

den-is avatar Jan 17 '24 14:01 den-is

can we get this reviewed and merged please? we really need the ability to add pod labels. This is seems pretty straightforward

csapinoso avatar Feb 13 '24 18:02 csapinoso

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: den-is, RyanStan Once this PR has been reviewed and has the lgtm label, please assign justinsb for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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 avatar Feb 16 '24 18:02 k8s-ci-robot

I hope someone finally approves this PR.

After update/rebase

  • PR remains concise
  • adds clear default configuration to values.yaml - podLabels for the controller which were missed by the previous author.
  • adds missing podLabels to node-daemonset

den-is avatar Feb 17 '24 13:02 den-is

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.

k8s-ci-robot avatar Apr 24 '24 05:04 k8s-ci-robot