Skip to content

[suggestion] Allow to add new labels to the node #363

Description

@cmoulliard

Suggestion

The kind go project allows to set additonal labels to a node using the type field

// https://github.com/kubernetes-sigs/kind/blob/296749aa2de8577f6865e4db1870d2566a28d14b/pkg/apis/config/v1alpha4/types.go#L108

// Labels are the labels with which the respective node will be labeled
Labels map[string]string `yaml:"labels,omitempty" json:"labels,omitempty"`

that a user can define par of the kube config file

kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
  image: "kindest/node:v1.31.4"
  labels:
    ingress-ready: "true"
  extraPortMappings:
  - containerPort: 443
    hostPort: 8443
    protocol: TCP
...

that the kind go project will render in the template using the field

// https://github.com/kubernetes-sigs/kind/blob/f96632a3c84686f5cf322e1d5f0201b02ca324e9/pkg/cluster/internal/kubeadm/config.go#L243-L248
  kubeletExtraArgs:
    node-ip: "{{ .NodeAddress }}"
    provider-id: "kind://{{.NodeProvider}}/{{.ClusterName}}/{{.NodeName}}"
    node-labels: "{{ .NodeLabels }}"

Such a feature is not supported by this project and is blocking by example the deployment of the ingress controller where a new label has been declared part of the nodeSelector section

// https://github.com/kubernetes/ingress-nginx/blob/main/deploy/static/provider/kind/deploy.yaml#L508
 nodeSelector:
    ingress-ready: "true"
    kubernetes.io/os: linux

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions