Skip to content

Conversation

@hdp617
Copy link

@hdp617 hdp617 commented Dec 18, 2025

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespaces from that line:

/kind api-change
/kind bug
/kind cleanup
/kind design
/kind documentation
/kind failing-test
/kind feature
/kind flake

/kind feature

What this PR does / why we need it:
This PR introduces a new component gce-pd-node-labeler. It's a controller implemented with controller-runtime, which automatically labels Nodes with PD labels. The source of truth is a ConfigMap that can be configured with --configmap-name and --configmap-namespace flags.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:
Sharing for early reviews. I'll look into kustomize next.

Re. testing, I've verified with a k8s-on-gce cluster with 2 gen2 nodes and 2 gen4 nodes:

kubectl get nodes -L node.kubernetes.io/instance-type
NAME                               STATUS   ROLES           AGE     VERSION   INSTANCE-TYPE
control-plane-us-central1-a-xp2s   Ready    control-plane   7h18m   v1.33.6   e2-medium
nodes-gen2-6vfp                    Ready    node            7h10m   v1.33.6   n2-standard-4
nodes-gen2-dshk                    Ready    node            7h6m    v1.33.6   n2-standard-4
nodes-gen4-g4z2                    Ready    node            7h1m    v1.33.6   n4-standard-4
nodes-gen4-l17x                    Ready    node            6h57m   v1.33.6   n4-standard-4

Add a configmap (not actually SoT):

apiVersion: v1
kind: ConfigMap
metadata:
  name: machine-pd-compatibility
  namespace: gce-pd-csi-driver
data:
  machine-pd-compatibility.json: |-
    {
      "n2": {
        "pd-standard": true
      },
      "n4": {
        "hyperdisk-balanced": true,
      },
    }

Build the container image and add this component as a sidecar in the csi-gce-pd-controller:

      - args:
        - --v=5
        - --configmap-name=machine-pd-compatibility
        - --configmap-namespace=gce-pd-csi-driver
        image: us-central1-docker.pkg.dev/<PROJECT_ID>/gce-pd-node-labeler/gce-pd-node-labeler:test_linux_amd64
        imagePullPolicy: Always
        name: gce-pd-node-labeler
        resources:
          requests:
            cpu: 10m
            memory: 20Mi
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File

And verify that the labels are added.

Does this PR introduce a user-facing change?:

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Dec 18, 2025
@k8s-ci-robot
Copy link
Contributor

Welcome @hdp617!

It looks like this is your first PR to kubernetes-sigs/gcp-compute-persistent-disk-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/gcp-compute-persistent-disk-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

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

The full list of commands accepted by this bot can be found here.

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

Hi @hdp617. Thanks for your PR.

I'm waiting for a github.com 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.

Details

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-sigs/prow 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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Dec 18, 2025
@hdp617 hdp617 marked this pull request as ready for review December 18, 2025 17:19
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 18, 2025
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. kind/feature Categorizes issue or PR as related to a new feature. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants