Repository navigation
🌱 Step 2: support upstream hcloud-ccm secret/key conventions (II) #1920
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
Changes from 31 commits
1d7c69b
9045f83
754bb78
fa881ba
2b26274
2221309
565e24a
4076672
7711985
b1db27f
f52a463
0256ed7
4b8e3ce
46d0eb5
e64277e
e2d0dc4
d6d700c
5b254b3
dab01e2
ce71208
e273531
cc0ec43
9995edf
e7ae474
f8a1f8f
5fcbe30
b593759
77bac89
b52d849
994265f
100c3ea
5e54931
e4a0f53
2648f61
3ee7ead
753d380
c7c93e1
b678259
7b9150d
cfe1283
077529e
78650ee
76c492c
a778f9d
5b80084
1f86185
ce511d1
6cea60a
67c7153
df86d8d
3f5c7fe
c69c6a3
2e7f9a3
2aeee8f
50d838e
199007b
b8cc56b
60e9d47
f96f293
0cf506d
5a82110
bb28fe3
1582375
a158bef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -101,9 +101,19 @@ type HCloudPlacementGroupStatus struct { | |
|
|
||
| // HetznerSecretRef defines all the names of the secret and the relevant keys needed to access Hetzner API. | ||
| type HetznerSecretRef struct { | ||
| // Name defines the name of the secret. | ||
| // Name defines the name of the secret. The name gets used for reading the credential in the | ||
| // mgt-cluster, and it gets used for creating a secret in the wl-cluster. About the secret in | ||
| // the wl-cluster: Attention, the upstream hcloud-ccm helm chart expects the name to be | ||
| // "hcloud". The Syself ccm fork defaults to "hetzner". To stay compatible with upstream | ||
| // hcloud-ccm, if this name is not "hcloud", the controller creates two secrets: one named | ||
| // "hcloud" and one named after the value of this setting. The secret will be created in the | ||
| // namespace "kube-system" of the workload-cluster. We recommend to use "hcloud", because this is | ||
| // the default of upstream hcloud-ccm. Set `spec.skipCreatingHetznerSecretInWorkloadCluster`, if | ||
| // you don't want that secret in the wl-cluster to be created. | ||
| // | ||
| // +kubebuilder:default=hetzner | ||
| Name string `json:"name"` | ||
|
|
||
| // Key defines the keys that are used in the secret. | ||
| // Need to specify either HCloudToken or both HetznerRobotUser and HetznerRobotPassword. | ||
| Key HetznerSecretKeyRef `json:"key"` | ||
|
|
@@ -113,18 +123,38 @@ type HetznerSecretRef struct { | |
| // 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. | ||
| // It gets used for reading the credential in the mgt-cluster, and it gets used for creating a | ||
| // secret in the wl-cluster. We recommend to use "token", because this is the default of | ||
| // upstream hcloud-ccm, while the legacy Syself ccm fork uses "hcloud". For maximal | ||
|
janiskemper marked this conversation as resolved.
Resolved
|
||
| // compatibility up to three keys get created in the secret for HCLOUD_TOKEN: "hcloud", "token" | ||
|
janiskemper marked this conversation as resolved.
Resolved
|
||
| // and the value of hcloudToken. This way we ensure that the ccm in the wl-cluster finds the | ||
| // secret. | ||
| // | ||
| // +optional | ||
| // +kubebuilder:default=hcloud-token | ||
| 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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why don't we create two keys here for compatibility?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @janiskemper I added a comparison to the PR description. Both CCMS use the same keys for robot-user and robot-password.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We only create one secret additionally, if the specified one is NOT the one the hcloud ccm wants. So we also only need to add another key to the secret that the hcloud ccm wants, right? We don't have to add another key to the secret that is irrelevant to hcloud ccm.. We only do this in the first place to facilitate migrations to the upstream hcloud ccm. Therefore, we can keep it lean and only focus on what that ccm wants, and that's all we need to do
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @janiskemper ok, I adapted the PR accordingly.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cool! I think I now have a clear picture here as well. I think we should revamp the whole comments here that we added in the PR and align it around the following principle:
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
@guettli so that means that both CCMs use the same key, but here in our default we have a different one than that? In the code I don't see that we hardcode the value that you mention "robot-user". Therefore, this secret would actually be created wrongly if I specify something else with this configuration than "robot-user".
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @janiskemper I can do that, but I dont think this is needed. In all our templates, and in our commercial offering we use
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. okay, but we should still fix the code, because we cannot rely on people just using the templates, right? Currently, our code is wrong and we need to fix it by using the right configuration
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @guettli then this is left before I review again (but I think we are almost there)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @janiskemper done in 50d838e . The |
||
| // stored. It gets used for reading the credential in the mgt-cluster, and it gets used for | ||
| // creating a secret in the wl-cluster. We recommend to use "robot-user", because this is the | ||
| // default of upstream hcloud-ccm. | ||
| // | ||
| // +optional | ||
| // +kubebuilder:default=hetzner-robot-user | ||
| HetznerRobotUser string `json:"hetznerRobotUser"` | ||
| // HetznerRobotPassword defines the name of the key where the password for the Hetzner Robot API is stored. | ||
|
|
||
| // HetznerRobotPassword defines the name of the key where the password for the Hetzner Robot API | ||
| // is stored. It gets used for reading the credential in the mgt-cluster, and it gets used for | ||
| // creating a secret in the wl-cluster. We recommend to use "robot-password", because this is | ||
| // the default of upstream hcloud-ccm. | ||
| // | ||
| // +optional | ||
| // +kubebuilder:default=hetzner-robot-password | ||
| HetznerRobotPassword string `json:"hetznerRobotPassword"` | ||
| // SSHKey defines the name of the ssh key. | ||
|
|
||
| // SSHKey defines the name of the ssh key. It is only used in the mgt-cluster. It is not synced | ||
| // to the wl-cluster. | ||
| // | ||
| // +optional | ||
| // +kubebuilder:default=hcloud-ssh-key-name | ||
| SSHKey string `json:"sshKey"` | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.