Skip to content

✨ Step 2: support upstream hcloud-ccm secret/key conventions - #1703

Closed
guettli wants to merge 287 commits into
tg/support-provider-id-format-of-upstream-ccm-step1from
tg/support-provider-id-format-of-upstream-ccm
Closed

guettli wants to merge 287 commits into
tg/support-provider-id-format-of-upstream-ccm-step1from
tg/support-provider-id-format-of-upstream-ccm

Conversation

@guettli

@guettli guettli commented Nov 3, 2025 •

Copy link
Copy Markdown
Contributor

New PR:

🌱 Step 2: support upstream hcloud-ccm secret/key conventions (II) by guettli · Pull Request #1920 · syself/cluster-api-provider-hetzner

Old:

Previous PR: 🌱 Support upstream providerId format (Step1) #1850

Next PR: 🌱 Set v1.1.x to main branch, and release. #1781

This PR is step 2 of the work to support the upstream hcloud CCM for bare-metal clusters.

The core ProviderID migration work was moved to #1850. The refactor-only helper rename now lives in #1914.

This PR contains the follow-up changes that make the upstream CCM easier to use in practice.

Changes

  • mirror the HCloud token in the workload-cluster secret under both token and hcloud, in addition to the configured key, so both CCM variants can read it
  • if spec.hetznerSecret.name is not hcloud, create an additional workload-cluster secret named hcloud for upstream compatibility
  • update API comments and generated CRD docs to describe the upstream-compatible secret naming/key behavior
  • keep recommending upstream defaults such as secret name hcloud, token key token, and Robot keys robot-user / robot-password
  • add a note entry to the workload-cluster secret to make it obvious that CAPH reconciles it

@github-actions github-actions Bot added size/M Denotes a PR that changes 50-200 lines, ignoring generated files. area/code Changes made in the code directory area/api Changes made in the api directory labels Nov 3, 2025
Copilot AI added a commit that referenced this pull request Nov 3, 2025
Co-authored-by: guettli <414336+guettli@users.noreply.github.com>
@github-actions github-actions Bot added size/S Denotes a PR that changes 20-50 lines, ignoring generated files. size/M Denotes a PR that changes 50-200 lines, ignoring generated files. and removed size/M Denotes a PR that changes 50-200 lines, ignoring generated files. size/S Denotes a PR that changes 20-50 lines, ignoring generated files. labels Nov 3, 2025
@guettli
guettli requested a review from janiskemper November 4, 2025 16:51
@github-actions github-actions Bot added size/L Denotes a PR that changes 200-800 lines, ignoring generated files. area/hack Changes made in the hack directory and removed size/M Denotes a PR that changes 50-200 lines, ignoring generated files. labels Nov 4, 2025
Comment thread api/v1beta1/types.go Resolved
Comment thread api/v1beta1/types.go Resolved
@guettli
guettli requested a review from janiskemper November 24, 2025 08:23
@github-actions github-actions Bot added the area/test Changes made in the test directory label Nov 24, 2025
@guettli
guettli changed the base branch from main to v1.1.x December 5, 2025 09:14
@github-actions github-actions Bot removed the size/M Denotes a PR that changes 50-200 lines, ignoring generated files. label Mar 30, 2026
@guettli guettli changed the title ✨ Support upstream providerID. Step2: Support upstream hcloud-ccm secret/key conventions ✨ Support upstream hcloud-ccm (Step 2): Support upstream hcloud-ccm secret/key conventions Mar 30, 2026
@guettli guettli changed the title ✨ Support upstream hcloud-ccm (Step 2): Support upstream hcloud-ccm secret/key conventions ✨ Step 2: support upstream hcloud-ccm secret/key conventions Mar 30, 2026
@guettli
guettli requested a review from janiskemper March 30, 2026 13:30
Comment thread api/v1beta1/types.go Outdated
// Need to specify either HCloudToken or both HetznerRobotUser and HetznerRobotPassword.
type HetznerSecretKeyRef struct {
// HCloudToken defines the name of the key where the token for the Hetzner Cloud API is stored.
// We recommend to use "token", because this is the default of upstream hcloud-ccm, while the

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@guettli I wouldn't change the default here.

Comment thread api/v1beta1/types.go Outdated
type HetznerSecretKeyRef struct {
// HCloudToken defines the name of the key where the token for the Hetzner Cloud API is stored.
// We recommend to use "token", because this is the default of upstream hcloud-ccm, while the
// legacy Syself ccm fork uses "hcloud". For maximal compatibility up to three keys get created in the

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the current Syself CCM does NOT use the default that we set here?! I would expect this to be the case. If it is, I would leave the default and only create the one the upstream CCM expects.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@janiskemper yes, strange but true. The ccm itself (Go code) does not read K8s secret. It is up to the deployment to either set env-vars or a file. They key our ccm uses is "hcloud".

Comment thread api/v1beta1/types.go
HCloudToken string `json:"hcloudToken"`
// HetznerRobotUser defines the name of the key where the username for the Hetzner Robot API is stored.

// HetznerRobotUser defines the name of the key where the username for the Hetzner Robot API is

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is our API and if people use the default, then this would be unnecessarily breaking. I would leave the default

…-upstream-ccm-step1' into tg/support-provider-id-format-of-upstream-ccm
@janiskemper

Copy link
Copy Markdown
Contributor

@guettli this PR is huge. I think it takes a long time to even find the comments. Do you just wanna close this and create a new one? Maybe with fewer commits? Please incorporate my comments though.

@guettli
guettli changed the base branch from tg/support-provider-id-format-of-upstream-ccm-step1 to tg/support-provider-id-format-of-upstream-ccm-secret-helper-rename April 1, 2026 13:35
…lper-rename' into tg/support-provider-id-format-of-upstream-ccm
@guettli
guettli changed the base branch from tg/support-provider-id-format-of-upstream-ccm-secret-helper-rename to v1.1.x April 1, 2026 15:21
guettli added 2 commits April 2, 2026 10:18
…-upstream-ccm-step1' into tg/support-provider-id-format-of-upstream-ccm
@github-actions github-actions Bot added size/XL Denotes a PR that changes 800-2000 lines, ignoring generated files. and removed size/L Denotes a PR that changes 200-800 lines, ignoring generated files. labels Apr 2, 2026
@guettli
guettli changed the base branch from v1.1.x to tg/support-provider-id-format-of-upstream-ccm-step1 April 2, 2026 10:56
…to tg/support-provider-id-format-of-upstream-ccm
@github-actions github-actions Bot added size/L Denotes a PR that changes 200-800 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 800-2000 lines, ignoring generated files. labels Apr 2, 2026
@guettli

guettli commented Apr 2, 2026

Copy link
Copy Markdown
Contributor Author

@guettli this PR is huge. I think it takes a long time to even find the comments. Do you just wanna close this and create a new one? Maybe with fewer commits? Please incorporate my comments though.

OK, I close this PR, and we continue on the new II #1920

@guettli guettli closed this Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/api Changes made in the api directory area/code Changes made in the code directory area/github Changes made in the github directory area/hack Changes made in the hack directory area/templates Changes made in the templates directory area/test Changes made in the test directory size/L Denotes a PR that changes 200-800 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants