Expose coder user SSH key to envbuilder
Hello, I'm new to coder and I've setup a template to use devcontainer in kubernetes heavily based on the template example. The repo URL I pass is SSH based, and the coder user's SSH key as been added to my git provider's security settings. Since envbuilder expects a path to a file or an ssh agent socket, how can I expose the SSH key from the coder user to it in order to successfully clone the repository?
5 Replies
<#1271267669622132777>
Category
Help needed
Product
Coder OSS (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
I've attempted to add the user's ssh private key to a k8s secret, then mount that file in the envbuilder deployment and set the env var
ENVBUILDER_GIT_SSH_KEY_PATH
. However I get some errors, and it apparently still doesn't find it:
What am I doing wrong?
It turns out the documentation for envbuilder is incorrect, and mentions the env var being ENVBUILDER_GIT_SSH_KEY_PATH
, when instead it expects ENVBUILDER_GIT_SSH_PRIVATE_KEY_PATH
. When changing to that variable it correctly finds the key, but still is unable to clone the repository:
I have verified I added the corresponding public key to my git provider's configuration for my user. What could be going wrong here?Which version of envbuilder are you using? (EDIT: I see the version string now)
Can you set
ENVBUILDER_VERBOSE=true
and try again?
Thanks for the heads-up on the documentation inconsistency as well! I updated it just now.hello @wizrds -- did you get this sorted out?
Looking more at the last message
error: temp remount: temp remount: bind mount /.ssh/id_rsa => /.envbuilder/mnt/.ssh/id_rsa: permission deniedAre you sure your
envbuilder
container is running as root? Do you have some container security policy in place?