kops icon indicating copy to clipboard operation
kops copied to clipboard

Propagate IG NodeLabels to k8s nodes in Hetzner

Open rifelpet opened this issue 1 year ago • 5 comments

Fixes https://github.com/kubernetes/kops/issues/16159

This adds Hetzner server labels for the instance group nodeLabels. kops-controller then recognizes these server labels and sets them on the associated k8s node.

I'm marking this WIP as we may need to change this approach due to label length limits in the Hetzner API:

https://docs.hetzner.com/cloud/servers/getting-started/creating-a-server/

Both key and value must be 63 characters or less, beginning and ending with an alphanumeric character and alphanumerics can be used inbetween

The Hetzner CCM mentions support for the node.kubernetes.io/exclude-from-external-load-balancers label included in the integration test output changes: https://github.com/hetznercloud/hcloud-cloud-controller-manager/issues/182#issuecomment-830577642 which is 55 characters on its own, so with the prefix I've added it exceeds the length limit. I considered storing these elsewhere like in userdata and having kops-controller parse them out of the hcloud.Server's userdata, except hcloud doesn't expose userdata in read operations, it is a write-only field.

Therefore I think our only option is to use a shorter prefix

/wip

rifelpet avatar Aug 07 '24 03:08 rifelpet

/cc @hakman any thoughts on how to best approach the length limit issue?

rifelpet avatar Aug 07 '24 03:08 rifelpet

/test all

hakman avatar Aug 23 '24 17:08 hakman

/test all

hakman avatar Sep 14 '24 07:09 hakman

/retest

rifelpet avatar Sep 14 '24 13:09 rifelpet

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Dec 13 '24 14:12 k8s-triage-robot

/test all

hakman avatar Dec 13 '24 15:12 hakman

/retest

hakman avatar Dec 13 '24 18:12 hakman

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hakman

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

The pull request process is described here

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 avatar Jan 06 '25 20:01 k8s-ci-robot