Add new API field nodeSshPublicKey - #6157
Conversation
|
Hi @tmstff. Thanks for your PR. I'm waiting for a Azure member to verify that this patch is reasonable to test. If it is, they should reply with Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/ok-to-test |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: tmstff The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/test api-validation |
|
/test e2e-parallel |
|
/test e2e-parallel |
| "type": "string", | ||
| "description": "The SSH public key used for secure access to cluster nodes. When set, this key\nis distributed to all nodes, enabling SSH access for debugging\nand maintenance purposes.", | ||
| "maxLength": 8192, | ||
| "pattern": "^(?<type>[A-Za-z0-9._@-]+)[ \t]+(?<key>[A-Za-z0-9+/]+=*)(?:[ \t]+(?<comment>.*))?$", |
There was a problem hiding this comment.
Where do the pattern and maxlength come from?
| "type": "string", | ||
| "description": "The SSH public key used for secure access to cluster nodes. When set, this key\nis distributed to all nodes, enabling SSH access for debugging\nand maintenance purposes.", | ||
| "maxLength": 8192, | ||
| "pattern": "^(?<type>[A-Za-z0-9._@-]+)[ \t]+(?<key>[A-Za-z0-9+/]+=*)(?:[ \t]+(?<comment>.*))?$", |
There was a problem hiding this comment.
Does this mean this field accepts one and only one SSH public key?
In the Hypershift API, the corresponding attribute in the HostedCluster:
// sshKey is a local reference to a Secret that must have a "id_rsa.pub" key whose content must be the public part of 1..N SSH keys.
// If the reference is set but none of the above requirements are met, the HostedCluster will enter a degraded state.
// TODO(alberto): Signal this in a condition.
// When sshKey is set, the controllers will generate a machineConfig with the sshAuthorizedKeys https://coreos.github.io/ignition/configuration-v3_2/ populated with this value.
// This MachineConfig will be part of every payload generated by the controllers for any NodePool of the HostedCluster.
// Changing this value will trigger a rollout for all existing NodePools in the cluster.
// +rollout
// +optional
SSHKey corev1.LocalObjectReference `json:"sshKey"`
Which if I understand correctly technically allows providing multiple (confirm this as I just checked superficially)
Were/are we aware of this and is our design where it seems to differ intentional?
0342978 to
41e9a27
Compare
…t api versions are treated properly
…y to avoid possible future discrepancies
41e9a27 to
45e833a
Compare
https://redhat.atlassian.net/browse/ARO-26939
What
New (ARO-HCP) API version exposing the nodeSshPublicKey field to customers, as part of an effort to provide ssh access to cluster nodes for customers ( https://redhat.atlassian.net/browse/ARO-26935 ).
ARM API change and transmission to CS not part of this story, will be handled in a follow-up.
Why
To allow the customer to provide a ssh public key, which can then be forwarded to HyperShift via Backend and CS.
Testing
make e2e-local/run-test TEST_NAME="Customer should persist nodeSshPublicKey set at cluster creation and return it via ARM GET"Special notes for your reviewer
models.goandmodels_serde.goare generated (viamake testsdk) and contain code that is not directly related to this PR - seemed to be alright like that anyways.internal/api/utils_test.gowas added, because it seemed untested so far.PR Checklist
If E2E tests are included:
demonstrate that the test is able to detect a defect/error and fail with
proper error message and logs which communicates nature of the problem.