Reputation: 67
I am trying to generate an secrete for a private repo on openshift. But I keep getting this error any idea why?
oc secrets new-sshauth sshsecret --ssh-privatekey=C:\Users\Name\.ssh\id_rsa
Error: unknown flag: --ssh-privatekey
See 'oc create --help' for usage.
according to the documentation I need to do this
oc secrets new-sshauth sshsecret --ssh-privatekey=$HOME/.ssh/id_rsa
Upvotes: 0
Views: 729
Reputation: 174
You can create ssh private key type secrets in OpenShift with this way
First generate your SSH key if you dont have one with the following command
$ ssh-keygen -t rsa -C "[email protected]"
Then you can create a secret in your openshift project with the following command
oc create secret generic <secret_name> \
--from-file=ssh-privatekey=<path/to/ssh/private/key> \
--type=kubernetes.io/ssh-auth -n <youropenshiftprojectname>
Upvotes: 1