Hi, could anyone suggest how do we set up ssh keys...
# ask-community
t
Hi, could anyone suggest how do we set up ssh keys in prefect kubernetes agent? we need to connect to a SFTP server that we can only let local development env work but not after register the flow.
1
I just learned that we can create k8s secret in this way:
Copy code
kubectl create secret generic ssh-keys --from-file=id_rsa=/path/to/.ssh/id_rsa --from-file=id_rsa.pub=/path/to/.ssh/id_rsa.pub
But how can we mount the ssh key to Prefect flow job? In all answers I see, it needs to be specified in k8s pod definition.
b
Hello Tony, are you using prefect 1? I believe you can accomplish this by passing the secrets (ssh keys) to the agent as an environment variable. Check out example #2 in this article: https://discourse.prefect.io/t/how-to-set-secrets-e-g-github-access-token-on-server/70 Example #5 may also be helpful to you.
t
got it thanks!
🙌 1