I am trying to figure out what is the best way to handle ssh keys on containers for accessing google cloud compute via ssh.
I used the add_ssh_key, using the fingerprint of a key I added to my project’s settings page, and I noticed it appears on the container with the name id_rsa_FINGERPRINT
However, gcloud compute complains there is no public key on the container:
#!/bin/bash -eo pipefail
gcloud compute ssh donatoaz@aospfacta --quiet --ssh-key-file=~/.ssh/id_rsa_FINGERPRINT --zone us-east1-b --command="cd ~/project && git pull"
WARNING: The public SSH key file for gcloud does not exist.
WARNING: Your SSH key files are broken.
private key (OK) [/root/.ssh/id_rsa_FINGERPRINT]
public key (NOT FOUND) [/root/.ssh/id_rsa_FINGERPRINT.pub]
We are going to overwrite all above files.
ERROR: (gcloud.compute.ssh) Aborted by user.
Exited with code 1
Am I getting this wrong? I mean, I can go around this by adding my public key as an environment variable on CircleCI, but it seems weird having to do that.