Skip to content

Apply custom labels to workload cluster nodes #579

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

Closed
rbjorklin opened this issue Feb 20, 2023 · 2 comments
Closed

Apply custom labels to workload cluster nodes #579

rbjorklin opened this issue Feb 20, 2023 · 2 comments

Comments

@rbjorklin
Copy link

rbjorklin commented Feb 20, 2023

/kind feature

Describe the solution you'd like
I would like to be able to apply my own custom labels on nodes in workload clusters. The use case I have in mind is using Project Sveltos Classifiers to apply different Cilium versions depending on which image is used.

Anything else you would like to add:
I've tried this but it doesn't seem to work:

apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: HCloudMachineTemplate
metadata:
  name: rbjorklin-com-control-plane
  namespace: rbjorklin-com
  labels:
    node.kubernetes.io/image: ubuntu-22.04
    environment: hcloud
spec:
  template:
    metadata:
      labels:
        role: control-plane
        node.kubernetes.io/image: ubuntu-22.04
    spec:
      imageName: ubuntu-22.04
      placementGroupName: control-plane
      type: cpx21

Sveltos Classifier:

apiVersion: lib.projectsveltos.io/v1alpha1
kind: Classifier
metadata:
  name: cilium-old
spec:
  classifierLabels:
  - key: cilium
    value: v1-12-2
  deployedResourceConstraints:
  - group: ""
    version: v1
    kind: Node
    minCount: 1
    labelFilters:
    - key: node.kubernetes.io/image
      value: ubuntu-22.04
      operation: Equal

Environment:

  • cluster-api-provider-hetzner version: v1.0.0-beta.14
  • Kubernetes version: 1.25.6
  • OS (e.g. from /etc/os-release):
@batistein
Copy link
Contributor

Does I understand you correct that you want to have a node label in kubernetes generated from the machine object? If yes please have a look to this upstream issue: kubernetes-sigs/cluster-api#7730

@batistein
Copy link
Contributor

closing because this needs an implementation of capi and is not in the responsibility of the provider implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants