Skip to content

Support global.nodeSelector in the Helm chart #7817

@StingRayZA

Description

@StingRayZA

Feature Request: Support global.nodeSelector in the Helm chart to reduce configuration duplication

Is this a BUG REPORT or FEATURE REQUEST?: FEATURE REQUEST

Description:

Currently, the cert-manager Helm chart requires the nodeSelector to be specified individually for each component that creates pods (controller, cainjector, webhook, startupapicheck).

In many common scenarios, users want all cert-manager components to be scheduled on the same set of nodes (e.g., nodes dedicated to "cluster-services" or infrastructure workloads). To achieve this today, the user must duplicate the nodeSelector configuration across multiple sections in their values.yaml file.

This leads to a configuration that is not DRY (Don't Repeat Yourself), is more verbose than necessary, and increases the chance of error if a user forgets to update the selector for one of the components.

Example of current duplicated configuration:

# values.yaml
#
# To schedule all components on a specific node pool, one must currently do this:
nodeSelector:
  workload: "cluster-services"

cainjector:
  nodeSelector:
    workload: "cluster-services"

webhook:
  nodeSelector:
    workload: "cluster-services"
    
startupapicheck:
  nodeSelector:
    workload: "cluster-services"

Proposed Solution:

I propose adding a new global.nodeSelector value to the Helm chart.

This global value would serve as a fallback. The scheduling logic for each component's pods should be:

  1. If a component-specific nodeSelector is defined (e.g., webhook.nodeSelector), use it. This preserves the ability to schedule components differently if needed.
  2. If a component-specific nodeSelector is not defined, use the global.nodeSelector if it is defined.
  3. If neither is defined, do not add a nodeSelector to the pod spec (current default behavior).

PR

I'm happy to work on this and will submit a PR shortly

/kind feature

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions