All Products
Search
Document Center

Container Service for Kubernetes:Repository management

Last Updated:Feb 28, 2024

This topic describes how to use the Argo CD CLI and Argo CD console to add, view, and delete Git repositories and Helm repositories in the GitOps system.

Prerequisites

You are logged on to the GitOps system. For more information, see Log on to the GitOps system.

Add repositories

Add a Git repository

You can use one of the following methods to add a Git repository to the GitOps system:

  • Run the following command to add a Git repository to the GitOps system:

    argocd repo add https://github.com/AliyunContainerService/gitops-demo.git

    Expected output:

    Repository 'https://github.com/AliyunContainerService/gitops-demo.git' added
  • Run the following command to add a private Git repository through HTTPS and specify the username and password of the repository:

    argocd repo add https://git.example.com/repos/repo --username git --password secret
  • Run the following command to add a Git repository through SSH, specify a private key, and disable server certificate verification:

    argocd repo add git@git.example.com:repos/repo --insecure-ignore-host-key --ssh-private-key-path ~/id_rsa

Run the following command to query the help information of the argocd repo add command:

argocd repo add --help

Add a Helm repository

You can use one of the following methods to add a Helm repository to the GitOps system:

  • Run the following command to add a public Helm repository through HTTPS and specify the name of the repository:

    argocd repo add https://charts.helm.sh/stable --type helm --name mystable
  • Run the following command to add a private Helm repository through HTTPS and specify the username, password, and name of the repository:

    argocd repo add https://charts.helm.sh/stable --type helm --name mystable --username test --password test
  • Run the following command to add a private Helm OCI-based repository through HTTPS and specify the name of the repository:

    argocd repo add helm-oci-registry.cn-zhangjiakou.cr.aliyuncs.com --type helm --name mystable --enable-oci --username test --password test

View repositories

Run the following command to query repositories:

argocd repo list

Expected output:

TYPE  NAME      REPO                                                       INSECURE  OCI    LFS    CREDS  STATUS      MESSAGE  PROJECT
helm  mystable  https://charts.helm.sh/stable                              false     false  false  false  Successful           
git             https://github.com/AliyunContainerService/gitops-demo.git  true      false  false  false  Successful           default

Remove repositories

Run the following command to remove a Git repository from the GitOps system. To remove a Helm repository, replace the address of the Git repository with the address of the Helm repository.

argocd repo rm https://github.com/AliyunContainerService/gitops-demo.git

Expected output:

Repository 'https://github.com/AliyunContainerService/gitops-demo.git' removed

What to do next

In addition to the Argo CD CLI, you can also use the Argo CD console to manage repositories. To do this, perform the following steps:

Log on the Argo CD UI . In the left-side navigation pane, click Settings and choose Repositories > + Connect Repo.