Last active
April 20, 2021 07:37
-
-
Save a-nldisr/df268155cc52b146853304caefde0bfd to your computer and use it in GitHub Desktop.
Setup private repo in Rancher Chart repository
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rancher only supports specific SSH key formats. When you try to add a ssh-key it often will fail and give the following error because the format is incorrect: | |
data does not contain a valid RSA or ECDSA private key | |
This issue gave the idea that the Rancher interface has limited SSH key support: https://github.com/rancher/fleet/issues/138 | |
Generate the private key and public key: | |
ssh-keygen -t rsa -b 4096 -m pem -C "Rancher chart ssh-key" | |
Since there is no password option in the Rancher interface, provide the keys without a passphrase and place the keys to a location of your choice. | |
Test the key against Github to validate it is correct: | |
ssh-agent bash -c 'ssh-add /Users/USERNAME/.ssh/id_rsa_rancher_chart; git clone git@github.com:REPOSITORY/charts.git' | |
After you place these keys to the location of choice you can read them out and configure the pub key as a deploy key in Github. After this is done you can copy and paste the public and private key into Rancher ssh-key secrets while creating the repository. | |
Use the SSH (not the https) url to configure the repository. The url should look like this: | |
git@github.com:REPOSITORY/charts.git |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment