Skip to content
LatchkeyLatchkey home

argocd app create: Define an Application

argocd app create registers a new Application that maps a Git repo path to a destination cluster and namespace.

An Application is the core Argo CD object: source repo plus destination plus sync policy. Creating it from the CLI lets a pipeline bootstrap or update the definition.

What it does

argocd app create defines an Application resource pointing at a source (--repo plus --path, or a Helm chart) and a destination (--dest-server or --dest-name, plus --dest-namespace). Without --sync-policy the app is created OutOfSync and waits for a manual sync.

Common usage

Terminal
argocd app create guestbook \
  --repo https://github.com/acme/manifests.git \
  --path guestbook --revision main \
  --dest-server https://kubernetes.default.svc \
  --dest-namespace guestbook \
  --sync-policy automated --auto-prune

Options

FlagWhat it does
--repo <url>Source Git repository URL
--path <dir>Directory within the repo holding manifests
--revision <ref>Git branch, tag, or commit to track
--dest-server / --dest-nameTarget cluster API URL or registered name
--dest-namespace <ns>Namespace to deploy into
--sync-policy automatedEnable auto-sync (default is manual)
--helm-set key=valueOverride a Helm value for a chart source

Common errors in CI

"FATA[0000] rpc error: code = NotFound desc = repository not found" means the --repo was never added with argocd repo add (or lacks credentials). "application destination ... is not permitted in project" means the AppProject restricts that cluster/namespace; widen the project or use --project. "cluster ... not found" means --dest-server is not a registered cluster.

Using this in CI

A runner has no kubeconfig, no cached context, and no interactive auth. Every kubectl invocation in CI needs the context supplied explicitly, and most confusing CI failures here are the command running against the wrong cluster or no cluster at all.

Terminal
# never rely on the ambient context on a runner
kubectl --context "$KUBE_CONTEXT" -n "$NAMESPACE" get pods

# confirm what you are actually connected to before mutating anything
kubectl config current-context
kubectl cluster-info

# fail fast instead of hanging on an unreachable API server
kubectl --request-timeout=30s get nodes

Frequently asked questions

argocd app create: Define an Application?
An Application is the core Argo CD object: source repo plus destination plus sync policy. Creating it from the CLI lets a pipeline bootstrap or update the definition.
What it does?
argocd app create defines an Application resource pointing at a source (--repo plus --path, or a Helm chart) and a destination (--dest-server or --dest-name, plus --dest-namespace). Without --sync-policy the app is created OutOfSync and waits for a manual sync.
Common errors in CI?
"FATA[0000] rpc error: code = NotFound desc = repository not found" means the --repo was never added with argocd repo add (or lacks credentials). "application destination ... is not permitted in project" means the AppProject restricts that cluster/namespace; widen the project or use --project. "cluster ...

Related guides

References

Run this faster and cheaper on Latchkey managed runners - self-healing included. Start free → 30-day trial · No credit card