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

Allow setting extra, non-selector labels on pods #1237

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

den-is
Copy link

@den-is den-is commented Jan 5, 2024

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.

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

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. 😃

@k8s-ci-robot
Copy link
Contributor

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 k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 5, 2024
@den-is
Copy link
Author

den-is commented Jan 16, 2024

This PR is also a duplicate of #926
But IMHO mine is a little bit smarter, with a better description.

@mskanth972
Copy link
Contributor

/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 16, 2024
@mskanth972
Copy link
Contributor

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.

@den-is
Copy link
Author

den-is commented Jan 17, 2024

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.

@mskanth972
Copy link
Contributor

can you please squash the commits to one

@den-is
Copy link
Author

den-is commented Jan 17, 2024

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

@den-is
Copy link
Author

den-is commented Jan 17, 2024

@mskanth972 Done.

@csapinoso
Copy link

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

@k8s-ci-robot
Copy link
Contributor

[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 k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 17, 2024
Signed-off-by: Denis Iskandarov <[email protected]>

revert chart version bump

Signed-off-by: Denis Iskandarov <[email protected]>
@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 17, 2024
@den-is
Copy link
Author

den-is commented Feb 17, 2024

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

@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 Mar 21, 2024
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 24, 2024
@k8s-ci-robot
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants