If we want to add a private github repository into argocd ui using ssh, we need to configure it like this.


Purpose
If application manifests are located in a private repository then repository credentials have to be configured. Argo CD supports both HTTPS and SSH Git credentials.


How to generate an SSH key using a terminal ?

  • Open Terminal.

  • Paste the text below, substituting in your GitHub email address.
    $ ssh-keygen -t ed25519 -C "your_email@example.com"
    ex:- ssh-keygen -t ed25519 -C “xyz@gmail.com"

  • Press “enter” on these locations 
    Enter file in which to save the key (/home/haritha/.ssh/id_ed25519): 

Enter passphrase (empty for no passphrase): 

Enter same passphrase again: 


Adding SSH key into github:


For more information https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account


  1. SSH file will be stored in this location cd /home/your name/.ssh

  2. Go to github > settings > SSH & GPG Keys

  3. Add new SSH key

  4. Add title, key type, key ( here we need to add data having extension “.pub” like id_rsa.pub)

  5. Click on “Add SSH Key”

      

  • Clone your private github repository using < git clone  “repo url” > in terminal

  • Adding private repo using SSH key as follows


  • Get your SSH private key from terminal as cat id_rsa