Argo CD objects and safety
An Application defines what and where
An Argo CD Application identifies a source repository, revision and path, a destination cluster and namespace, and a project. The installed Argo CD CRD uses argoproj.io/v1alpha1 in this example. The Application object lives in the Argo CD control namespace in this conventional setup; its managed resources target a separate namespace. Other supported installation modes have different namespace rules. The example uses a reserved invalid domain and an intentionally nonexistent destination, and cannot be deployed as provided.
apiVersion: argoproj.io/v1alpha1kind: Applicationmetadata: name: catalog namespace: argocdspec: project: bookstore-lab source: repoURL: https://git.example.invalid/bookstore/config.git targetRevision: main path: apps/catalog destination: server: https://cluster.example.invalid namespace: bookstore-labRestrict the project before granting sync access
An AppProject constrains sources, destinations and resource kinds. The complete fixture allows only one exact repository and one fictional namespace/server pair; its permitted namespaced kinds are Deployment and ConfigMap. It explicitly denies cluster-scoped resources through an empty cluster resource whitelist. Never permit a tenant to deploy into the Argo CD control namespace, which can undermine project boundaries. Restrict who can edit Application and AppProject objects, repository access and cluster credentials. Project rules complement rather than replace Kubernetes RBAC and admission.
spec: sourceRepos: - https://git.example.invalid/bookstore/config.git destinations: - server: https://cluster.example.invalid namespace: bookstore-lab clusterResourceWhitelist: [] namespaceResourceWhitelist: - group: apps kind: Deployment - group: "" kind: ConfigMapRead status before approving a change
Check the source URL, resolved revision, destination, project and rendered resource list. Compare proposed modifications and deletions. The static commands below are for an explicitly authenticated, isolated training Argo CD instance only; they are not executed in this package. The offline alternative reads synthetic status data. A successful project-policy check is not evidence that the controller credentials can write to the cluster.
argocd app get catalogargocd app diff catalogKeep the deployment trust boundary small
Do not let arbitrary repository contributors choose unrestricted manifests, remote plugins or privileged resources. A reviewed repository can still contain dangerous configuration. Separate authoring and approval, restrict changes to deployment paths and project policy, use narrowly scoped identities and protect source credentials. Do not copy real tokens into manifests. Before any authorized lab sync, inspect the rendered resource set, namespace and cluster identity, confirm the destination is disposable and stop on unexpected privileges or deletions.
Allowed: catalog Deployment in bookstore-labDenied by lab project: ClusterRole, another repository, another namespaceStill required: RBAC, admission, independent reviewPractice and next step
Review application.yaml, project.yaml and project-cases.json in lab-fixtures/gitops-argocd. Predict each allow/deny decision, then run the offline validator. Explain why a project allow result cannot guarantee Kubernetes admission. Next: sync, prune and self-heal.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Argo CD objects and safety — knowledge check
Design a restricted Application and AppProject and distinguish project policy from real Kubernetes authorization.
Which object constrains permitted repositories and destinations?
Where is the sample Application stored?
A source is allowed but the namespace differs from the only allowed destination. What should happen?
Does an AppProject allow decision guarantee successful API admission?
Why avoid tenant deployment into the Argo CD control namespace?