Skip to content

Conversation

@supershal
Copy link
Contributor

What problem does this PR solve?:
NOTE: This PR stacked on CAPA fork upgrade PR #1360 . once this is merged, I will rebase it.

  • Automatically label nodes with placement group and partition id using node feature discovery local feature

  • When user provides existing placement group when creating AWS or EKS cluster, A NFD source script will be dropped in /etc/kubernetes/node-feature-discovery/source.d/placementgroup_discovery.sh on the node using cloud-init.

Cloud-init then executes this script during node initialization. which will eventually create a file with feature labels in /etc/kubernetes/node-feature-discovery/features.d/placementgroup

NFD Daemon on each node will read this file to set/remove labels on the Node object.

Applications can use this information to make node aware scheduling decisions.

Which issue(s) this PR fixes:
Fixes #

How Has This Been Tested?:

Currently tested manually and with unit tests. We will add e2e tests support for EKS.

  • cluster.yaml
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
  annotations:
    preflight.cluster.caren.nutanix.com/skip: all
  labels:
    cluster.x-k8s.io/provider: eks
  name: shalin-eks
spec:
  topology:
    class: eks-quick-start
    controlPlane:
      metadata:
        annotations:
          controlplane.cluster.x-k8s.io/skip-kube-proxy: ""
    variables:
    - name: clusterConfig
      value:
        addons:
          clusterAutoscaler: {}
          cni:
            provider: Cilium
          csi:
            defaultStorage:
              provider: aws-ebs
              storageClassConfig: default
            providers:
              aws-ebs:
                storageClassConfigs:
                  default: {}
            snapshotController: {}
          nfd: {}
        kubeProxy:
            mode: disabled
        eks:
          region: us-west-2
    version: v1.34.1
    workers:
      machineDeployments:
      - class: default-worker
        metadata:
          annotations:
            cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size: "1"
            cluster.x-k8s.io/cluster-api-autoscaler-node-group-min-size: "1"
        name: md-0
        variables:
          overrides:
          - name: workerConfig
            value:
              eks:
                instanceType: m5.2xlarge
                placementGroup:
                  name: eks-cn-aos
  • Inspect labels on the nodes
> kubectl get nodes --kubeconfig shalin-eks.conf -o yaml | grep placement
feature.node.kubernetes.io/aws-placement-group: eks-cn-aos

> kubectl get nodes --kubeconfig shalin-eks.conf -o yaml | grep partition
 feature.node.kubernetes.io/partition: "1"

Special notes for your reviewer:

@supershal supershal self-assigned this Oct 23, 2025
@supershal supershal force-pushed the shalin/nfd-placement-groups branch from 048606d to 2e1c523 Compare October 23, 2025 04:11
Base automatically changed from shalin/update-capa to main October 23, 2025 15:08
@github-actions github-actions bot added feature and removed feature labels Oct 23, 2025
Copy link
Contributor

@dkoshkin dkoshkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just minor comments, but really liking the use of NFD here!

@supershal supershal force-pushed the shalin/nfd-placement-groups branch from 2e1c523 to 4868ee0 Compare October 24, 2025 17:55
@supershal supershal force-pushed the shalin/nfd-placement-groups branch from 4868ee0 to 6e5787a Compare October 24, 2025 18:46
@supershal supershal merged commit b9bb371 into main Oct 29, 2025
37 of 38 checks passed
@supershal supershal deleted the shalin/nfd-placement-groups branch October 29, 2025 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants