SSH key based authentication requires a private SSH key.
The repository keys are usually located in the $HOME/.ssh/ directory, and
are named id_dsa.pub, id_ecdsa.pub, id_ed25519.pub, or id_rsa.pub by
default.
Procedure
-
Generate SSH key credentials:
$ ssh-keygen -t rsa -C "your_email@example.com"
NoteCreating a passphrase for the SSH key prevents {product-title} from building. When prompted for a passphrase, leave it blank.
Two files are created: the public key and a corresponding private key (one of
id_dsa,id_ecdsa,id_ed25519, orid_rsa). With both of these in place, consult your source control management (SCM) system’s manual on how to upload the public key. The private key is used to access your private repository. -
Before using the SSH key to access the private repository, create the secret:
$ oc create secret generic <secret_name> \ --from-file=ssh-privatekey=<path/to/ssh/private/key> \ --type=kubernetes.io/ssh-auth