Skip to content
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

Use keys specified in env vars for GCP and AWS #16792

Conversation

dims
Copy link
Member

@dims dims commented Aug 30, 2024

Avoid creating new SSH keys if they are already specified. Some CI jobs are failing because the e2e tests are using what is in the env vars, but kops ends up creating new keys when these are not picked up.

Also log what we are doing so if we end up tripping up any CI jobs, we'll know quickly what went wrong.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 30, 2024
@dims
Copy link
Member Author

dims commented Aug 30, 2024

see below for example log of key generation from: https://prow.k8s.io/log?container=test&id=1829315846992826368&job=pull-kubernetes-e2e-gce-disruptive-canary

you can see DaemonRestart [Disruptive] are failing and the e2e tests are expecting the following keys to be used):

      - name: GCE_SSH_PRIVATE_KEY_FILE
        value: /etc/ssh-key-secret/ssh-private
      - name: GCE_SSH_PUBLIC_KEY_FILE
        value: /etc/ssh-key-secret/ssh-public
I0830 00:36:47.041297   15188 common.go:145] Using cluster name: e2e-pr127005.pull-kubernetes-e2e-gce-disruptive-canary.k8s.loca
I0830 00:36:47.058209   15188 ssh.go:43] gcloud compute --project=k8s-infra-e2e-boskos-063 config-ssh --ssh-key-file=/tmp/kops-ssh3991035025/key
WARNING: The private SSH key file for gcloud does not exist.
WARNING: The public SSH key file for gcloud does not exist.
WARNING: You do not have an SSH key for gcloud.
WARNING: SSH keygen will be executed to generate a key.
Generating public/private rsa key pair.
Your identification has been saved in /tmp/kops-ssh3991035025/key
Your public key has been saved in /tmp/kops-ssh3991035025/key.pub
The key fingerprint is:
SHA256:mPHOg54889XATlT7PUlJlt1atqCcdyJUahtatM5fkyI root@f86513e2-a6b9-47f2-8a16-0231e1f69a64
The key's randomart image is:
+---[RSA 3072]----+
|           .o. o+|
|          .oooo.*|
|      .   +*+ .*.|
|       = o*=o+o+o|
|      o S.+Eo.+*.|
|       + o oo o o|
|      . + o ..   |
|     oo. o       |
|      ++.        |

Copy link
Member

@hakman hakman left a comment

Choose a reason for hiding this comment

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

Pretty cool, thanks @dims! 😄

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 30, 2024
@k8s-ci-robot
Copy link
Contributor

[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 k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 30, 2024
@k8s-ci-robot k8s-ci-robot merged commit 2085b64 into kubernetes:master Aug 30, 2024
23 of 24 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.31 milestone Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants