<p>I would like to create an argoCD application right from the git repository, ie the gitOps way. I already created a CRD file for the application which looks like this:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: my-service
  namespace: argocd
spec:
  destination:
    namespace: default
    server: https://kubernetes.default.svc
  syncPolicy:
    syncOptions:
    - CreateNamespace=true
  project: default
  source:
    path: clusters/helm-chart
    repoURL: https://github.com/user/my-repo.git
    targetRevision: HEAD
    helm:
      values: |
        image:
          repository: user/my-image
          pullPolicy: Always
          tag: xxx


</code></pre>
<p>My current workflow is to apply this CRD to my cluster with <code>k apply -f application.yaml</code>.</p>
<p><strong>Question:</strong> how can I instruct ArgoCD to go and sync/create the application I have defined at <code>https://github.com/user/my-repo.git</code> without first creating that application &quot;manually&quot;?</p>

<p>At some point you have to manually apply a manifest to your ArgoCD instance.</p>
<p>You can limit that to a single manifest if you utilize the <a href="https://argo-cd.readthedocs.io/en/stable/operator-manual/cluster-bootstrapping/" rel="nofollow noreferrer">app-of-apps</a> pattern, in which you have a repository that contains all your ArgoCD application manifests.</p>
<p>You can also create <a href="https://argocd-applicationset.readthedocs.io/en/stable/" rel="nofollow noreferrer">ApplicationSets</a> to automatically generate ArgoCD applications from templates based on the content of a git repository, the names of clusters registered with ArgoCD, and other data.</p>
