Add, view, and delete Git and Helm source repositories in your GitOps system using the Argo CD command-line interface (CLI) or the Argo CD console.
Prerequisites
Before you begin, ensure that you have:
-
Logged on to the GitOps system. For details, see Log on to the GitOps system
Add repositories
Add a Git source repository
Run one of the following commands based on your authentication method.
Public repository over HTTPS
argocd repo add https://github.com/AliyunContainerService/gitops-demo.git
Expected output:
Repository 'https://github.com/AliyunContainerService/gitops-demo.git' added
Private repository over HTTPS with username and password
argocd repo add https://git.example.com/repos/repo --username git --password secret
Private repository over SSH with a private key
argocd repo add git@git.example.com:repos/repo --insecure-ignore-host-key --ssh-private-key-path ~/id_rsa
To see all available flags, run:
argocd repo add --help
Add a Helm source repository
Run one of the following commands based on your repository type.
Public Helm repository over HTTPS
argocd repo add https://charts.helm.sh/stable --type helm --name <local-repository-name>
Private Helm repository over HTTPS with username and password
argocd repo add https://charts.helm.sh/stable --type helm --name <local-repository-name> --username test --password test
If the Helm chart is hosted in an Alibaba Cloud Container Registry (ACR) Enterprise Edition instance, specify the full repository path:
argocd repo add https://<instance-name>-chart.<region-id>.cr.aliyuncs.com/<namespace>/<chart-repository> --type helm --name <local-repository-name> --username test --password test
Private OCI-based Helm repository
argocd repo add helm-oci-registry.cn-zhangjiakou.cr.aliyuncs.com --type helm --name <local-repository-name> --enable-oci --username test --password test
View the repository list
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
Check the STATUS column to confirm each repository connected successfully.
Delete a repository
To delete a Git source repository:
argocd repo rm https://github.com/AliyunContainerService/gitops-demo.git
Expected output:
Repository 'https://github.com/AliyunContainerService/gitops-demo.git' removed
To delete a Helm repository, replace the Git repository URL with the Helm repository URL in the command above.
Manage repositories in the console
To manage source repositories in the Argo CD console instead of the CLI:
-
In the left navigation pane, choose Settings > Repositories.
-
Click + Connect Repo and follow the on-screen instructions.