ArgoCD - Create Project using the CLI

by
Jeremy Canfield |
Updated: January 15 2025
| ArgoCD articles
This assumes:
- You have an ArgoCD server up and running. If not, check out my article Install Red Hat OpenShift GitOps Operator using the console (Argo CD)
- You have installed the ArgoCD CLI.
- You are able to log into ArgoCD using the CLI. If not, check out my article Log into ArgoCD using the CLI on OpenShift
The argoc proj create command can be used to create a project.
argocd proj create my-project
Likewise, you can create a YAML file that will be used to create a project.
apiVersion: argoproj.io/v1alpha1
kind: AppProject
metadata:
name: my-project
namespace: openshift-gitops
spec:
clusterResourceWhitelist:
- group: '*'
kind: '*'
destinations:
- namespace: '*'
server: '*'
sourceRepos:
- '*'
And then the kubectl (Kubernetes) or oc (OpenShift) apply command can be used to create the project. This is nice because the YAML file let's you specfiy exactly how you want the project to be configured.
kubectl apply -f myproject.yaml
Did you find this article helpful?
If so, consider buying me a coffee over at