Argo CD Hour 4: Multi-Cluster and Multi-Tenancy — Project, RBAC, and SSO

Turn “an Argo CD for one person” into “a platform that multiple teams share and that manages several clusters”: AppProject sets the boundaries, RBAC controls permissions, SSO handles identity, and cluster Secrets manage connections
Argo CD v3.6.1Helm chart argo-cd 10.18.0kind v0.33.0 · lab + lab2Dex v2.46.1 (bundled with the chart)Verified against official docs · 2026-11-17
Overall learning goals
  • Use AppProject for team-a,team-b, and platform to define boundaries: allowed Git sources (sourceRepos), target clusters and namespaces (destinations), deployable resource kinds (clusterResourceWhitelist / namespaceResourceBlacklist), and enable orphaned-resource monitoring and project-level sync windows.
  • Read and write the argocd-rbac-cm ConfigMap's policy.csv (p / g — two kinds of lines),policy.default,scopes; understand the v3 RBAC changes: logs, get is enforced by default,update/delete are no longer inherited by child resources; use project roles and JWT tokens for least-privilege CI access.
  • Configure SSO: use the built-in Dex to connect GitHub (group claim as org:team), or directly use OIDC to connect Microsoft Entra ID (group claim as object ID), and map groups to roles.
  • Register the second kind cluster lab2 to Argo CD: argocd cluster add --cluster-endpoint kube-public and declarative cluster Secrets (two methods), and understand why kind networking must use the Docker-internal address.
  • Compare Hub-and-spoke (centralized) and one Argo CD per cluster trade-offs, learn about argocd-agent and similar compromise options, and enable Applications in any namespace (application.namespaces + sourceNamespaces).
  • Perform an architecture review of a multi-tenant Argo CD design: find privilege-escalation paths, blast radius, and operational bottlenecks.

1-hour time allocation table

#TimeModuleCore contentAnimation / interactionLab (kind: lab + lab2)
0Before classPrep: second cluster and team examplesCreate kind cluster lab2, verify the Docker network, and prepare team namespaces and the repo directoryEnvironment self-check checklistBoth clusters on the same kind network
100–06Multi-tenancy model: AppProject boundariesdefault project risks, five AppProject constraints, tenant models (project / namespace / cluster), global projectsTenant boundary explorerCreate team-a / team-b / platform projects and lock down default
206–13Sources, destinations, and cluster resource allowlistssourceRepos wildcards and negations, destinations (server/name), cluster resource allowlist vs. namespace resource denylist, orphaned resources, sync windowsAppProject validation simulator (core animation #2)Deploy out of bounds on purpose and observe InvalidSpecError and SyncError
313–21RBAC: policy.csv, roles, and project tokensCasbin model, p/g lines, built-in roles, policy.default, deny precedence, v3 changes (logs, fine-grained update/delete), project roles + JWTRBAC decision animation (core animation #1)Local users alice/bob + argocd admin settings rbac can + CI token
421–28SSO: Dex and OIDC (GitHub / Entra ID)Two SSO approaches, callback URLs, group claims, scopes, Entra group IDs and the 200-group overflow, Workload Identity credentialsOIDC login sequence animation(optional) GitHub OAuth App + Dex, localhost callback
528–35Multi-cluster: registering clusters and declarative cluster Secretsargocd cluster add what it does, argocd-manager SA, kind internal addresses, declarative Secrets, project-scoped clusters, cloud cluster authentication (AKS / EKS)Step-by-step cluster registration animationRegister lab2 and deploy podinfo to lab2
635–42Hub-and-spoke vs. one Argo CD per clusterblast radius, network direction, credential centralization, scale and sharding, argocd-agent, and hybrid designs for the two topologiesTopology trade-off calculatorObserve the controller's connection to and cache of lab2
742–50Applications in any namespaceapplication.namespaces,sourceNamespaces, RBAC object three-part format, caveats (control-plane namespace, ApplicationSet limits)sourceNamespaces admission simulatorteam-a declares an Application in its own namespace
850–60Multi-tenant architecture reviewPrivilege-escalation path checklist, review scoring, common anti-patterns, troubleshooting treeArchitecture review scorecard + troubleshooting treeReview a given design and fix it
—After classCheat sheet · Capstone labDeliver a self-service but in-bounds dual-cluster platform for team-a / team-bFinal quiz (12 questions)Capstone lab

Knowledge Coverage Matrix

Target skillsM1M2M3M4M5M6M7M8Key commands / objectsLab
Isolate teams with AppProject✓✓····✓✓argocd proj create/getThree projects
Restrict sources, destinations, and resource kinds·✓··✓··✓sourceRepos,destinations, allowlists/denylistsOut-of-bounds deployment
Orphaned resources and sync windows·✓·····✓orphanedResources,argocd proj windowsprod window
Write and test RBAC policies··✓✓··✓✓argocd admin settings rbac canalice / bob
Use least-privilege tokens in CI··✓····✓argocd proj role create-tokenci role
SSO and group mapping··✓✓···✓dex.config,oidc.config,scopesGitHub Dex (optional)
Register and manage external clusters····✓✓·✓argocd cluster add/list, cluster Secretlab2
Choose a multi-cluster topology····✓✓·✓sharding, argocd-agenttopology calculator
Tenant self-service: declaring Applications··✓···✓✓application.namespaces,sourceNamespacesteam-a namespace
Multi-tenant architecture review✓✓✓✓✓✓✓✓Review checklistCapstone lab

What this course does not cover (and where to learn it)

TopicWhy it is not in this courseWhere to learn it
Argo CD installation, Application basics, sync and healthCovered in Lessons 1–2Lesson 1 · Lesson 2
ApplicationSet generators (the Cluster generator expands per cluster)A Lesson 3 topic; this course only references cluster Secret labels in M5/M6Lesson 3
Repository credentials and secrets management (Sealed Secrets / ESO / SOPS)Belongs to the secrets topicLesson 5
Controller sharding tuning, performance, and OutOfSync troubleshootingBelongs to the advanced operations topic; this course's M6 covers concepts onlyLesson 7
Full cloud labs for AKS Workload Identity and EKS IAMRequires a cloud subscription and incurs costs; this course covers configuration shapes onlyAKS 8-hour course(Workload Identity, GitOps extension)
Kubernetes-native RBAC (Role / ClusterRole)Argo CD RBAC is a separate system; this course only covers how the two relateKubernetes 8 + 1 hour course(security lesson)

How to use this courseware

10 pages per module
Principles · diagrams · animations · commands · labs · production cases · troubleshooting · quizzes · audio · videos. We recommend watching the M2 and M3 animations first, since they demonstrate the two most important decisions in this course: project validation and RBAC decisions.
Learning progress
A quiz score of ≥ 70% or clicking “Mark module complete” counts toward progress and is saved in this browser (refreshing clears it when local storage is disabled).
Chinese audio
The “Audio” page reads the script aloud with the browser's built-in Web Speech API (en-US); English terms are pronounced with en-US. If no Chinese voice pack is installed, you can read the script directly.
Version notes This course uses Argo CD v3.6.1 (released 2026-11-04) as the baseline, installed with the official Helm chart argo/argo-cd 10.18.0 (appVersion v3.6.1). The patch lines still maintained are v3.5.7, v3.4.13, and v3.3.19. All v3 behavior changes covered here were checked against the official upgrade notes. Starting with v3.0: logs RBAC permissions are enforced by default,update/delete child-resource inheritance is removed, and the RBAC subject for Dex SSO changes to federated_claims.user_id, resource tracking defaults to annotations; v3.4 upgrades the built-in Dex; from v3.5, once impersonation is enabled it also applies to API server operations (viewing logs, events, deleting resources, etc.). For earlier versions, refer to the documentation for that version.

Module 0 · Prep: second cluster and team examples (complete before class)

Alongside the lab cluster from Lessons 1–3, create another lab2, confirm both are on the same Docker network, and prepare namespaces and repo directories for team-a / team-b
Before class ≈ 12 minkind v0.33.0 · kindest/node v1.37.0Extra memory about 1.5–2 GB
Prerequisites
  • Lesson 1 output: kind cluster lab (context kind-lab), namespace argocd where Argo CD was installed with Helm release argocd and values file ~/gitops-lab/bootstrap/argocd-values.yaml.
  • GitHub repository https://github.com/<you>/gitops-lab (local ~/gitops-lab), which contains apps/podinfo/base/ and overlays/dev|staging|prod/.
  • Tools: Docker, kind v0.33.0, kubectl, helm, argocd CLI (v3.6.x). Works on Linux, macOS, and WSL2.
  • Resources required: Two single-node kind clusters together should have at least 4 vCPUs and 8 GB of memory (recommended). Risk: This lesson changes Argo CD's RBAC—a misconfiguration could lock you out, so keep the admin admin account until the final capstone lab.

Step 1: confirm the lab cluster and Argo CD are still working

kubectl config use-context kind-lab
kubectl -n argocd get pods
helm -n argocd list
argocd version --client
kubectl -n argocd get appset
argocd app list -o name
kubectl -n argocd get secret -l argocd.argoproj.io/secret-type=cluster --show-labels
NAME                                                READY   STATUS    RESTARTS   AGE
argocd-application-controller-0                     1/1     Running   0          3d
argocd-applicationset-controller-6c7c9d8f5b-x2k9p   1/1     Running   0          3d
argocd-notifications-controller-7d9b6c5f4-hv7tz     1/1     Running   0          3d
argocd-redis-6b8f9d7c5-l4w2s                        1/1     Running   0          3d
argocd-repo-server-7c6d8b9f4-p9x3k                  1/1     Running   0          3d
argocd-server-5d7f6c8b9-t6r4m                       1/1     Running   0          3d
NAME    NAMESPACE  REVISION  UPDATED   STATUS    CHART            APP VERSION
argocd  argocd     5         …         deployed  argo-cd-10.18.0  v3.6.1
argocd: v3.6.1+…
NAME              AGE
podinfo           2d
podinfo-preview   2d
argocd/podinfo-dev
argocd/podinfo-prod
argocd/podinfo-staging
argocd/root
NAME         TYPE     DATA   AGE   LABELS
in-cluster   Opaque   3      2d    argocd.argoproj.io/secret-type=cluster,env=lab,gitops-lab/managed=true

In the Lesson 1 values dex.enabled: false, so there is no argocd-dex-server Pod; Module 4 enables Dex in the same values file and helm upgrade. The Lesson 1 admin password has been changed to the lab password Lab-Argo-2026!, which this lesson keeps.

State at the end of Lesson 3 (the starting point for this lesson)① The root application applied by hand root (argocd/root.yaml), recursively manages argocd/apps,argocd/appsets,argocd/projects; ② podinfo-dev/staging/prod is no longer a hand-written file but is generated by ApplicationSet podinfo (argocd/appsets/podinfo.yaml, Git directory generator, auto-sync and self-heal,preserveResourcesOnDeletion: true, no finalizer) and ③ the declarative in-cluster cluster Secret labeled gitops-lab/managed: "true"; Lesson 3's Cluster / Matrix generators select clusters by this label. All objects above currently use project: default— Module 1 will, by editing the templates in Git move them to platform; Module 5 discusses the consequences of adding this label to lab2.

Step 1b (only if you do not have the previous lesson's output): minimal starting point

If lab has been deleted, use the commands below to restore the minimum state this lesson needs within 5 minutes (Argo CD + root application + ApplicationSet podinfo + labeled in-cluster Secret). For installation details, seeLesson 1, for the root application and ApplicationSet, seeLesson 3.

# Preferably use the Lesson 1 kind config file
if [ -f ~/gitops-lab/bootstrap/kind-lab.yaml ]; then
  kind create cluster --config ~/gitops-lab/bootstrap/kind-lab.yaml
else
  kind create cluster --name lab --image kindest/node:v1.37.0
fi
helm repo add argo https://argoproj.github.io/argo-helm && helm repo update
mkdir -p ~/gitops-lab/bootstrap
[ -f ~/gitops-lab/bootstrap/argocd-values.yaml ] || printf 'dex:\n  enabled: false\n' > ~/gitops-lab/bootstrap/argocd-values.yaml
helm upgrade --install argocd argo/argo-cd --version 10.18.0 -n argocd --create-namespace \
  -f ~/gitops-lab/bootstrap/argocd-values.yaml --wait
kubectl -n argocd port-forward svc/argocd-server 8080:443 &
# First install: after logging in with the initial password, change it to the lab password Lab-Argo-2026! (same as Lesson 1)
argocd login localhost:8080 --username admin --insecure \
  --password "$(kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath='{.data.password}' | base64 -d)"
argocd account update-password --current-password "$(kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath='{.data.password}' | base64 -d)" \
  --new-password 'Lab-Argo-2026!'
# Later logins: argocd login localhost:8080 --username admin --insecure (password Lab-Argo-2026!)
# Restore all Lesson 3 outputs from Git: the root application recreates the ApplicationSet podinfo (generating podinfo-dev/staging/prod) and the projects
kubectl apply -n argocd -f ~/gitops-lab/argocd/root.yaml
# The Lesson 3 in-cluster cluster Secret is outside root's management scope and must be recreated (with the gitops-lab/managed label)
kubectl apply -n argocd -f - <<'EOF'
apiVersion: v1
kind: Secret
metadata:
  name: in-cluster
  namespace: argocd
  labels:
    argocd.argoproj.io/secret-type: cluster
    gitops-lab/managed: "true"
    env: lab
type: Opaque
stringData:
  name: in-cluster
  server: https://kubernetes.default.svc
  config: '{"tlsClientConfig":{"insecure":false}}'
EOF
argocd app list

If your gitops-lab repository does not yet have argocd/root.yaml and argocd/appsets/podinfo.yaml (you did not complete Lesson 3), first completeLesson 3Module 8 migration steps; the Module 1 migration in this lesson edits this same ApplicationSet.

Step 2: create the second cluster lab2

kind create cluster --name lab2 --image kindest/node:v1.37.0
kubectl config get-contexts
kubectl --context kind-lab2 get nodes
CURRENT   NAME        CLUSTER     AUTHINFO    NAMESPACE
          kind-lab    kind-lab    kind-lab
*         kind-lab2   kind-lab2   kind-lab2
NAME                 STATUS   ROLES           AGE   VERSION
lab2-control-plane   Ready    control-plane   40s   v1.37.0
Notekind create cluster will switch the current context to the new cluster. All operations on Argo CD itself in this lesson run on kind-lab that context; switch back right away: kubectl config use-context kind-lab All operations on lab2 must explicitly add --context kind-lab2.

Step 3: understand kind networking—why 127.0.0.1 cannot be used

kubectl config view -o jsonpath='{.clusters[?(@.name=="kind-lab2")].cluster.server}{"\n"}'
docker network inspect kind -f '{{range .Containers}}{{.Name}} {{.IPv4Address}}{{"\n"}}{{end}}'
kubectl --context kind-lab2 -n kube-public get cm cluster-info -o jsonpath='{.data.kubeconfig}' | grep server
kind get kubeconfig --name lab2 --internal | grep server
https://127.0.0.1:41853
lab-control-plane 172.18.0.2/16
lab2-control-plane 172.18.0.3/16
    server: https://lab2-control-plane:6443
    server: https://lab2-control-plane:6443

The https://127.0.0.1:41853 is the result of Docker mapping the lab2 API port to a host loopback address. The Argo CD controller runs in a Pod in the lab cluster, from its point of view, 127.0.0.1 is the Pod itself and cannot reach lab2. The node containers of both kind clusters are attached to a Docker network named kind so you should use the Docker-internal address https://lab2-control-plane:6443 (container names resolve via Docker's built-in DNS) or the node container IP. The certificate kubeadm issues for the API server includes this hostname, so TLS verification passes.

# From inside a Pod in the lab cluster, verify that lab2's API server can be resolved and reached
kubectl --context kind-lab run nettest --rm -it --restart=Never --image=curlimages/curl -- \
  curl -sk https://lab2-control-plane:6443/version
{
  "major": "1",
  "minor": "37",
  "gitVersion": "v1.37.0",
  …
}
If name resolution fails In some Docker environments, Pods cannot resolve container names through Docker DNS. In that case, use the container IP instead: docker inspect lab2-control-plane -f '{{.NetworkSettings.Networks.kind.IPAddress}}', and in the cluster Secret, change server to https://172.18.0.3:6443 (the kubeadm certificate also includes the node IP). Drawback: the IP may change when the container is recreated.

Step 4: prepare team namespaces and the repo directory

# Pre-create the team namespaces on both clusters (pre-created by the platform admin in the lab)
for ctx in kind-lab kind-lab2; do
  for ns in team-a-dev team-a-prod team-b-dev; do
    kubectl --context $ctx create namespace $ns --dry-run=client -o yaml | kubectl --context $ctx apply -f -
  done
done
cd ~/gitops-lab
mkdir -p argocd/projects argocd/apps/team-a argocd/apps/team-b argocd/clusters
git pull --rebase

In this lesson, the files are kept under argocd/projects/ as team-a.yaml,team-b.yaml,platform.yaml, and in bootstrap/argocd-values.yaml accumulate RBAC / SSO / namespace settings; run helm upgrade after each change.

Warm-up: answer from memory (30 seconds)

An Application that does not set spec.project belongs to which project?

project is required; when created via the CLI/UI, it defaults to default. default A new project allows any source, any destination, and any resource—this is exactly the problem Module 1 solves first.

Is Argo CD's RBAC the same as Kubernetes RBAC?

No. Kubernetes RBAC controls “who can call the K8s API directly”; Argo CD RBAC controls “who can do what to Applications, projects, clusters, and so on through the Argo CD API/UI/CLI.” What actually changes the cluster is the ServiceAccount of the Argo CD controller (or the SA specified by impersonation).

Environment self-check checklist
Cleanup (after the whole course ends)kind delete cluster --name lab2. lab2 will still be used in Lessons 5–8 (multi-cluster examples); delete it later only if subsequent lessons no longer need it.

Module 1 · Multi-tenancy model: AppProject boundaries

00:00 – 06:00 · Every Application must belong to a project; the project decides where it can be pulled from, where it can be deployed, what it can deploy, and who can operate on it
6 minAppProject · argoproj.io/v1alpha1★★★★★
Learning objectives
  • Explain the five AppProject constraints: sources (sourceRepos), destinations (destinations), resource kinds (allow/deny lists), roles (roles), sync windows (syncWindows), and application namespaces (sourceNamespaces).
  • Explain why you must “lock down” the default project, and what happens after you lock it.
  • For team-a,team-b, and platform choose the right tenant model and manage projects with declarative YAML.
Prerequisites: Lesson 1's Application structure (source / destination / project). Importance:★★★★★ (the first wall of multi-tenancy)

What: what AppProject is

AppProject is an Argo CD CRD (argoproj.io/v1alpha1, which must be placed in the Argo CD control-plane namespace argocd ), and serves as the logical grouping of Applications and security boundary. The official documentation lists four capabilities: restricting what can be deployed (trusted Git sources), restricting where it can be deployed (destination clusters and namespaces), restricting which kinds of objects can be deployed (e.g., RBAC, CRD, DaemonSet, NetworkPolicy), and defining project roles that provide RBAC to applications (binding OIDC groups and/or JWT tokens).

FieldQuestion it answersDefault (when unset)
sourceReposWhich Git / Helm / OCI repositories can manifests be pulled from?empty = none allowed
destinationsWhich namespaces in which clusters can be deployed to?empty = none allowed
clusterResourceWhitelist / clusterResourceBlacklistWhich cluster-scoped resources (Namespace, ClusterRole, CRD…) can be created?an empty allowlist = no cluster-scoped resources allowed
namespaceResourceBlacklist / namespaceResourceWhitelistWhich namespace-scoped resources can be created?all empty = all namespace-scoped resources allowed
rolesWho can do what to this project's applications (project-internal RBAC + JWT)?no roles
syncWindowsWhen is sync allowed / forbidden?no windows = can sync at any time
orphanedResourcesAre there resources in the target namespace that “do not belong to any application”?off
sourceNamespacesWhich namespaces can host Applications that use this project (M7)?only argocd
destinationServiceAccountsWhen impersonation is enabled, which SA is used for sync (covered in detail in Lesson 7)not used

Why: why the default project is dangerous

Argo CD automatically creates during installation default project, whose initial configuration is the most permissive: sourceRepos: ['*'],destinations: [{namespace: '*', server: '*'}],clusterResourceWhitelist: [{group: '*', kind: '*'}]. Anyone who can create applications in the default project can deploy a ClusterRoleBinding from any repository to any registered cluster—effectively cluster admin. The default project can be modified but not deleted, and the official recommendation is to empty its permissions:

apiVersion: argoproj.io/v1alpha1
kind: AppProject
metadata:
  name: default
  namespace: argocd
spec:
  sourceRepos: []
  sourceNamespaces: []
  destinations: []
  namespaceResourceBlacklist:
  - group: '*'
    kind: '*'

After clearing, any application still using default is rejected until it is moved to a project with permissions. So the order is: first create the team projects and migrate applications → then lock down default.

How: the two checks a request goes through

  1. RBAC (who): argocd-server first checks whether “this user / token is allowed to perform project/application perform this action” (M3).
  2. AppProject (what and where): when creating or updating an Application, argocd-server validates whether the source and destination are allowed by the project; the controller validates again on each reconciliation and sync, checking one by one whether each resource kind is allowed (M2).

The two checks are AND related: RBAC allowing you to sync team-a's applications does not mean that application can roll out a ClusterRole.

When: three common tenant models

ModelApproachSuitable forCaveat
Project = teamOne project per team, with destinations restricted to team-x-* namespaces (may span multiple clusters)this lesson's team-a / team-bEnvironment differences (dev/prod) are handled by sync windows and roles
Project = team × environmentteam-a-dev,team-a-prod two projects, with stricter roles on the prod projectprod requires different approversnumber of projects = teams × environments; global projects can reduce duplication
Project = platform layerplatform the project can deploy cluster-scoped resources (CRDs, Ingress controllers, monitoring stack)platform teamonly for the platform team; source repository kept separate and subject to code review

Global projects

In argocd-cm of globalProjects use label selectors to match projects; matched projects inherit the global project's resource allowlists/denylists,syncWindows,sourceRepos,destinations, and destinationServiceAccounts. Suitable for “all prod projects inheriting the same set of prohibitions and freeze windows.”

Comparison with similar technologies

Argo CD AppProjectFlux multi-tenancyKubernetes-native
Boundary carrierAppProject CRD (argocd namespace)One namespace per tenant + the serviceAccountNameNamespace + RBAC + ResourceQuota
Who performs deploymentcontroller SA (optionally impersonating the tenant SA)tenant SA (impersonation is the default practice)the user themselves
Restrict source repositoriessourceReposSource objects live in the tenant namespace; restrictable with policiesnone
UI / SSOBuilt-in UI + SSO + project rolesno built-in UI—
Common misconceptions① “A project can limit how much CPU a Pod uses”—no; that is the job of ResourceQuota / LimitRange, and you should usually put these two kinds of resources on a denylist so tenants cannot change them. ② “If users are in a project role, they are safe”—if a user can use kubectl to directly write argocd an Application in a namespace, they can change spec.project to any project, which makes them equivalent to an Argo CD admin (the official documentation states this explicitly). ③ “A project limits Kubernetes RBAC”—a project only constrains what Argo CD deploys; the controller's own ServiceAccount is usually still at cluster-admin level.

Architecture diagram: three projects, two clusters

argocd namespace (lab) AppProject team-asrc: gitops-lab · dst: team-a-*Cluster-scoped resources: none AppProject team-bsrc: gitops-lab · dst: team-b-*Cluster-scoped resources: none AppProject platformsrc: platform repo · dst: *Cluster-scoped resources: all default: cleared (deny everything) Cluster in-cluster (lab) team-a-dev team-a-prod team-b-dev ingress / monitoring kube-system · argocd (unreachable by any tenant) Cluster-scoped: CRD · ClusterRole · Namespace Cluster lab2 team-a-dev team-a-prod team-b-dev ingress / monitoring kube-system Cluster-scoped resources
Figure 1-1: the project divides “repo × cluster × namespace × resource kind” into non-overlapping regions; the control-plane namespace is not handed to any tenant

Flowchart: checks an Application creation must pass

argocd app createor UI / API Authenticationlocal user / SSO / JWT RBACapplications, create Project validationsource · destination · namespace Controller syncCheck resource kinds one by one Any failing step terminates: 401 unauthenticated · PermissionDenied · InvalidSpecError · SyncError (resource not permitted)
Figure 1-2: Authentication → RBAC → project validation → resource kind check during sync

Interactive: tenant boundary explorer

Select a project to see which “cluster × namespace” cells it can reach. Then tick “default project not locked” to see what a single oversight would grant to whom. Cell colors: green = the project can deploy there; red = cannot deploy; orange = reachable “unintentionally” through the default project.

Core commands and parameters

CommandPurposeKey parameters / notes
argocd proj createCreate project-d SERVER,NS (target),-s REPO (source) ,--description,--upsert
argocd proj get / listView projects-o yaml View the full spec
argocd proj add-source / remove-sourceAdd or remove allowed sourcessupports !REPO negation
argocd proj add-destinationAdd destinationsPROJECT SERVER NAMESPACE (space-separated); add --name indicates the second argument is a cluster name
argocd proj allow-cluster-resourcecluster-scoped resource allowlistPROJECT GROUP KIND, core group written as ""
argocd proj deny-namespace-resourcenamespace-scoped resource denylistPROJECT GROUP KIND
argocd app set APP --project PMove an application to another projectrequires permission on the new project
kubectl -n argocd get appprojView CRDs directlyshort name appproj
argocd proj list
argocd proj get default -o yaml | sed -n '/^spec:/,$p'
NAME     DESCRIPTION  DESTINATIONS  SOURCES  CLUSTER-RESOURCE-WHITELIST  NAMESPACE-RESOURCE-BLACKLIST  SIGNATURE-KEYS  ORPHANED-RESOURCES  DESTINATION-SERVICE-ACCOUNTS
default               *,*           *        */*                         <none>                        <none>          disabled            <none>
spec:
  clusterResourceWhitelist:
  - group: '*'
    kind: '*'
  destinations:
  - namespace: '*'
    server: '*'
  sourceRepos:
  - '*'

How to verify: DESTINATIONS and SOURCES are * means default is still “fully open.”Common mistakes: Adding restrictions to default in the UI but forgetting that default.yaml in Git is overwritten back by the platform root application—projects should also live in Git. Production use: Project YAML is maintained by the platform team in argocd/projects/ and synced after PR review by platform the root application under the project.

# Quick imperative creation (for the lab; for production use the YAML below)
argocd proj create team-a --description "Team A" \
  -s https://github.com/<you>/gitops-lab.git \
  -d https://kubernetes.default.svc,'team-a-*'
argocd proj deny-namespace-resource team-a "" ResourceQuota
argocd proj get team-a

Lab 1: create three projects and lock down default (about 6 minutes)

Write the team-a project (the lab2 destination only takes effect after M5 registers the cluster; writing it now does no harm):
apiVersion: argoproj.io/v1alpha1
kind: AppProject
metadata:
  name: team-a
  namespace: argocd
  finalizers:
  - resources-finalizer.argocd.argoproj.io   # blocks project deletion while applications still reference it
spec:
  description: Team A's applications (may only deploy to team-a-* namespaces)
  sourceRepos:
  - https://github.com/<you>/gitops-lab.git
  destinations:
  - name: in-cluster
    server: https://kubernetes.default.svc
    namespace: 'team-a-*'
  - name: lab2
    namespace: 'team-a-*'
  clusterResourceWhitelist: []          # no cluster-scoped resources allowed
  namespaceResourceBlacklist:
  - group: ''
    kind: ResourceQuota
  - group: ''
    kind: LimitRange
  - group: networking.k8s.io
    kind: NetworkPolicy
  orphanedResources:
    warn: true
Copy as team-b and write the platform project:
cd ~/gitops-lab/argocd/projects
sed -e 's/team-a/team-b/g' -e 's/Team A/Team B/' team-a.yaml > team-b.yaml
apiVersion: argoproj.io/v1alpha1
kind: AppProject
metadata:
  name: platform
  namespace: argocd
spec:
  description: Platform components (CRDs, Ingress, monitoring), platform team only
  sourceRepos:
  - https://github.com/<you>/gitops-lab.git
  - https://argoproj.github.io/argo-helm
  - https://prometheus-community.github.io/helm-charts
  destinations:
  - server: '*'
    namespace: '*'
  - namespace: '!kube-system'      # negation rule: kube-system is not allowed on any cluster
    server: '*'
  clusterResourceWhitelist:
  - group: '*'
    kind: '*'
Apply and check:
kubectl --context kind-lab apply -f ~/gitops-lab/argocd/projects/team-a.yaml \
  -f ~/gitops-lab/argocd/projects/team-b.yaml -f ~/gitops-lab/argocd/projects/platform.yaml
argocd proj list
NAME      DESCRIPTION                       DESTINATIONS                SOURCES                                    CLUSTER-RESOURCE-WHITELIST  NAMESPACE-RESOURCE-BLACKLIST  …
default                                     *,*                         *                                          */*                         <none>
platform  Platform components (CRDs, Ingress, monitoring), …  2 destinations              3 repos                                    */*                         <none>
team-a    Team A's applications (may only deploy to…)      2 destinations              https://github.com/<you>/gitops-lab.git    <none>                      /ResourceQuota, /LimitRange, networking.k8s.io/NetworkPolicy
team-b    …
Try a “wrong migration” first: at the end of Lesson 3,podinfo-dev/staging/prod is generated by ApplicationSet podinfo (project: default). What happens if you edit the generated application directly?
argocd app list -p default -o name
kubectl -n argocd get app podinfo-dev -o jsonpath='{.metadata.ownerReferences[0].kind}/{.metadata.ownerReferences[0].name}{"\n"}'
argocd app set podinfo-dev --project platform
sleep 10; argocd app get podinfo-dev | grep Project
argocd/podinfo-dev
argocd/podinfo-prod
argocd/podinfo-staging
argocd/root
ApplicationSet/podinfo
Project:            default

The project reverts to default: the generated Application is owned by the ApplicationSet controller, which keeps restoring the application spec to the template rendering under its default sync policy (Lesson 3, Module 3). Conclusion: for generated applications, the only correct place to change them is the spec.template.spec.project of the ApplicationSet in Git.

The correct migration: change the template and root application in Git (order matters: move the root application first, then lock default, or the root application itself will be rejected):
cd ~/gitops-lab
grep -rn "project: default" argocd/
# 1) Root application: root is applied by hand (it excludes itself); after editing the file, apply it once more
sed -i 's/^\(\s*\)project: default/\1project: platform/' argocd/root.yaml
kubectl apply -n argocd -f argocd/root.yaml
# 2) ApplicationSet template: spec.template.spec.project for podinfo and podinfo-preview
sed -i 's/^\(\s*\)project: default/\1project: platform/' argocd/appsets/podinfo.yaml argocd/appsets/podinfo-preview.yaml
git add argocd/root.yaml argocd/appsets && git commit -m "move root and generated apps to project platform" && git push
argocd app sync root
sleep 20; argocd app list -o wide | awk '{print $1, $5}' | column -t
NAME                   PROJECT
argocd/podinfo-dev     platform
argocd/podinfo-prod    platform
argocd/podinfo-staging platform
argocd/root            platform

The ApplicationSet controller updates the project of all three applications in place,without recreating the applications or touching the Pods (application names stay the same; even if they were recreated,preserveResourcesOnDeletion: true and the absence of a finalizer keeps the workloads). Use kubectl -n podinfo-dev get pod to confirm that the Pods' AGE has not changed. If podinfo-preview has no open PR right now, it generates no application, but its template must still be changed, or the next PR would generate into the now-locked default project.

Create a dedicated podinfo for team-a (this is a team application, not part of the ApplicationSet podinfo):
# Copy an overlay for team-a (the original dev overlay hard-codes namespace: podinfo-dev)
# Note: do not put it under apps/podinfo/overlays/ — the Git directory generator of the ApplicationSet podinfo would treat it as a new environment,
# and generate an application with project: platform and destination podinfo-team-a-dev. Place it in a separate directory:
mkdir -p ~/gitops-lab/apps/team-a
cp -r ~/gitops-lab/apps/podinfo/overlays/dev ~/gitops-lab/apps/team-a/podinfo-dev
sed -i -e 's#\.\./\.\./base#../../podinfo/base#' -e 's/^namespace: .*/namespace: team-a-dev/' \
  ~/gitops-lab/apps/team-a/podinfo-dev/kustomization.yaml
kustomize build ~/gitops-lab/apps/team-a/podinfo-dev | grep -E '^kind:|namespace:'
cd ~/gitops-lab && git add apps/team-a && git commit -m "team-a podinfo overlay" && git push
argocd app create team-a-podinfo --project team-a \
  --repo https://github.com/<you>/gitops-lab.git --path apps/team-a/podinfo-dev \
  --dest-server https://kubernetes.default.svc --dest-namespace team-a-dev --sync-policy automated
argocd app get team-a-podinfo

If the Lesson 1 overlay does not have namespace: line, add namespace: team-a-dev; on macOS, use sed -i '' for sed. If you added hook Jobs and similar items to the overlay in Lesson 2, make sure they are not on team-a project's denylist.

Lock down default, then confirm that no applications remain in default:
argocd app list -p default        # should be empty
kubectl -n argocd get appset -o custom-columns=NAME:.metadata.name,PROJECT:.spec.template.spec.project   # should no longer show default
kubectl --context kind-lab apply -f ~/gitops-lab/argocd/projects/default.yaml
argocd proj get default
Name:                        default
Description:
Destinations:                <none>
Repositories:                <none>
Scoped Repositories:         <none>
Allowed Cluster Resources:   <none>
Scoped Clusters:             <none>
Denied Namespaced Resources: */*
…
Commit to Git: git add argocd/projects && git commit -m "AppProjects: team-a, team-b, platform; lock default" && git push. The Lesson 3 root application root recursively manages argocd/projects/; after you push, these YAML files (including the locked default.yaml) are continuously synced by the root application, which has been moved to the platform project—from now on, change projects only in Git. Cleanup: this module's objects continue to be used later; no cleanup is needed.

Case 1: a developer deployed a ClusterRoleBinding through the default project

Problem: A company gave all SSO users applications, create, */*, and the only project was default. To debug something, a developer created an application that deployed cluster-admin ClusterRoleBinding from a personal repository. Approach: Create a project for each team with an empty cluster-scoped resource allowlist; grant RBAC only to team-x/*; and lock down default. Configuration: see this module's lab. Limitation: during the migration, all existing applications must be moved first, or they will all error once default is locked.

Case 2: project = team × environment

Problem: The same team's prod releases need a different set of approvers. Approach: Split into team-a (dev/staging) and team-a-prod two projects; grant the prod project's sync only to team-a-release group, and add a freeze window. Configuration: use a global project to unify prod's denylist and windows. Limitation: the number of projects grows, so project YAML must be generated from templates (ApplicationSet / Helm).

Case 3: platform components and business applications mixed in one project

Problem: The Ingress Controller and business applications shared one project. To let the Ingress Controller install CRDs, the project opened all cluster-scoped resources, so business teams could also deploy CRDs. Approach: Put platform components in a separate platform project and their own repository directory, with the platform team as code owners. Limitation: if business applications depend on a CRD, the platform must deliver it first, which creates an ordering dependency (use Lesson 2's Sync Waves or separate applications).

Common errors and fixes

application spec for team-a-podinfo is invalid: InvalidSpecError: application repo https://github.com/x/other.git is not permitted in project 'team-a'

Cause: the application's source repository is not in the project sourceRepos . The URL must match exactly (whether it has .git, http vs. https, letter case).

argocd proj get team-a -o yaml | grep -A5 sourceRepos
argocd app get team-a-podinfo -o yaml | grep repoURL

Fix: standardize the URL format, or add the repository to the project (requires platform review).

InvalidSpecError: application destination server 'https://kubernetes.default.svc' and namespace 'podinfo-dev' do not match any of the allowed destinations in project 'team-a'

Cause: the destination namespace does not match team-a-*. If a Kustomize overlay hard-codes namespace, the rendered result will not match the application's destination.namespace and sync will also fail.

Fix: change the application destination, or create a separate overlay for the team.

application references project team-x which does not exist

Cause: the project name is misspelled, or the project has not synced yet (in App of Apps, the application is created before the project).

Fix: have the project YAML sync earlier than the application (put it in an earlier sync wave, or in a separate projects application).

After locking default, many applications show Unknown / ComparisonError

Cause: some applications are still in the default project.

argocd app list -p default -o name

Fix: temporarily restore default's spec, migrate the applications, then lock it again. For hand-written applications, use argocd app set APP --project P or change the YAML in Git; applications generated by an ApplicationSet (which have ownerReferences) can only be changed through the spec.template.spec.project in the ApplicationSet in Git, otherwise the controller will change them back.

argocd app set podinfo-dev --project platform succeeds, but a few seconds later it reverts to default

Cause: the application is generated by an ApplicationSet, and the controller keeps overwriting the application spec with the template under its applicationsSync policy (default sync).

kubectl -n argocd get app podinfo-dev -o jsonpath='{.metadata.ownerReferences[*].name}'

Fix: change argocd/appsets/podinfo.yaml in spec.template.spec.project and commit; do not switch to create-only or similar policies for this.

Deleting the project gets stuck in Terminating

Cause: the project has resources-finalizer.argocd.argoproj.io, and applications still reference it.

argocd app list -p team-a

Fix: delete or migrate those applications first; this finalizer is an intentional safeguard.

Command-line tasks
1. One command that lists all application names still in the default project.
argocd app list -p default -o name
2. Allow the platform project to create the cluster-scoped Namespace resource (only this one).
argocd proj allow-cluster-resource platform "" Namespace
Scenario analysis
You give team-a developers Kubernetes create/update permission on argocd Application objects in a namespace so they can “manage their own applications with GitOps.” What is the problem with this, and what should you do instead?

Anyone who can write Application objects in argocd a namespace can set spec.project to any project (for example platform); the official documentation explicitly says such users should be treated as Argo CD admins. The correct approach: enable “Applications in any namespace” (M7) so team-a can write Applications in the team-a-apps namespace, and list only this namespace in team-a project's sourceNamespaces ; or have platform's App of Apps generate Applications from the team's repository directory.

Verified teaching videos

▶
Managing Argo CD Multi-Tenancy Effectively - Gerald Nunn, Red Hat — CNCF [Cloud Native Computing Foundation]
English · conference talk · namespace versus cluster scope, global projects, two-layer Argo CD and Kubernetes RBAC
▶
ArgoCD Tutorial for Beginners | GitOps CD for Kubernetes — TechWorld with Nana
English · introductory review (basic relationship between projects and applications); recorded earlier, so for v3 behavior follow this lesson

Official documentation

Video storyboard (about 90 seconds)

Shot 1 · 0–20s
On screen: a gate labeled default swings open; behind it are all clusters and all namespaces.
Narration: after installation, Argo CD comes with the default project, which allows any repository, any cluster, and any resource.
Shot 2 · 20–50s
On screen: the big gate is replaced by three smaller gates, team-a, team-b, and platform; each gate leads only to the namespace cells of its matching color.
Narration: AppProject uses three locks—source, destination, and resource kind—to confine each team to its own area.
Shot 3 · 50–75s
On screen: a red ClusterRoleBinding tries to pass through the team-a gate and is bounced back, showing “not permitted.”
Narration: cluster-scoped resources are not allowed by default; only the platform project can deploy CRDs and ClusterRoles.
Shot 4 · 75–90s
On screen: the default gate is locked, with a sign reading “cleared.”
Narration: finally, clear the default project. Migrate first, then lock.
or get a quiz score of ≥ 70%

Module 2 · Sources, destinations, and cluster resource allowlists

06:00 – 13:00 · A request passes when at least one allow rule matches and no deny rule matches; cluster-scoped resources are all denied by default, and namespace-scoped resources are all allowed by default
7 minCore animation: AppProject validationOrphaned resources · sync windows★★★★★
Learning objectives
  • Write correct sourceRepos (*,**,! negation) and destinations (server / name / wildcards / negation).
  • Explain the default semantics of “allowlist for cluster-scoped resources, denylist for namespace-scoped resources,” and how to restrict Namespace / CRD by name.
  • Enable orphaned-resource monitoring and configure project-level sync windows (allow / deny,manualSync,syncOverrun,timeZone).
Prerequisites: the three projects from Module 1. Importance:★★★★★

What: four groups of rules

1. sourceRepos — where manifests can be pulled from

  • * matches any characters within a single path segment,** matches across multiple path segments; for example https://github.com/my-org/* matches all repositories in that organization,https://gitlab.com/group/** matches nested subgroups.
  • A leading ! marks a negation rule. Decision: passes when any allow rule matches and no negation rule matches. !* is an invalid rule.
  • For multi-source applications (Lesson 2),every source must be allowed, including the sources that only supply ref values.

2. destinations — where things can be deployed

  • Each rule has server (API address) and/or name (cluster name) and namespace, all of which support wildcards and ! negation; matching works the same as for sources.
  • CLI argocd proj add-destination Matching defaults to server; declarative configuration can use name, server, or both. Using name means the project does not need to change when a cluster's address changes (M5 shows that lab2's address is a Docker-internal address).
  • Project-scoped clusters (a cluster Secret with project field, M5) is implicitly added to this project's destinations (all namespaces by default), and this implicit entry does not appear in the project spec or UI. Setting permitOnlyProjectScopedClusters: true can restrict the project so that it deploys only to clusters that belong to it.

3. Resource kinds — what can be deployed

Resource scopeMain mechanismWhen neither is setRestrict by name
Cluster-scoped (Namespace, ClusterRole, CRD, StorageClass…)clusterResourceWhitelist (allowlist) + clusterResourceBlacklistall deniedsupports name (glob), for example to allow only team1-* Namespaces with the name pattern
Namespace-scoped (Deployment, Secret, ResourceQuota…)namespaceResourceBlacklist (denylist) or namespaceResourceWhitelistall allowedCLI allow/deny-namespace-resource can include an optional NAME

When using namespaceResourceWhitelist , child resources that are not allowed (such as ReplicaSet and Pod) are also hidden in the UI resource tree. This affects visibility only, not sync. So in allowlist mode, remember to add apps/ReplicaSet and Pod, or teams will not see Pods and the logs entry point in the UI.

4. Orphaned resources and sync windows

  • orphanedResources: when enabled, top-level namespace-scoped resources in an application's target namespace that “do not belong to any Argo CD application” are flagged; warn: true the application shows OrphanedResourceWarning condition. The following are never treated as orphans: resources denied by the project, the ServiceAccount named default ServiceAccount,default the namespace's kubernetes Service, and each namespace's kube-root-ca.crt ConfigMap; you can use ignore an ignore list (group/kind/name; name supports glob) to exclude them. Performance tip: Do not enable this for large namespaces such as kube-system.
  • syncWindows: kind: allow|deny + cron schedule + duration, using applications / namespaces / clusters to select applications (OR by default; can set andOperator), and can also set timeZone. Rules: no matching window → can sync at any time; matching allow window → sync only while an allow window is active; active deny window → blocked; allow and deny both active → deny takes precedence. manualSync: true Manual sync outside a window is allowed when syncOverrun allows a sync that has already started to continue across the window boundary.

Why: why it is designed this way

Cluster-scoped resources affect all tenants (a single ClusterRoleBinding is enough to escalate privileges, and a CRD upgrade affects every user), so they are off by default and enabled as needed. Namespace-scoped resources are mostly the application's own, so they are allowed by default, with only a few “platform-controlled” resources denied (ResourceQuota, LimitRange, NetworkPolicy, and sometimes RoleBinding).

How: who checks what, and when

  1. argocd-server: when creating or updating an Application, the source and destination are validated (API layer; errors are shown immediately).
  2. application-controller: each reconciliation re-validates source and destination (to stop anyone writing CRs directly with kubectl); if invalid, the application shows InvalidSpecError an InvalidSpecError condition.
  3. controller during sync: after rendering the manifests, it checks each resource: “is this group/kind allowed, and is its namespace within destinations?” Disallowed resources make the sync fail.
  4. Before sync: checks sync windows; when blocked, automatic sync is skipped and manual sync errors (unless manualSync).

When: recommended configuration

ProjectsourceReposdestinationsResourcesWindows
team-a / team-bTeam repository (exact URL)team-x-*, matched by cluster nameCluster-scoped: none; denylist: Quota / LimitRange / NetworkPolicyprod namespaces: allow on weekday daytime,manualSync: true
platformPlatform repo + specified Helm reposall clusters,!kube-systemCluster-scoped: allowlist as needed (avoid *)holiday freeze deny
Common misconceptions① “sourceRepos: ['https://github.com/org/*'] can match org/sub/repo”—a single * does not cross /, you need **. ② “An empty namespace-scoped denylist means nothing can be deployed”—on the contrary, empty means everything is allowed. ③ “Sync windows stop kubectl from changing resources”—windows only control Argo CD sync; self-heal is also automated sync and is blocked by deny windows. ④ “Orphaned resources are deleted automatically”—no, they are only flagged and alerted; deletion is done manually in the UI.

Decision flow: source → destination → resource → window

ApplicationrepoURL · destination · project ① sourceReposany allow matches and no ! matches ② destinationsserver/name + namespace InvalidSpecErrorapplication is not reconciled any failure passes ③ Check each resource during sync (manifests rendered by repo-server) Cluster-scoped kindin clusterResourceWhitelist?and not in clusterResourceBlacklist Namespace-scoped kindnot in namespaceResourceBlacklist(if an allowlist is set, it must be in the allowlist) + ns in destinations ④ Sync windowsno matching window → allowedallow window present → an allow must be activeactive deny → blocked (deny wins) resource not allowed → SyncError: resource GROUP:KIND is not permitted in projectwhether other resources have been applied depends on sync order; the application as a whole shows Sync Failed
Figure 2-1: the API layer and the controller both validate source and destination; resource kinds are checked one by one during sync

Sync window timeline (example: team-a-prod allow on weekdays 09:00–17:00, deny on Fridays 16:00–24:00)

allow 09–17 deny Fri 16–24 00:0009:0017:0024:00 Fri 16:00–17:00: allow and deny both active → blocked; manual sync outside the window requires manualSync: true
Figure 2-2: deny overrides allow

Core animation: how AppProject validates an Application

Select the project and application parameters, then tick the rendered resources. Click “Step through validation” and watch the server / controller check the source, destination, each resource, and the sync window in turn. Rules are taken from this lesson's team-a and platform project definitions.

Project
repoURL
Destination cluster Namespace
Current time (team-a-prod has a window)
Resources rendered by repo-server
After choosing parameters, click “Step through validation.”

Core commands and parameters

CommandPurposeNotes
argocd proj add-source P '!URL'Add a negated sourceIn the shell, ! use single quotes
argocd proj add-destination P lab2 'team-a-*' --nameAdd a destination by cluster nameWithout --name the first argument is the server URL
argocd proj allow-cluster-resource P GROUP KINDcluster-scoped allowlistcore group written as ""
argocd proj deny-namespace-resource P GROUP KINDnamespace-scoped denylist—
argocd proj windows add PAdd a sync window--kind allow|deny --schedule "0 9 * * 1-5" --duration 8h --namespaces … --manual-sync --time-zone
argocd proj windows list PView windows and whether they are currently active—
argocd app get APP --show-operationView the reason for a sync failureCONDITION / MESSAGE columns
argocd app resources APP --orphanedList orphaned resourcesrequires orphanedResources enabled on the project
argocd proj windows add team-a --kind allow --schedule "0 9 * * 1-5" --duration 8h \
  --namespaces 'team-a-prod' --manual-sync --time-zone "America/Toronto"
argocd proj windows list team-a
ID  STATUS    KIND   SCHEDULE      DURATION  APPLICATIONS  NAMESPACES   CLUSTERS  MANUALSYNC  TIMEZONE         USEANDOPERATOR
0   Inactive  allow  0 9 * * 1-5   8h        -             team-a-prod  -         Enabled     America/Toronto  Disabled

How to verify: STATUS is Active/Inactive; argocd app get shows whether the application is currently blocked by a window. Common mistakes: Forgetting --time-zone, cron is interpreted in UTC by default. Production use: prod auto-publishes only during working hours, and holidays are frozen with a deny window.

# Create an orphaned resource and view it
kubectl --context kind-lab -n team-a-dev create configmap hand-made --from-literal=k=v
argocd app resources team-a-podinfo --orphaned
GROUP  KIND       NAMESPACE   NAME       ORPHANED
       ConfigMap  team-a-dev  hand-made  Yes

Lab 2: three out-of-bounds deployments (about 7 minutes)

Wrong source: create an application from a repository that the project does not allow.
argocd app create bad-src --project team-a \
  --repo https://github.com/argoproj/argocd-example-apps.git --path guestbook \
  --dest-server https://kubernetes.default.svc --dest-namespace team-a-dev
FATA[0000] rpc error: code = InvalidArgument desc = application spec for bad-src is invalid: InvalidSpecError: application repo https://github.com/argoproj/argocd-example-apps.git is not permitted in project 'team-a'
Wrong destination: point a team-a application at a team-b namespace.
argocd app create bad-dst --project team-a \
  --repo https://github.com/<you>/gitops-lab.git --path apps/podinfo/base \
  --dest-server https://kubernetes.default.svc --dest-namespace team-b-dev
FATA[0000] … InvalidSpecError: application destination server 'https://kubernetes.default.svc' and namespace 'team-b-dev' do not match any of the allowed destinations in project 'team-a'
Disallowed resource kind: add a ResourceQuota and a ClusterRole to team-a's overlay.
apiVersion: v1
kind: ResourceQuota
metadata: { name: unlimited }
spec: { hard: { pods: "1000" } }
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata: { name: team-a-sneaky }
rules: [{ apiGroups: ["*"], resources: ["*"], verbs: ["*"] }]
cd ~/gitops-lab/apps/team-a/podinfo-dev
kustomize edit add resource sneaky.yaml   # or add it manually to resources in kustomization.yaml
git add . && git commit -m "test: forbidden kinds" && git push
argocd app sync team-a-podinfo
argocd app get team-a-podinfo
…
Sync Status:        OutOfSync from  (3f2a1c9)
Health Status:      Healthy

CONDITION  MESSAGE                                                                            LAST TRANSITION
SyncError  Failed sync attempt to 3f2a1c9: one or more synchronization tasks are not valid   …

GROUP                      KIND           NAMESPACE   NAME           STATUS     HEALTH  HOOK  MESSAGE
                           ResourceQuota  team-a-dev  unlimited      OutOfSync                resource :ResourceQuota is not permitted in project team-a
rbac.authorization.k8s.io  ClusterRole                team-a-sneaky  OutOfSync                resource rbac.authorization.k8s.io:ClusterRole is not permitted in project team-a

Roll back the test commit: git revert HEAD && git push, then argocd app sync team-a-podinfo.

Orphaned resources: run the command from the Commands page: kubectl create configmap hand-made, in the UI open team-a-podinfo, tick “Show Orphaned”, then argocd app get team-a-podinfo check OrphanedResourceWarning conditions. Cleanup: kubectl -n team-a-dev delete cm hand-made.
Sync windows: add a deny window that is “active right now” to team-a and observe that manual sync is rejected:
argocd proj windows add team-a --kind deny --schedule "* * * * *" --duration 1h --applications 'team-a-*'
argocd app sync team-a-podinfo
argocd proj windows list team-a
argocd proj windows delete team-a 1     # use the ID from list
FATA[0001] rpc error: code = PermissionDenied desc = cannot sync: blocked by sync window
Write project changes back to Git: argocd proj get team-a -o yaml Compare argocd/projects/team-a.yaml, add the window configuration to the YAML and commit, to avoid drift between UI/CLI changes and Git.

Case 1: inconsistent URL formats cause “ghost rejections”

Problem: The project specifies https://github.com/org/app.git, while applications generated by the ApplicationSet use https://github.com/org/app, and some applications show InvalidSpecError. Approach: Use one consistent form, either without .git or with .git ; or use https://github.com/org/* in the project. Limitation: Wildcards widen the scope; when the organization has personal forks, pair them with negation rules.

Case 2: a team escalates its own privileges with RoleBinding

Problem: The denylist only blocked Quota, so the team deployed a RoleBinding in its own namespace that bound admin ClusterRole to an external SA. Approach: Add RoleBinding rbac.authorization.k8s.io/RoleBinding,Role and ClusterRoleBinding to the namespace denylist, managed centrally by the platform; or use admission policies (Kyverno / Gatekeeper / ValidatingAdmissionPolicy) to restrict which roles can be bound. Limitation: Some Helm charts ship their own Role/RoleBinding and must go into the platform project after platform approval.

Case 3: year-end freeze

Problem: No releases are allowed in the last two weeks of December, but security patches must still be deployable. Approach: Add to the global project kind: deny a window that matches *-prod namespaces,manualSync: true with manual sync enabled for on-call staff; in RBAC, grant sre-oncall group sync. Limitation: A deny window also blocks self-heal; manual changes made during the freeze will not be corrected, so monitor OutOfSync.

Common errors and fixes

resource rbac.authorization.k8s.io:ClusterRole is not permitted in project team-a

Cause: cluster-scoped resources are not in clusterResourceWhitelist . Helm charts often also create ClusterRoles / CRDs as a side effect.

argocd app manifests APP | grep -E '^kind:' | sort | uniq -c

Fix: have the platform put such components in the platform project, or disable the chart option that creates cluster-scoped resources (for example rbac.create=false,crds.install=false).

resource :ResourceQuota is not permitted in project team-a

Cause: matches the namespace-scoped denylist (the core group is shown empty, so there is only a colon before it). Fix: Remove it from the team's manifests; the platform distributes quotas.

cannot sync: blocked by sync window

Cause: an active deny window exists, or a matching allow window exists but the current time is outside every allow window.

argocd proj windows list PROJECT
argocd app get APP | grep -i window

Fix: wait for the window, use manualSync the manual sync permitted by the window, or temporarily disable the window (with approval). Watch the cron time zone.

The application keeps showing OrphanedResourceWarning

Cause: the namespace has resources that belong to no application (common cases: Secrets auto-generated by an Operator, manually created debug Pods).

Fix: In the project, orphanedResources.ignore exclude them in the ignore list (glob names are supported), or first set warn: false to show them only in the UI.

The project allows lab2, but the application still reports a destinations mismatch

Cause: The project specifies destinations by name: lab2 , while the application specifies by server (or vice versa), and the cluster is not yet registered, so the name cannot be resolved; or the cluster was registered under a different name.

argocd cluster list

Fix: After confirming the cluster name matches the server, specify both name and server in the project, or use one form consistently.

Command-line tasks
1. Prevent team-b from pulling manifests from https://github.com/you/gitops-lab-experimental.git even if someone later widens sourceRepos to *.
argocd proj add-source team-b '!https://github.com/you/gitops-lab-experimental.git'
2. Allow only the platform project to create Namespaces whose names start with monitoring prefix; use the declarative form.
spec:
  clusterResourceWhitelist:
  - group: ''
    kind: Namespace
    name: 'monitoring*'
Scenario analysis
The team-a Helm chart needs a CRD. The team asks to allow apiextensions.k8s.io/CustomResourceDefinition. How would you review this?

A CRD is cluster-scoped and shared by all tenants; once opened, team-a can modify or delete CRDs that others depend on (deleting a CRD cascade-deletes all CRs of that kind). Recommendation: deliver the CRD through a separate application in the platform project (set the chart to skip CRDs, or use --skip-crds an equivalent setting), and let team-a deploy only CRs; if it must be opened, use the allowlist's name field to restrict it to the specific CRD name, and pair it with code review.

Verified teaching videos

▶
Argo CD Self-Heal, Sync Windows and Diffing — mkdev
English · the relationship between sync windows and self-heal
▶
Scaling Argo Security and Multi-Tenancy in AWS EKS at the New York... David Grizzanti & Luke Philips — CNCF [Cloud Native Computing Foundation]
English · conference talk · tenant rules, projects, and how they combine with AWS IAM

Official documentation

Video storyboard (about 90 seconds)

Shot 1 · 0–20s
On screen: an Application card passes through three gates in turn: source, destination, resource.
Narration: every application must pass three gates: where it is pulled from, where it is deployed, and what it deploys.
Shot 2 · 20–45s
On screen: in the sourceRepos list, one allow rule lights up green and one negation rule lights up red; the result is rejection.
Narration: it passes only when some allow rule matches and no negation rule matches.
Shot 3 · 45–70s
On screen: the rendered resource list flashes by one item at a time, and ClusterRole gets a red cross.
Narration: cluster-scoped resources are all denied by default, namespace-scoped resources are all allowed by default, and only the denylist blocks.
Shot 4 · 70–90s
On screen: on the timeline, a green allow window overlaps a red deny window; the overlap is shown in red.
Narration: in sync windows, deny always takes precedence over allow.
or get a quiz score of ≥ 70%

Module 3 · RBAC: policy.csv, roles, and project tokens

13:00 – 21:00 · One g line puts people into roles; one p line grants role permissions; the default policy is evaluated first, deny always wins, and no allow means denial
8 minCore animation: RBAC decisionsv3: logs enforced · update/delete not inherited★★★★★
Learning objectives
  • Read and write argocd-rbac-cm: policy.csv (p and g lines),policy.default,scopes,policy.matchMode,policy.<any>.csv concatenated.
  • Learn the format of resources, actions, and objects: application-type resource objects are <project>/<application>, other resources have their own formats; know the two breaking changes in v3.
  • Use project roles and JWT tokens to give CI least privilege, and revoke them; use argocd admin settings rbac can and argocd account can-i to test policies.
Prerequisites: Projects from Modules 1–2. Importance:★★★★★

What: components of Argo CD RBAC

Argo CD has no user management system of its own, only one built-in super user admin. To use RBAC, you first need to configure SSO (M4) or local users. Policies come from two places: the global argocd-rbac-cm ConfigMap, and the AppProject's roles. The syntax is based on Casbin:

g, <user/group>, <role>                                   # put a user or SSO group into a role
p, <role/user/group>, <resource>, <action>, <object>, <allow|deny>  # grant permission to a subject
ResourceCommon actionsObject format
applicationsget, create, update, delete, sync, rollback, action/…, overrideproject/application; when applications in any namespace are enabled, use project/namespace/application (M7)
applicationsetsget, create, update, deleteproject/name (project = the project it can generate applications in)
logsgetproject/application
execcreateproject/application (also requires enabling in argocd-cm exec.enabled)
clustersget, create, update, deletecluster server URL; project-scoped clusters use project/URL; does not accept cluster names
projects,repositories,write-repositories,accounts,certificates,gpgkeysget, create, update, delete (depending on the resource)name or URL
extensionsinvokeextension (and requires get on the corresponding application)

Built-in roles and default policy

  • role:readonly: get on all resources (including logs, get, */*); role:admin: full permissions, inherits readonly; built-in g, admin, role:admin. Definition in assets/builtin-policy.csv.
  • policy.default: every authenticated user gets at least the permissions of this role, and these permissions cannot be revoked by deny rules. The official recommendation is to set it to a minimal custom role (such as role:authenticated) or leave it empty, rather than role:readonly.
  • scopes: which claims in the OIDC token RBAC reads as “groups”; default '[groups]'; can be set to '[groups, email]' so you can grant access directly by email.

How: order of evaluation (official “Policies Evaluation and Matching”)

  1. First use the default policy to decide: if the default role already allows (or denies), the result takes effect immediately and evaluation stops.
  2. Otherwise, check in turn using the user itself, then the each group (from scopes) to match; g rows expand role inheritance (for example g, role:admin, role:readonly). Project roles are generated at runtime: g, <group>, proj:<project>:<role>.
  3. Matching mode policy.matchMode default glob: / is not a separator,* can span /.
  4. As soon as one matching deny rule matches, the request is refused; after all matches are evaluated, it is allowed only if at least one allow matches and no deny does; no match at all = deny. The order of policies does not affect the result.

The two breaking changes in v3 (verified)

Changev2 behaviorv3 behaviorMigration
logs permission enforced by defaulthaving applications, get is enough to read logs (unless server.rbac.log.enforce.enable is enabled)this switch is removed; you must explicitly grant logs, get, otherwise the Pod's Logs tab is not visible in the UIRecommended: for each role that has applications, get roles, add p, ROLE, logs, get, project/*, allow. policy.default Roles for role:readonly or role:admin are not affected
update / delete no longer inherited to child resourcesupdate/delete on an application also applies to the resources it manages (such as deleting a Pod)only applies to the Application itself; for managed resources you must write update/*,delete/* or finer-grained delete/<group>/<kind>/<ns>/<name>in argocd-cm set server.rbac.disableApplicationFineGrainedRBACInheritance: "false" can restore v2 behavior

Related switches that are off by default: server.rbac.rollback.enforce.enable (separate rollback action, still uses sync permission by default), and application.sync.requireOverridePrivilegeForRevisionSync (syncing to a specified revision requires override). From v3.0 on, when using Dex, the user subject in RBAC changes to federated_claims.user_id instead of sub (M4).

Project roles and JWT tokens

Each role in an AppProject's roles has policies (can only grant permissions on this project's objects; the subject must be written as proj:<project>:<role>) and groups (SSO groups). Project roles can issue JWT tokens: tokens are issued by the API server, and Argo CD does not store the token itself, only records the issue time (iat) and ID in the project; tokens can have an expiry (CLI default never expires). Deleting the record revokes the token immediately; changing the role policy takes effect immediately for existing tokens. CI uses --auth-token or an environment variable ARGOCD_AUTH_TOKEN to use it.

When: how to divide

  • Cross-project roles (platform admin, read-only audit) go in argocd-rbac-cm; team-specific finer roles (developer, release, ci) go in each AppProject's roles, reviewed together with the team's project YAML.
  • Do not use the same subject names for local users and SSO groups: the official warning is that an SSO user who has a group with the same name as a local user gets that local user's role. For local users, prefer writing p lines directly.
  • For large policies, use policy.team-a.csv such additional keys to split them (concatenated in key-name order after policy.csv , making overlays with Kustomize / Helm easier.

Comparison with Kubernetes RBAC

Argo CD RBACKubernetes RBAC
Protected objectArgo CD API (applications, projects, clusters, repositories, logs, exec)Kubernetes API
denysupported, and takes precedencenot supported (allow only)
Subject sourceslocal users, SSO groups/emails, project JWTsUser, Group, ServiceAccount
Who actually changes the clusterthe controller's SA (or impersonation SA)the caller themselves
Common misconceptions① “policy.default: role:readonly is safe”—every logged-in user can see the application lists and cluster lists of all projects, and deny cannot revoke this. ② “p, g-team, … directly write the group name”—official note: the group must first be bound to a role via g, group, role ; otherwise p, group, … will not be considered. ③ “applications, *, team-a/* already includes logs”—logs is a separate resource and must be granted separately. ④ “Cluster permissions can use the cluster name”—clusters clusters objects must be server URLs.

Architecture diagram: identity → subject → role → policy

Local user alicepassword in argocd-secret SSO user davegroups: [my-org:team-a] CI JWT tokensub: proj:team-a:ci g lines (including those generated by project roles) g, alice, role:team-a-dev g, my-org:team-a, role:team-a-dev g, my-org:team-a, proj:team-a:developer g, role:admin, role:readonly (the token subject is the project role itself) p lines role:team-a-dev applications get team-a/* role:team-a-dev applications sync team-a/* role:team-a-dev logs get team-a/* role:team-a-dev applications delete team-a/* deny proj:team-a:ci applications sync team-a/team-a-podinfo allow deny ① policy.default is evaluated first (a match takes effect immediately and cannot be revoked by deny) ② user → each group ③ any deny → refused ④ allow with no deny → allowed ⑤ no match → refusedin glob matching, “/” is not a separator
Figure 3-1: subjects are expanded into roles via g lines, then matched against p lines

Sequence diagram: CI syncs with a project token

CI jobargocd-serverAppProject team-acontroller argocd app sync --auth-token JWT Verify signature + check whether iat/id still exists in the role record Current policies of role ci RBAC: applications, sync, team-a/team-a-podinfo → allow Write operation (Application CR) Operation Succeeded / PermissionDenied
Figure 3-2: revoking a token = deleting the token record in the role; policy changes take effect immediately

Core animation: RBAC decision for one request

Choose “who”, “what action”, and “which object”, as well as policy.default. The animation steps through: identity → subject (user + groups) → expand into roles via g lines → default policy → match p lines (green allow / red deny) → result. The policy comes from this module's policy.csv and the team-a project role (simplified; you can edit it in the box below and re-evaluate).

Subject
Resource / action
Object
policy.default
policy.csv (editable)
After choosing parameters, click “Step through evaluation.”

Core commands and parameters

CommandPurposeNotes
argocd admin settings rbac validate --policy-file FValidate policy syntaxF can be a csv or an argocd-rbac-cm YAML
argocd admin settings rbac can SUBJECT ACTION RESOURCE [OBJ]Offline / online testing--policy-file,--default-role,--namespace argocd (reads the live CM)
argocd account can-i ACTION RESOURCE OBJTest with the currently logged-in identityOutputs yes / no
argocd account list / get-user-infoView the account, current identity, and groupsget-user-info shows Groups
argocd account update-password --account USet a password for a local user--current-password is the executing account (admin) password
argocd proj role create / add-policy / add-groupManage project rolesadd-policy -a sync -o APP -p allow -r applications
argocd proj role create-token P ROLEIssue JWT-e 24h expiry,-t output only the token,-i specify the ID
argocd proj role delete-token P ROLE ISSUED-ATRevoke tokensISSUED-AT from proj role get check
cat > /tmp/policy.csv <<'EOF'
p, role:team-a-dev, applications, get, team-a/*, allow
p, role:team-a-dev, applications, sync, team-a/*, allow
g, alice, role:team-a-dev
EOF
argocd admin settings rbac validate --policy-file /tmp/policy.csv
argocd admin settings rbac can alice sync applications 'team-a/team-a-podinfo' --policy-file /tmp/policy.csv
argocd admin settings rbac can alice get logs 'team-a/team-a-podinfo' --policy-file /tmp/policy.csv
argocd admin settings rbac can alice sync applications 'team-b/team-b-podinfo' --policy-file /tmp/policy.csv
Policy is valid.
Yes
No
No

How to verify: The second line No is the v3 logs enforcement — get/sync alone is not enough to view logs. Common mistakes: The argument order is subject action resource object (action comes before resource), which differs from the column order in policy.csv. Production use: Put rbac can into CI, and for every PR on argocd-rbac-cm run a set of “should be Yes / should be No” assertions.

Lab 3: local user + team role + CI token (about 8 minutes)

Add local users and RBAC in Helm values (append to ~/gitops-lab/bootstrap/argocd-values.yaml, merging with the existing configs: ):
configs:
  cm:
    accounts.alice: login            # UI/CLI login only; do not issue apiKey
    accounts.bob: login
  rbac:
    policy.default: ""               # give authenticated users no default permissions
    scopes: "[groups, email]"
    policy.csv: |
      # ---- Platform admins (SSO group, effective in M4) ----
      g, my-org:platform, role:admin
      # ---- team-a ----
      p, role:team-a-dev, applications, get, team-a/*, allow
      p, role:team-a-dev, applications, sync, team-a/*, allow
      p, role:team-a-dev, applications, action/*, team-a/*, allow
      p, role:team-a-dev, applications, delete/*/Pod/*/*, team-a/*, allow
      p, role:team-a-dev, applications, delete, team-a/*, deny
      p, role:team-a-dev, logs, get, team-a/*, allow
      p, role:team-a-dev, projects, get, team-a, allow
      p, role:team-a-dev, clusters, get, *, allow
      p, role:team-a-dev, repositories, get, *, allow
      g, my-org:team-a, role:team-a-dev
      # ---- team-b ----
      p, role:team-b-dev, applications, get, team-b/*, allow
      p, role:team-b-dev, applications, sync, team-b/*, allow
      p, role:team-b-dev, logs, get, team-b/*, allow
      p, role:team-b-dev, projects, get, team-b, allow
      g, my-org:team-b, role:team-b-dev
      # ---- Local users: write p lines directly (avoids ambiguity with SSO groups of the same name) ----
      p, alice, applications, get, team-a/*, allow
      p, alice, applications, sync, team-a/*, allow
      p, alice, logs, get, team-a/*, allow
      p, alice, projects, get, team-a, allow
      p, bob, applications, get, team-b/*, allow
      p, bob, applications, sync, team-b/*, allow
      p, bob, logs, get, team-b/*, allow
      p, bob, projects, get, team-b, allow
helm upgrade argocd argo/argo-cd --version 10.18.0 -n argocd -f ~/gitops-lab/bootstrap/argocd-values.yaml --wait
kubectl -n argocd get cm argocd-rbac-cm -o yaml | head -40
argocd account list
NAME   ENABLED  CAPABILITIES
admin  true     login
alice  true     login
bob    true     login
Set password and log in as alice:
ADMIN_PW='Lab-Argo-2026!'      # the lab admin password set in Lesson 1
argocd account update-password --account alice --current-password "$ADMIN_PW" --new-password 'Alice-Lab-2026!'
argocd account update-password --account bob   --current-password "$ADMIN_PW" --new-password 'Bob-Lab-2026!'
argocd login localhost:8080 --insecure --username alice --password 'Alice-Lab-2026!'
argocd app list
argocd account can-i sync applications 'team-a/team-a-podinfo'
argocd account can-i sync applications 'team-b/*'
argocd app delete team-a-podinfo --yes
NAME                    CLUSTER                         NAMESPACE   PROJECT  STATUS  HEALTH   …
argocd/team-a-podinfo   https://kubernetes.default.svc  team-a-dev  team-a   Synced  Healthy  …
yes
no
FATA[0000] rpc error: code = PermissionDenied desc = permission denied: applications, delete, team-a/team-a-podinfo, sub: alice, iat: …

alice can only see team-a's applications (the list is filtered by get permission) and cannot delete.

Experience v3 logs enforcement: temporarily remove alice's logs, get line and helm upgrade, in the UI open a Pod of team-a-podinfo: the Logs tab disappears; argocd app logs team-a-podinfo returns PermissionDenied. Restore the line before trying again.
Create a project role and token for CI (switch back to admin):
argocd login localhost:8080 --insecure --username admin --password "$ADMIN_PW"
argocd proj role create team-a ci --description "CI: can only sync team-a-podinfo"
argocd proj role add-policy team-a ci -a sync -o team-a-podinfo -p allow
argocd proj role add-policy team-a ci -a get  -o team-a-podinfo -p allow
TOKEN=$(argocd proj role create-token team-a ci -e 24h -t)
argocd app sync team-a-podinfo --auth-token "$TOKEN"
argocd app sync team-b-podinfo --auth-token "$TOKEN"
argocd proj role get team-a ci
…
Message:            successfully synced (all tasks run)
FATA[0000] rpc error: code = PermissionDenied desc = permission denied: applications, sync, team-b/team-b-podinfo, sub: proj:team-a:ci, iat: …
Role Name:     ci
Description:   CI: can only sync team-a-podinfo
Policies:
p, proj:team-a:ci, applications, sync, team-a/team-a-podinfo, allow
p, proj:team-a:ci, applications, get, team-a/team-a-podinfo, allow
Groups:
JWT Tokens:
ID          ISSUED AT                                  EXPIRES AT
1763371200  2026-11-17T10:00:00Z (0 minutes ago)       2026-11-18T10:00:00Z (23 hours from now)
Revoke and verify:
argocd proj role delete-token team-a ci 1763371200    # use the ISSUED AT number from the previous step
argocd app get team-a-podinfo --auth-token "$TOKEN"
FATA[0000] rpc error: code = Unauthenticated desc = invalid session: …
Write the role back to Git: add argocd/projects/team-a.yaml to roles (policies and groups) and commit. The issuance record of tokens is written to the project object by the API; if that project is synced from Git by Argo CD with self-heal enabled, you need to configure ignoreDifferences so that sync does not overwrite the record (which would be equivalent to revoking it); the exact field depends on the project object in the version you use (kubectl -n argocd get appproj team-a -o yaml to view).

Case 1: after upgrading to v3, developers “cannot see logs”

Problem: After upgrading from 2.14 to 3.0, developers reported that the Pod Logs tab in the UI disappeared. Approach: Following official guidance, for each role that has applications, get grant logs, get, with the same scope as the applications. Configuration:p, role:team-a-dev, logs, get, team-a/*, allow. Limitation: The quick fix is to set policy.default to a role with logs, but that lets everyone see all logs, violating least privilege.

Case 2: policy.default leaks information

Problem: For “convenience”,policy.default: role:readonly, so contractors who log in can see all applications in all projects, internal domain names in Helm values, and the cluster list. Approach: change it to empty or a minimal role role:authenticated (allow only projects, get a shared project), and grant everything else by group. Limitation: default permissions cannot be revoked by deny, so you can only tighten default itself.

Case 3: CI uses the admin password

Problem: The pipeline has the admin password written in it; a former employee who copies it can still log in. Approach: create a ci role in each team project, with tokens that have an expiry, stored in the CI secret store and rotated quarterly; disable admin (admin.enabled: "false") and use SSO. Limitation: Non-expiring tokens are high-risk; a project token can only operate on its own project, so cross-project pipelines need multiple tokens or a global local account (accounts.ci: apiKey).

Common errors and fixes

permission denied: applications, sync, team-a/team-a-podinfo, sub: alice, iat: 1763371200

Cause: There is no matching allow, or there is a deny. The error message gives the four-tuple used in the decision; copy it directly for testing.

argocd admin settings rbac can alice sync applications 'team-a/team-a-podinfo' --namespace argocd
kubectl -n argocd get cm argocd-rbac-cm -o jsonpath='{.data.policy\.csv}' | grep -n alice

Fix: add an allow line, or check the object format (whether the three-part project/namespace/application format is needed).

SSO user sees nothing after logging in (empty application list)

Cause: Group names do not match policy.csv (case, org prefix, Entra uses group object IDs), or scopes the claim containing the group is not included.

argocd account get-user-info

Fix: write g lines using the Groups text exactly as get-user-info shows.

policy.csv was changed but has no effect

Cause: Helm values indentation is wrong, so the key is not policy.csv; or the CM was changed in the UI/kubectl and then overwritten by Helm/Argo CD.

kubectl -n argocd get cm argocd-rbac-cm -o yaml
argocd admin settings rbac validate --namespace argocd

Fix: treat the values in Git as the only source of truth; argocd-server watches CM changes, so no restart is needed.

Project role policy error: policy subject must be: 'proj:team-a:ci'

Cause: the subject of a project role policy must be proj:<project>:<role>, and the object must be within this project. Fix: write cross-project grants to argocd-rbac-cm.

Revoked token still works / new token immediately invalid

Cause: The project is synced from Git, so the token records were overwritten or restored by the sync. Fix: configure ignoreDifferences for the token records in the project object, or use the RespectIgnoreDifferences sync option; after revoking, use argocd proj role get to confirm the record was deleted.

Command-line tasks
1. Offline test: use the argocd-rbac-cm.yaml file to check whether the SSO group my-org:team-b can view team-b/api logs.
argocd admin settings rbac can my-org:team-b get logs 'team-b/api' --policy-file argocd-rbac-cm.yaml
2. Write one policy line: allow role:oncall to run the Deployment restart action on applications in all projects.
p, role:oncall, applications, action/apps/Deployment/restart, */*, allow
Scenario analysis
The team wants developers to be able to delete stuck Pods, but not delete the Application itself, and not modify the Deployment. Write the v3 policy and explain why the same requirement is harder to implement under v2.

p, role:team-a-dev, applications, delete/*/Pod/*/*, team-a/*, allow and p, role:team-a-dev, applications, delete, team-a/*, deny, without granting update/*. In v3, delete only applies to the application itself; child resources must be written separately as delete/…, so you can “allow deleting Pods but refuse deleting the application.” Under v2 (or with fine-grained inheritance disabled), an application-level delete allow is inherited by all child resources, and the documentation notes that once an application-level action is explicitly allowed, child resources can no longer be denied.

Verified teaching videos

▶
🔐 ArgoCD User Management & RBAC Explained 👥 | Create Users, Passwords & Okta SSO 🌐 — Ashok Kumar
English · local users, passwords, policy.csv, and SSO; note that if a video is based on v2, the logs and update/delete behavior follows this lesson's v3 description
▶
Managing Argo CD Multi-Tenancy Effectively - Gerald Nunn, Red Hat — CNCF [Cloud Native Computing Foundation]
English · design of the two-layer Argo CD RBAC and Kubernetes RBAC

Official documentation

Video storyboard (about 90 seconds)

Shot 1 · 0–20s
On screen: three identity cards (local user, SSO user, CI token) enter argocd-server.
Narration: Argo CD recognizes only three kinds of identities: local users, SSO users, and project tokens.
Shot 2 · 20–45s
On screen: g lines like arrows connect the identity cards to role badges, and role badges connect to inherited roles.
Narration: g lines put users and groups into roles; project roles automatically generate g lines at runtime.
Shot 3 · 45–70s
On screen: the request four-tuple slides across the list of p lines; a green allow and a red deny light up together; the result is red.
Narration: the default policy is evaluated first, then the user and groups. A single deny refuses; no allow at all also refuses.
Shot 4 · 70–90s
On screen: the Logs tab goes from gray to bright, and logs, get appears beside it.
Narration: from v3, viewing logs needs logs get granted separately; deleting an application and deleting a Pod are also two different things.
or get a quiz score of ≥ 70%

Module 4 · SSO: Dex and OIDC (GitHub / Entra ID)

21:00 – 28:00 · Identity is handled by the identity provider and group claims by RBAC: GitHub groups are org:team, and Entra ID groups are object IDs
7 minDex v2.46.1 (bundled with the chart)GitHub OAuth App · Entra App Registration★★★★☆
Learning objectives
  • Distinguish two SSO approaches: the built-in Dex (dex.config, callback /api/dex/callback) and direct OIDC (oidc.config, callback /auth/callback), and know when to choose which.
  • Configure the Dex GitHub connector (orgs,teams,teamNameField), and map the group claim my-org:team-a to roles.
  • Configure Entra ID: group claims (object IDs),requestedIDTokenClaims, Workload Identity credentials, 200-group overflow; understand the v3 Dex subject change and when groups refresh.
Prerequisites: Module 3's policy.csv and basic OIDC concepts (ID token, scope, claim). Importance:★★★★☆

What: two SSO approaches

Built-in DexDirect OIDC (Existing OIDC Provider)
Configuration keys (argocd-cm)dex.configoidc.config
Callback URLhttps://<argocd>/api/dex/callback (Argo CD sets redirectURI automatically)https://<argocd>/auth/callback; the CLI additionally needs http://localhost:8085/auth/callback
Applies tothe identity provider does not support OIDC (SAML, LDAP), or Dex connector capabilities are needed (GitHub org/team → groups)an existing OIDC provider that manages groups: Okta, Entra ID, Keycloak, Google, etc.
Where groups come fromproduced by the connector (GitHub: org:team)of the ID token groups claim (or the UserInfo endpoint)
Extra componentsargocd-dex-server Deploymentnone (Dex can be turned off in the chart: dex.enabled: false)

Both approaches require setting argocd-cm in url (the external access address for Argo CD). Client secrets written as $keyname are read from argocd-secret , and written as $other-secret-name:keyname are read from that Secret—this Secret must carry the label app.kubernetes.io/part-of: argocd.

Why: why not use local users

Local users' passwords are stored in argocd-secret, and leaving or changing groups must be maintained by hand; SSO makes the identity provider the single source of truth, with MFA, conditional access, and audit done there, and Argo CD only consumes group claims.

How: GitHub (via Dex)

  • Create an OAuth App in GitHub, OAuth App with the callback set to https://<argocd>/api/dex/callback, and obtain the client ID / secret.
  • The Dex GitHub connector queries the organizations listed in groups scope when requesting orgs , and the group claim format is (org):(team); if teams is listed, only those teams are returned. teamNameField decides whether to use the team display name,slug or both—it is recommended to set it explicitly to slug, so that renaming a team does not break the policy.
  • From v3.0, when using Dex, the user subject in RBAC changes to federated_claims.user_id (Argo CD requests Dex's federated:id scope), no longer the internal Dex-encoded sub. Old policies written against the user need to be migrated.
  • Group information is fetched only at login; after removing a person from a group, their permissions remain until re-authentication—mitigate with a shorter token lifetime.

How: Microsoft Entra ID (direct OIDC)

  • App registration: Web platform callback https://<argocd>/auth/callback; “Mobile and desktop” platform callback http://localhost:8085/auth/callback (CLI); grant Microsoft Graph User.Read; in Token configuration Add groups claim; in Enterprise application, assign users/groups.
  • oidc.config: issuer: https://login.microsoftonline.com/<tenant>/v2.0,clientID,requestedIDTokenClaims: {groups: {essential: true, value: "ApplicationGroup"}},requestedScopes: [openid, profile, email].
  • Two options for credentials: client secret ($oidc.azure.clientSecret), or the officially recommended Workload Identity federated credentials: azure: {useWorkloadIdentity: true}, add a label to the argocd-server Pod azure.workload.identity/use: "true", add an annotation to the SA azure.workload.identity/client-id, and add a federated credential in the App registration (AKS OIDC issuer + argocd namespace + argocd-server SA). This part requires AKS; see AKS course.
  • The group claim is the group's object ID (GUID), so policy.csv is written with g, "84ce98d1-…", role:team-a-dev.
  • With more than 200 groups Entra does not put groups in the token, but an overflow indicator; in oidc.config set azure.enableUserGroupOverageClaim: true, Argo CD fetches the full group list through the Graph API (users cannot log in when Graph is unavailable).

When: which to choose

ScenarioRecommended
team identities are in GitHub org/teamDex + GitHub connector
enterprise uses Entra ID / Okta, with groups managed in the IdPDirect OIDC (one fewer component; supports PKCE and refreshTokenThreshold)
LDAP / SAMLDex (LDAP and SAML connectors)
need the UserInfo endpoint to supplement groupsDirect OIDC's enableUserInfoGroups, or Dex OIDC connector's getUserInfo
Common misconceptions① “Just write the group name in Entra”—by default it is a GUID; using group names needs extra claim configuration, and names can change and collide. ② “After changing a GitHub team, Argo CD takes effect immediately”—groups refresh only at authentication. ③ “Admin can be disabled once SSO is on”—first confirm that at least one SSO group has role:admin, then set admin.enabled: "false", otherwise you lock yourself out. ④ “Dex's sub can be used as the user ID in policy”—from v3, the subject is federated_claims.user_id.

Sequence diagram: GitHub login via Dex

Browserargocd-serverargocd-dex-serverGitHub LOG IN VIA GITHUB /api/dex/auth (proxy) OAuth2 authorize (read:org) user consents → callback /api/dex/callback?code=… exchange token, query orgs/teams Dex issues ID Token {"email":"dave@corp","groups":["my-org:team-a"],"federated_claims":{"connector_id":"github","user_id":"1234567"}} set session cookie (argocd.token) for each subsequent API request: scopes [groups, email] → subject = user_id + groups → RBAC (Module 3)
Figure 4-1: Dex converts GitHub's org/team into standard OIDC groups claims

Comparison diagram: Entra ID direct OIDC

Browser / CLICLI callback :8085 argocd-server/auth/callback · PKCE optional Entra IDlogin.microsoftonline.com/<tenant>/v2.0 ID Token groups:["84ce98d1-…"]>200 groups → overflow indicator→ Graph API supplements Client credentials: clientSecret or Workload Identity (argocd-server SA federated credential, no secret)
Figure 4-2: Direct OIDC does not go through Dex, and groups are GUIDs

Interactive: from login to role

Select an identity provider and user, and step through the OIDC authorization code flow, and how the claims in the token scopes become RBAC subjects, then map to roles via g lines.

Click “Play”.

Core commands and configuration

Command / keyPurposeNotes
argocd login HOST --ssoCLI SSO loginOpens the browser; callback localhost:8085; --sso-port the port can be changed
argocd account get-user-infoView the current user and groupsView the Groups text here before writing g lines
argocd-cm: urlExternal access addressRequired for SSO; separate multiple addresses with additionalUrls
argocd-cm: dex.configDex connectorsDex reloads automatically after changes
argocd-cm: oidc.configDirect OIDCissuer,clientID,requestedScopes,requestedIDTokenClaims,enablePKCEAuthentication,refreshTokenThreshold,logoutURL,rootCA
argocd-cm: dex.auth.connectorIdJump directly to a Dex connector (Alpha)Avoid the selection page when there are multiple connectors
kubectl -n argocd logs deploy/argocd-dex-serverDex troubleshootingView connector errors and callback errors
argocd login localhost:8080 --insecure --sso
argocd account get-user-info
Opening browser for authentication
Performing authorization_code flow login: https://localhost:8080/api/dex/auth?…
Authentication successful
'dave@corp.example' logged in successfully
Context 'localhost:8080' updated
Logged In: true
Username: dave@corp.example
Issuer: https://localhost:8080/api/dex
Groups: my-org:team-a

How to verify: The Groups line is the group string that RBAC can use. Common mistakes: The browser callback on 8085 is blocked by a firewall or remote desktop; on a remote machine, use --sso-port or SSH port forwarding. Production use: CI does not use SSO; use project tokens (M3), or Dex token exchange / external OIDC ID tokens (see the official “CI/CD Pipeline Authentication” section).

Lab 4 (optional, requires a GitHub organization): Dex + GitHub SSO (about 7 minutes)

Prerequisites You need a GitHub organization where you can create teams (hereafter my-org), and create in it team-a,platform teams. Learners without an organization can read the steps and go through the get-user-info commands on the Commands page for understanding only. The lab uses port-forward's https://localhost:8080, and the browser will warn about a self-signed certificate.
Register a GitHub OAuth App: GitHub → Settings → Developer settings → OAuth Apps → New. Homepage URL: https://localhost:8080; Authorization callback URL: https://localhost:8080/api/dex/callback. Note the Client ID and generate a Client secret. If the organization has restricted OAuth App access, an organization administrator must approve the app.
Put the secret in a separate Secret (not in Git):
kubectl -n argocd create secret generic argocd-sso \
  --from-literal=dex.github.clientSecret='<GitHub client secret>'
kubectl -n argocd label secret argocd-sso app.kubernetes.io/part-of=argocd
Configure Dex in values:
dex:
  enabled: true                    # false in Lesson 1; enable it here
configs:
  cm:
    url: https://localhost:8080
    dex.config: |
      connectors:
      - type: github
        id: github
        name: GitHub
        config:
          clientID: <GitHub client ID>
          clientSecret: $argocd-sso:dex.github.clientSecret
          orgs:
          - name: my-org
            teams:
            - team-a
            - team-b
            - platform
          teamNameField: slug
  rbac:
    scopes: "[groups, email]"
    # policy.csv keeps the Module 3 policy: g, my-org:team-a, role:team-a-dev / g, my-org:platform, role:admin
helm upgrade argocd argo/argo-cd --version 10.18.0 -n argocd -f ~/gitops-lab/bootstrap/argocd-values.yaml --wait
kubectl -n argocd get deploy argocd-dex-server      # appears only after dex.enabled: true
kubectl -n argocd logs deploy/argocd-dex-server --tail=20
time=… level=INFO msg="config connector" connector_id=github
time=… level=INFO msg="listening on" server=http addr=0.0.0.0:5556
…
Log in and verify group mapping: open in a browser https://localhost:8080 → LOG IN VIA GITHUB; or via CLI:
argocd login localhost:8080 --insecure --sso
argocd account get-user-info
argocd app list
argocd account can-i sync applications 'team-a/*'
argocd account can-i sync applications 'team-b/*'
…
Groups: my-org:team-a
NAME                   …  PROJECT
argocd/team-a-podinfo  …  team-a
yes
no
(demonstrating group refresh) Remove yourself from team-a on GitHub, and without logging in again, argocd app list— you can still see it; argocd logout localhost:8080 then log in again --sso , and the application list is empty. This shows that groups refresh only at authentication.
Cleanup / keep: keep the Dex configuration for the capstone lab. If not using it, remove the dex.config, change dex.enabled back to false and helm upgrade, then kubectl -n argocd delete secret argocd-sso, and delete the OAuth App on GitHub.

Reference: the Entra ID values shape (not run locally)

configs:
  cm:
    url: https://argocd.example.com
    oidc.config: |
      name: Entra ID
      issuer: https://login.microsoftonline.com/<tenant-id>/v2.0
      clientID: <application-client-id>
      azure:
        useWorkloadIdentity: true
      requestedIDTokenClaims:
        groups:
          essential: true
          value: "ApplicationGroup"
      requestedScopes: [openid, profile, email]
  rbac:
    scopes: "[groups, email]"
    policy.csv: |
      g, "<team-a group object ID>", role:team-a-dev
      g, "<platform group object ID>", role:admin
dex:
  enabled: false
server:
  podLabels:
    azure.workload.identity/use: "true"
  serviceAccount:
    annotations:
      azure.workload.identity/client-id: <application-client-id>

The federated credential's issuer comes from the AKS OIDC issuer URL, and the subject is system:serviceaccount:argocd:argocd-server. For the AKS-side steps to enable the OIDC issuer and Workload Identity, see AKS 8-hour course. Field names follow the values of chart 10.18.0 (server.podLabels,server.serviceAccount.annotations), and check with helm show values argo/argo-cd --version 10.18.0 before deploying.

Case 1: the organization migrates from GitHub teams to Entra ID

Problem: Previously used Dex + GitHub; now unifying identity on Entra ID. Approach: During migration, configure both the GitHub and Microsoft connectors in Dex (or switch to direct OIDC), and keep both sets of groups in policy.csv: g, my-org:team-a, role:team-a-dev and g, "<GUID>", role:team-a-dev; remove the GitHub lines once it is stable. Limitation: Direct OIDC and Dex can only be chosen as the primary login method one at a time; GUIDs are hard to read, so annotate group names in comments in the policy.

Case 2: large enterprise user groups exceed 200

Problem: Some senior engineers have no permissions at all after logging in. Approach: Confirm that the token shows the overflow indicator, then enable _claim_names overflow indicator, enable azure.enableUserGroupOverageClaim: true; or in App registration, change it to emit only "groups assigned to the app" (ApplicationGroup), reducing the number of groups at the source. Limitation: Enabling overflow resolution depends on Graph API availability.

Case 3: a safety net before disabling admin

Problem: Audit requires disabling the local admin. Approach: First, verify that my-org:platform has role:admin and can log in; put admin.enabled: "false" into Git; keep a "break-glass" procedure: cluster admins can kubectl -n argocd patch cm argocd-cm temporarily restore access. Limitation: The break-glass procedure itself needs approval and auditing.

Common errors and fixes

The redirect_uri MUST match the registered callback URL for this application.

Cause: The GitHub callback URL and url + /api/dex/callback do not match (http/https, port, path).

Fix: Make the OAuth App callback,argocd-cm.url and the browser address all match.

failed to get token: oauth2: "invalid_client" / Dex log: failed to authenticate: github: …

Cause: client secret reference is wrong: the Secret is missing the app.kubernetes.io/part-of: argocd label, or the key name is wrong.

kubectl -n argocd get secret argocd-sso --show-labels
kubectl -n argocd logs deploy/argocd-dex-server | tail -30
Login succeeds but Groups is empty

Cause: GitHub: the user is not in orgs/teams the listed teams, or the OAuth App was not approved by the organization; Entra: no groups claim was added, groups were not assigned to the Enterprise app, or there are more than 200 groups (overflow).

Fix: Check each item; for Entra, decode the ID Token (jwt.ms) to confirm groups whether the groups claim is present.

After upgrading to v3, policies that match users stop working (using Dex).

Cause: The subject changes from Dex's sub to federated_claims.user_id. The old sub is base64-encoded "user ID + connector ID".

echo "ChdleGFtcGxlQGFyZ29wcm9qLmlvEgJkZXhfY29ubl9pZA" | base64 -d

Fix: Change the sub in the policy to the user_id you get after decoding; a better approach is to authorize by group.

CLI --sso is stuck at "Opening browser"

Cause: Running on a remote host without a GUI, or port 8085 is unreachable. Fix: Copy the URL from the output into a local browser and set up SSH port forwarding ssh -L 8085:localhost:8085; Entra requires registration under the "Mobile and desktop" platform http://localhost:8085/auth/callback.

Command-line exercises
1. Check the groups of the current logged-in user, and test whether that identity can sync platform/root.
argocd account get-user-info
argocd account can-i sync applications 'platform/root'
2. Write a policy line that maps the Entra group 1f2e… (team-b) to role:team-b-dev.
g, "1f2e…", role:team-b-dev
Scenario analysis
The company uses Okta for SSO and also has 300 GitHub teams. The platform team wants to "log in with Okta, but authorize by GitHub team". Propose a solution and its risks.

Direct OIDC can only consume the groups in the Okta token. To authorize by GitHub team, either sync/map these groups in Okta (recommended, a single source of identity), or configure multiple connectors in Dex (Okta OIDC + GitHub). Users who pick different connectors get different groups, so the same person may get different permissions depending on the login method, which makes auditing complex. It is recommended to treat Okta as the source of truth, bring GitHub teams into Okta via SCIM or group sync, and use dex.auth.connectorId or connect directly via OIDC to avoid the chooser page.

Verified instructional videos

▶
How to configure GitHub Single Sign-On (SSO) with ArgoCD | GitOps | Adding Certbot SSL to ArgoCD SSO — DevOps Hint
English · Complete steps for GitHub OAuth App + Dex
▶
ArgoCD SSO with Entra ID Made Easy — Programming with Wolfgang
English · Entra ID App Registration, groups claim, and RBAC mapping

Official docs

Video storyboard script (about 90 seconds)

Shot 1 · 0–20s
Visual: two paths fork; the left one goes through Dex to GitHub, the right one goes straight to Entra ID.
Narration: Argo CD's SSO has two paths: the built-in Dex, or connect directly to OIDC.
Shot 2 · 20–45s
Visual: the GitHub team card is stamped by Dex and becomes the string my-org:team-a.
Narration: Dex turns GitHub orgs and teams into group claims; use the slug to avoid breaking on renames.
Shot 3 · 45–70s
Visual: the groups in the Entra token are a string of GUIDs; past 200 they become an "overflow" arrow pointing to Graph.
Narration: Entra ID groups are object IDs; with too many groups, overflow resolution must be enabled.
Shot 4 · 70–90s
Visual: the group string lands on the g line of policy.csv, lighting up the role.
Narration: finally, write the g line using the raw group value seen in get-user-info. Identity lives in the IdP, permissions live in Argo CD.
or score ≥ 70% on the Quiz

Module 5 · Multi-cluster: registering clusters and declarative cluster Secrets

28:00 – 35:00 · One cluster = a Secret labeled secret-type: cluster in the argocd namespace; the address must be "an address the controller's Pod can reach"
7 minutesargocd cluster add --cluster-endpoint kube-publickind: Docker internal address★★★★★
Learning objectives
  • Explain argocd cluster add the actions behind it: in the target cluster, create argocd-manager a SA and its permissions, get a token, and write the cluster Secret into Argo CD.
  • Understand kind networking: why the address in kubeconfig 127.0.0.1 is invalid for the controller, and how to use --cluster-endpoint kube-public or a declarative Secret to write it https://lab2-control-plane:6443.
  • Write a declarative cluster Secret (name,server,config, optional namespaces,clusterResources,project), and understand the authentication models for AKS (Workload Identity) and EKS (IAM).
Prerequisites: Module 0's lab2 cluster and network check. Importance:★★★★★

What: how Argo CD "knows" about a cluster

The cluster where Argo CD is installed is, by default, in-cluster (https://kubernetes.default.svc, using the controller's own ServiceAccount). Credentials for other clusters are all stored as Secret in argocd namespace, labeled argocd.argoproj.io/secret-type: cluster. Fields:

FieldRequiredMeaning
nameYesCluster name (the Application's destination.name, AppProject destinations use it)
serverYesAPI server URL —reachable from the controller / server Pod's perspective.
configYesJSON: bearerToken / username+password / awsAuthConfig / execProviderConfig,tlsClientConfig (caData,certData,keyData,serverName,insecure),proxyUrl,disableCompression
namespacesNoComma-separated list of manageable namespaces; once set, cluster-scoped resources are ignored unless clusterResources: "true". Note that each namespace is listed and watched separately; with many namespaces, idle connections can run out (raise ARGOCD_K8S_CLIENT_MAX_IDLE_CONNECTIONS)
projectNoProject-scoped cluster: only that project's Applications can use it, and implicitly added to this project's destinations
shardNoSpecifies which controller shard processes it (Lesson 7)
The label is the "switch": gitops-lab/managed In Lesson 3 we tagged in-cluster 's cluster Secret with gitops-lab/managed: "true", and Cluster / Matrix generators use selector.matchLabels to select clusters by this label. So the moment you add the same label to lab2's Secret, every ApplicationSet that selects clusters by this label immediately generates Applications for lab2 (for example, the Lesson 3 podinfo-matrix: 3 environments × 2 clusters = 6 applications), and no ApplicationSet needs to change; removing the label deletes them again (whether workloads are also deleted depends on preserveResourcesOnDeletion and the finalizer). Note: this lesson's ApplicationSet podinfo uses the Git directory generator, and its target is fixed to in-cluster,is not affected by this label. In this lab, first register lab2 without adding this label, and at the last step of the lab deliberately add it and observe the fan-out.

Other labels (such as env: lab2) can be referenced in generator templates as {{.metadata.labels.env}} (Lesson 3); the annotation argocd.argoproj.io/skip-reconcile: "true" lets the controller pause processing of all Applications for this cluster. From v3.4, the cluster version is recorded as vMajor.Minor.Patch format (ApplicationSets that select clusters by version need to be adjusted accordingly).

How: argocd cluster add CONTEXT What it does

  1. The CLI reads the local kubeconfig context (for example kind-lab2), using your admin credentials to connect to the target cluster.
  2. On the target cluster, in the kube-system (--system-namespace can be changed), create a ServiceAccount argocd-manager, ClusterRole argocd-manager-role (full permissions on all resources) and ClusterRoleBinding, and fetch its long-lived token. When using --namespace instead, create Role/RoleBinding in each namespace.
  3. Determines the server: --cluster-endpoint kubeconfig (default: the address from kubeconfig),kube-public (read the target cluster's kube-public/cluster-info published address and CA),internal (equivalent to --in-cluster, writes https://kubernetes.default.svc).
  4. Calls the Argo CD API to create the cluster; argocd-server writes the cluster Secret; once the controller notices it, it starts building a cache for the cluster (watching each resource type).

Why: what is special about kind

kind maps lab2's API port to the host 127.0.0.1:random port, which your kubeconfig uses. By default --cluster-endpoint kubeconfig will put https://127.0.0.1:41853 into the Secret — the controller in lab's Pod reaching 127.0.0.1 only connects to itself, so the cluster status becomes Failed … connection refused. The nodes of both kind clusters are on the Docker network kind , and kubeadm publishes https://lab2-control-plane:6443 in kube-public/cluster-info , so --cluster-endpoint kube-public gets exactly the right internal address. Be careful not to use internal: it will write kubernetes.default.svc, which for the controller is lab itself— you would deploy the "lab2" applications onto lab.

When: imperative or declarative

argocd cluster addDeclarative Secret (or the chart's configs.clusterCredentials)
ProsOne command handles the SA, permissions, and tokenCan live in Git (with the Lesson 5 secrets approach), auditable, batchable, and supports exec / IAM auth
ConsRequires your machine to reach both the target cluster and Argo CD at the same time; argocd-manager has full permissionsSA and RBAC must be prepared on the target cluster yourself (can be managed by the target cluster's own GitOps)
Suited forlabs and a few clustersproduction, dozens to hundreds of clusters, and managed cloud clusters

Authentication for managed cloud clusters (not part of this lab)

  • AKS: execProviderConfig Uses the built-in argocd-k8s-auth azure (wraps kubelogin),AAD_LOGIN_METHOD=workloadidentity; the controller and server SAs get Workload Identity annotations and Pod labels, and federated credentials are created for both SAs in Entra —the cluster Secret contains no long-lived token. For details, see the 8-hour AKS course.
  • EKS: awsAuthConfig: {clusterName, roleARN}, the controller/server gets a "management role" via IRSA or EKS Pod Identity, then AssumeRole into each cluster's deployment role; the target cluster uses Access Entries (or aws-auth) to map the role to K8s permissions.
  • GKE: execProviderConfig Calls argocd-k8s-auth gcp.
Common misconceptions① "The cluster name can be written into the clusters object in RBAC" — no, it must be the server URL (M3). ② "A successful cluster add means deployments will work" — add only writes the Secret; connectivity is verified only when the controller first needs that cluster, and with no Applications the status shows Unknown. ③ "argocd-manager only has the necessary permissions" — by default it is a full-permission ClusterRole; for least privilege you must write declarative RBAC yourself, and accept the consequence of "cannot manage forbidden resources". ④ "Deleting the cluster Secret deletes the application resources on it" — no, the applications become Unknown/error; delete the applications first, then the cluster.

Network diagram: why the Docker internal address must be used

Host (Docker) Your terminalkubeconfig kind-lab2:https://127.0.0.1:41853 Docker network "kind" (172.18.0.0/16, built-in DNS resolving container names) lab-control-plane 172.18.0.2 Pod: argocd-application-controller127.0.0.1 = its own Pod ✗ kubernetes.default.svc= lab's own API (in-cluster) lab2-control-plane 172.18.0.3 kube-apiserver :6443certificate SAN includes lab2-control-plane kube-public/cluster-info:server: https://lab2-control-plane:6443 ✓ port mapping 127.0.0.1:41853 → :6443 (only usable from the host)
Figure 5-1: the same lab2; the address seen from the host differs from the one seen from the controller Pod

Flow chart: the four outputs of cluster add

argocd cluster addkind-lab2 --name lab2 lab2: kube-systemSA argocd-managerClusterRole argocd-manager-roleClusterRoleBindingSA token Secret lab: argocd namespaceSecret cluster-lab2-control-plane-…label secret-type=cluster controllerwatch Secret → connect to lab2Build the cluster cache
Figure 5-2: imperative registration = SA/RBAC on the target cluster + Secret in Argo CD

Interactive: each step of registering lab2 (pick an endpoint method to see the consequences)

Choose --cluster-endpoint, then run step by step. The last step simulates the controller's first connection for an application deployed to "lab2".

Choose an endpoint method, then click "Run".

Core commands and flags

CommandPurposeKey flags
argocd cluster add CONTEXTRegister a cluster--name,--cluster-endpoint kubeconfig|kube-public|internal,--namespace (repeatable),--cluster-resources,--project,--label,--annotation,--upsert,--yes,--server-proxy-url
argocd cluster listList clusters and connection status-o wide|json|yaml|server
argocd cluster get NAME|URLDetails (version, cache info)-o wide
argocd cluster set NAMEChange name, namespace, etc.—
argocd cluster rotate-authRotate the argocd-manager tokenOnly applies to the SA created by cluster add
argocd cluster rm NAME|URLRemove the registrationMigrate or delete the applications on that cluster first
kubectl config use-context kind-lab           # argocd CLI already logged in to Argo CD (admin)
argocd cluster add kind-lab2 --name lab2 --cluster-endpoint kube-public --label env=lab2 --yes
argocd cluster list
INFO[0000] ServiceAccount "argocd-manager" created in namespace "kube-system"
INFO[0000] ClusterRole "argocd-manager-role" created
INFO[0000] ClusterRoleBinding "argocd-manager-role-binding" created
INFO[0005] Created bearer token secret "argocd-manager-long-lived-token" for ServiceAccount "argocd-manager"
Cluster 'https://lab2-control-plane:6443' added
SERVER                            NAME        VERSION  STATUS   MESSAGE                                                  PROJECT
https://kubernetes.default.svc    in-cluster  v1.37.0  Successful
https://lab2-control-plane:6443   lab2                 Unknown  Cluster has no applications and is not being monitored.

How to verify: The SERVER column must be lab2-control-plane:6443 (or 172.18.x.x), not 127.0.0.1 or kubernetes.default.svc. Common mistakes: The current kubectl context does not affect cluster add (it connects to lab2 using the context passed as an argument), but argocd the CLI must be logged in. Production use: Unknown is normal — it becomes Successful after the first application is deployed.

kubectl -n argocd get secret -l argocd.argoproj.io/secret-type=cluster
kubectl -n argocd get secret -l argocd.argoproj.io/secret-type=cluster -o jsonpath='{.items[0].data.server}' | base64 -d; echo

Lab 5: register lab2 and deploy team-a's podinfo (about 8 minutes)

Imperative registration: in the "Commands" tab, run the argocd cluster add kind-lab2 --name lab2 --cluster-endpoint kube-public --label env=lab2 --yes, and confirm SERVER is the internal address. If kube-public has no published address, the CLI warns and falls back to the kubeconfig address; in that case, use the declarative method below. For now, do not add gitops-lab/managed=true: otherwise the Lesson 3 ApplicationSet that selects clusters by this label would immediately fan out applications to lab2 (see the "Concepts" tab); first let lab2 host only the team-a applications we deploy explicitly.
kubectl -n argocd get secret -l argocd.argoproj.io/secret-type=cluster -L gitops-lab/managed,env
NAME                                     TYPE     DATA   AGE   MANAGED   ENV
cluster-lab2-control-plane-3624123456    Opaque   3      1m              lab2
in-cluster                               Opaque   3      2d    true      lab
Deploy to lab2 (the team-a project already allows name: lab2 + team-a-*):
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: team-a-podinfo-lab2
  namespace: argocd
spec:
  project: team-a
  source:
    repoURL: https://github.com/<you>/gitops-lab.git
    targetRevision: main
    path: apps/team-a/podinfo-dev
  destination:
    name: lab2
    namespace: team-a-dev
  syncPolicy:
    automated: { prune: true, selfHeal: true }
kubectl --context kind-lab apply -f ~/gitops-lab/argocd/apps/team-a/podinfo-lab2.yaml
argocd app wait team-a-podinfo-lab2 --health --timeout 180
kubectl --context kind-lab2 -n team-a-dev get deploy,svc
argocd cluster list
deployment.apps/podinfo   2/2     2            2           40s
service/podinfo           ClusterIP   10.96.88.21   <none>   9898/TCP,9999/TCP   40s
SERVER                            NAME        VERSION  STATUS      MESSAGE  PROJECT
https://kubernetes.default.svc    in-cluster  v1.37.0  Successful
https://lab2-control-plane:6443   lab2        v1.37.0  Successful
See what cluster add left on lab2:
kubectl --context kind-lab2 -n kube-system get sa argocd-manager
kubectl --context kind-lab2 get clusterrole argocd-manager-role -o yaml | sed -n '/rules:/,$p'
rules:
- apiGroups:
  - '*'
  resources:
  - '*'
  verbs:
  - '*'
- nonResourceURLs:
  - '*'
  verbs:
  - '*'
Switch to declarative: first remove the imperative registration (applications will temporarily error and recover later), then prepare the SA and token yourself:
argocd cluster rm lab2 --yes
# Prepare the SA and token on lab2 (this lab keeps full permissions; production should tighten them, see "Production cases")
kubectl --context kind-lab2 -n kube-system create sa argocd-lab
kubectl --context kind-lab2 create clusterrolebinding argocd-lab --clusterrole=cluster-admin --serviceaccount=kube-system:argocd-lab
kubectl --context kind-lab2 -n kube-system apply -f - <<'EOF'
apiVersion: v1
kind: Secret
metadata:
  name: argocd-lab-token
  annotations:
    kubernetes.io/service-account.name: argocd-lab
type: kubernetes.io/service-account-token
EOF
TOKEN=$(kubectl --context kind-lab2 -n kube-system get secret argocd-lab-token -o jsonpath='{.data.token}' | base64 -d)
CA=$(kind get kubeconfig --name lab2 --internal | awk '/certificate-authority-data/ {print $2}')
kubectl --context kind-lab -n argocd apply -f - <<EOF
apiVersion: v1
kind: Secret
metadata:
  name: cluster-lab2
  labels:
    argocd.argoproj.io/secret-type: cluster
    env: lab2
type: Opaque
stringData:
  name: lab2
  server: https://lab2-control-plane:6443
  config: |
    {
      "bearerToken": "${TOKEN}",
      "tlsClientConfig": { "insecure": false, "caData": "${CA}" }
    }
EOF
argocd cluster list
argocd app get team-a-podinfo-lab2 --refresh | head -12

The cluster Secret contains a plaintext token,do not commit it directly to Git: Lesson 5 uses Sealed Secrets / External Secrets to store it safely in the repo. You can also use the chart's configs.clusterCredentials.lab2 to generate the same Secret (values must likewise not contain plaintext).

(optional) project-scoped cluster: add to the Secret project: team-b, then argocd proj get team-b check "Scoped Clusters"; team-a's applications will no longer be able to use lab2 (you will see team-a-podinfo-lab2 error). After the lab, remove project field to restore it.
Deliberately fan out: add gitops-lab/managed label to lab2. Preview first, then decide:
# 1) Preview (in Lesson 3, ~/appset-lab/podinfo-matrix.yaml was only previewed, never applied)
kubectl -n argocd label secret cluster-lab2 gitops-lab/managed=true
argocd appset generate ~/appset-lab/podinfo-matrix.yaml -o json | jq -r '.[].metadata.name'
# 2) Which deployed ApplicationSets are affected? Find the ones that use a clusters selector
kubectl -n argocd get appset -o json | jq -r '.items[] | select(.spec.generators | tostring | test("gitops-lab/managed")) | .metadata.name'
podinfo-dev-in-cluster
podinfo-dev-lab2
podinfo-prod-in-cluster
podinfo-prod-lab2
podinfo-staging-in-cluster
podinfo-staging-lab2
(the second command produces no output: no applied ApplicationSet in the cluster selects clusters by label)

The preview goes from 3 applications to 6 — the lab2 column "appears automatically", which is exactly the effect previewed in Module 5 of Lesson 3. Since this lesson did not apply such an ApplicationSet, no applications are actually generated in the cluster; in production, labeling a cluster with this label is a release and should go through PR review. If you did apply it podinfo-matrix, note that its template project: default is locked, so first change it to platform; its in-cluster applications will also compete with podinfo for the same set of resources. After the lab, remove the label To keep the starting point clean: kubectl -n argocd label secret cluster-lab2 gitops-lab/managed- (if you want to use multi-cluster fan-out in later courses, you can keep it, and add this label to the cluster Secret definition in Git).

Cleanup: keep lab2 and the cluster-lab2 Secret; M6–M8 and the capstone lab will continue to use them.

Case 1: least-privilege RBAC on the target cluster

Problem: The security team does not accept argocd-manager's */*/*. Approach: On the target cluster, create a dedicated ClusterRole for Argo CD: read/write on common resources in business namespaces, plus global read-only (list/watch all resources for caching and health assessment); grant cluster-scoped resources only for the kinds that are needed. In the cluster Secret, use namespaces to restrict namespaces, which further reduces permissions. Limitation: the controller needs list/watch to compute status; when permissions are insufficient, applications show forbidden errors or missing resources, which need step-by-step debugging.

Case 2: AKS fleet registers without keys using Workload Identity

Problem: Long-lived tokens for 30 AKS clusters are hard to rotate. Approach: The central Argo CD's controller/server SA gets a federated credential; each cluster Secret uses execProviderConfig + argocd-k8s-auth azure + AAD_LOGIN_METHOD=workloadidentity; the target AKS enables Entra ID integration and Azure RBAC, and grants that identity the required role. Limitations: Requires AKS to enable the OIDC issuer and Workload Identity; for details see the AKS course.

Case 3: Cluster decommissioning

Problem: Deleting the cluster Secret directly turns dozens of apps Unknown, and the ApplicationSet then deletes them because the cluster label disappeared. Approach: Decommission steps: ① remove the label on the cluster Secret that the ApplicationSet selects (and confirm the ApplicationSet's deletion policy); ② confirm the apps are deleted or migrated; ③ then argocd cluster rm; ④ delete argocd-manager in the target cluster. Limitations: Closely tied to the ApplicationSet deletion policy in Lesson 3.

Common errors and fixes

Get "https://127.0.0.1:41853/version?timeout=32s": dial tcp 127.0.0.1:41853: connect: connection refused

Cause: The cluster Secret contains the host port-mapped address.

argocd cluster list
argocd cluster add kind-lab2 --name lab2 --cluster-endpoint kube-public --upsert --yes
dial tcp: lookup lab2-control-plane on 10.96.0.10:53: no such host

Cause: The lab cluster's CoreDNS cannot resolve container names through Docker DNS.

docker inspect lab2-control-plane -f '{{.NetworkSettings.Networks.kind.IPAddress}}'

Fix: Change server to https://<IP>:6443; or in the Secret's tlsClientConfig.serverName set lab2-control-plane to keep certificate hostname verification intact.

x509: certificate is valid for lab2-control-plane, kubernetes, …, not 172.18.0.3

Cause: Accessed via IP, but the certificate does not include that IP (or the IP has changed). Fix: Set tlsClientConfig.serverName: lab2-control-plane; don't use insecure: true to mask the problem.

Apps deployed to the wrong cluster (lab2 apps appearing in lab)

Cause: Used --cluster-endpoint internal or --in-cluster, with server set to https://kubernetes.default.svc.

Fix: Immediately pause auto-sync for the affected apps, correct the server in the cluster Secret, and clean up the misdeployed resources.

the server has asked for the client to provide credentials / Unauthorized

Cause: Token invalid or expired (the SA or token Secret was deleted, or the token is short-lived). Fix: Regenerate the long-lived token Secret or argocd cluster rotate-auth; for cloud clusters, prefer exec or IAM authentication.

Command-line exercises
1. List the names and server addresses of all cluster Secrets in Argo CD.
for s in $(kubectl -n argocd get secret -l argocd.argoproj.io/secret-type=cluster -o name); do
  echo "$s $(kubectl -n argocd get $s -o jsonpath='{.data.server}' | base64 -d)"; done
2. Register lab2 to manage only team-a-dev and team-b-dev two namespaces (no cluster-scoped resources).
argocd cluster add kind-lab2 --name lab2 --cluster-endpoint kube-public \
  --namespace team-a-dev --namespace team-b-dev --upsert --yes
Scenario analysis
Your Argo CD runs on a management cluster on the corporate intranet, and the target is a managed cluster on the public internet whose API server only allows allowlisted IPs. The cluster Secret is correct, but its status is Failed (i/o timeout). How do you locate the problem?

Troubleshoot from the controller Pod's network perspective: kubectl -n argocd exec Exec into the controller Pod (or use a temporary debug Pod) to test DNS and 443/6443 connectivity; confirm the egress NAT IP is in the target API allowlist; if a proxy is needed, configure the proxy in the Secret with proxyUrl; if the network path cannot be opened (the target is behind NAT), consider pull mode: one Argo CD per cluster or argocd-agent (M6).

Verified teaching videos

▶
How to add External Cluster to ArgoCD | ArgoCD Tutorial — FoxuTech
English · What argocd cluster add does and the SA/Secret it generates
▶
Declarative...ish? Fixing Hidden Argo CD Pitfalls in Your GitOps Setup - Regina Voloshin — CNCF [Cloud Native Computing Foundation]
English · Conference talk · Hidden traps in declarative configuration (including clusters, projects, etc.)

Official docs

Video storyboard script (about 90 seconds)

Shot 1 · 0–20s
Visual: the terminal shows kubeconfig pointing to 127.0.0.1; the camera pulls back to reveal it is just a port mapping on the host.
Narration: the address you can connect to is not necessarily the one Argo CD can connect to.
Shot 2 · 20–45s
Visual: cluster add creates the SA, ClusterRole, binding, and token on lab2, in sequence.
Narration: cluster add creates argocd-manager in the target cluster and gets its token.
Shot 3 · 45–70s
Visual: three endpoint options each draw a connection; only kube-public points to lab2-control-plane.
Narration: in kind, use kube-public; it publishes the address inside the Docker network, while internal points back to itself.
Shot 4 · 70–90s
Visual: a Secret labeled secret-type: cluster is committed to Git, with a lock beside it.
Narration: in production, use a declarative Secret and hand the token to a secrets manager, or simply use cloud identity without keys.
or score ≥ 70% on the quiz

Module 6 · Hub-and-spoke and one Argo CD per cluster

35:00 – 42:00 · Centralized wins on “one place to see everything, one config set”; distributed wins on “small blast radius, one-way network, each independent”. No silver bullet, only trade-offs.
7 minargocd-agent v0.11.0 (argoproj-labs)Sharding: legacy / round-robin / consistent-hashing★★★★☆
Learning objectives
  • Compare Hub-and-spoke and one Argo CD per cluster across six dimensions: blast radius, network direction, credential centralization, scale, tenant isolation, and operational cost.
  • Know the middle-ground options: regional or environment-level Hubs, argocd-agent (pull mode, managed / autonomous), and managed services.
  • In the lab, observe the Hub's connections to spokes and its cache, and demonstrate “what happens when the Hub goes down.”
Prerequisites: Module 5 has registered lab2. Importance:★★★★☆ (architecture decision with multi-year impact)

What: three topologies

TopologyDescriptionMapping in this lesson
Hub-and-spoke (centralized / push model)One Argo CD on a management cluster holds credentials for all target clusters; the controller actively connects to each spoke's API serverlab (hub) → lab2 (spoke)
One Argo CD per cluster (standalone)Each cluster runs its own Argo CD, managing only in-cluster, each pulling from GitAlso install an Argo CD on lab2
HybridMultiple Hubs split by environment/region; or use argocd-agent: the Hub keeps only the UI/API, and the agent on each spoke connects over mTLS actively connects back to the Hub (pull mode), with two modes: managed (the Hub pushes apps down) and autonomous (the spoke runs its own GitOps and the Hub only observes)Concept overview

Why: trade-off matrix

DimensionHub-and-spokeOne per cluster
Single view / unified config✓ One UI, one set of RBAC/SSO/projects✗ N UIs; config needs GitOps on top to manage it (“Argo CD managing Argo CD”)
Blast radius✗ Hub failure → all clusters stop reconciling and self-healing; Hub compromised → all cluster credentials leak✓ Affects only this cluster
Network directionThe Hub must reach each spoke's API (inbound to the spoke)Each cluster only needs outbound access to Git / image registry
CredentialsCentrally stores high-privilege credentials for all clustersNo cross-cluster credentials
ScaleController memory grows with the total resources across all clusters, so sharding is needed (each shard handles a subset of clusters)Naturally distributed
Tenant isolationRelies on projects + RBAC (M1–M4 in this course)Can be “one instance per team,” with physical isolation
Operational costOne upgrade; but one upgrade affects everythingN upgrades, N monitoring stacks; can upgrade in batches

How: scaling the Hub

  • Controller sharding: increase argocd-application-controller replicas and set ARGOCD_CONTROLLER_REPLICAS, clusters are assigned to shards by an algorithm; the algorithm legacy (by UID, uneven, default),round-robin,consistent-hashing (the last two are officially experimental); you can also use shard to set it manually. The sharding unit is the cluster— a single very large cluster cannot be split. Details in Lesson 7.
  • Cache: the controller watches all managed resource types for each cluster and caches them in memory; argocd cluster get You can see API counts, resource counts, and the last sync time.
  • repo-server Independent of cluster count, depends on app count and rendering complexity, and can scale horizontally on its own.

When: selection guidance

SituationLeaning toward
< 20 clusters, same network domain, one platform teamHub-and-spoke (shard when needed)
Production and non-production must be isolated (compliance, separate credentials)One Hub per environment (prod Hub manages only prod clusters)
Edge / factory / disconnected / behind NATOne per cluster, or argocd-agent (pull mode)
Hundreds of clustersMultiple Hubs + sharding, or argocd-agent; evaluate managed services
Teams require full autonomy (upgrade and scale on their own)One instance per team (SSO can still be shared)
Common misconceptions① “The Hub is down, so all apps are down”—no, workloads keep running; what stops is reconciliation, self-healing, and new releases. ② “With one Argo CD per cluster you don't need RBAC”—you still do, and you must configure it consistently on every instance. ③ “Sharding fixes the memory problem of one large cluster”—sharding assigns whole clusters; an oversized single cluster needs resource exclusion, fewer watched kinds, or splitting. ④ “argocd-agent is already part of Argo CD”—as of 2026-11 it is still published separately under argoproj-labs (v0.11.0, 2026-11-11); assess its maturity before adopting.

Comparison: push vs pull model

Hub-and-spoke (push) Hub: Argo CDHolds all cluster credentials dev stg prod Hub → spoke API (inbound to spoke) One per cluster Git repo dev+Argo CD stg+Argo CD prod+Argo CD Each pulls from Git outbound argocd-agent (pull) Hub: UI / APIprincipal component edge-1agent edge-2agent factoryagent agent → Hub (mTLS, outbound) Arrows = who initiates the connection
Figure 6-1 Differences in connection direction and credential location across the three topologies

Failure diagram: blast radius of a Hub outage

Hub controller stopped(failed upgrade / node failure) Workloadskeep running ✓ New releases / rollbacksall clusters paused ✗ Self-healing / drift detectionall clusters paused ✗ With one per cluster, the same failure affects only one cluster
Figure 6-2 Blast radius

Interactive: topology trade-off calculator

Adjust your organization's parameters; the calculator scores the three topologies using this module's trade-off matrix (illustrative weights for practice, not a standard answer).

Cluster count 12
Team count 6
Platform team headcount 3

Core commands

CommandPurposeNotes
argocd cluster get lab2 -o wideView cluster cache and connection infoIncludes serverVersion, connectionState, cacheInfo (APIs / resource count / last sync)
argocd admin cluster statsPer-cluster resource counts and inferred shard numbersReads the cluster Argo CD runs on directly (requires a kubectl context)
argocd admin cluster shardsView shard assignmentsDetails in Lesson 7
kubectl -n argocd scale sts argocd-application-controller --replicas=0Simulate a Hub controller failureLab only
helm upgrade … --set controller.replicas=2Enable sharding (the chart also sets the replica-count env var)Refer to the chart docs
argocd cluster get lab2 -o yaml | sed -n '/connectionState/,/serverVersion/p'
kubectl config use-context kind-lab
argocd admin cluster stats -n argocd
connectionState:
  attemptedAt: "2026-11-17T10:20:31Z"
  status: Successful
info:
  applicationsCount: 1
  cacheInfo:
    apisCount: 58
    lastCacheSyncTime: "2026-11-17T10:20:31Z"
    resourcesCount: 412
  connectionState: …
  serverVersion: v1.37.0
SERVER                           SHARD  CONNECTION  NAMESPACES COUNT  APPS COUNT  RESOURCES COUNT
https://kubernetes.default.svc   0                  0                 6           1024
https://lab2-control-plane:6443  0                  0                 1           412

How to verify: resourcesCount reflects the number of objects the controller caches in memory for that cluster; it is the basis for capacity planning. Common mistakes:admin The subcommand accesses Kubernetes directly, so the current context must point to the cluster where Argo CD runs. Production use: Use this data to decide when to add shards and when to split the Hub.

Lab 6: Observe the Hub and run a “Hub outage” drill (about 6 min)

Check the Hub's cache for lab2: in the Commands section, run argocd cluster get and argocd admin cluster stats, then record the resource counts of both clusters.
Stop the Hub controller:
kubectl --context kind-lab -n argocd scale statefulset argocd-application-controller --replicas=0
# Create drift on lab2
kubectl --context kind-lab2 -n team-a-dev scale deploy podinfo --replicas=5
sleep 60
kubectl --context kind-lab2 -n team-a-dev get deploy podinfo
argocd app get team-a-podinfo-lab2 | head -8
NAME      READY   UP-TO-DATE   AVAILABLE   AGE
podinfo   5/5     5            5           20m
Name:               argocd/team-a-podinfo-lab2
…
Sync Status:        Synced to main (9c1d2e3)      ← status frozen from before the controller stopped
Health Status:      Healthy

podinfo keeps running (workloads are unaffected), but the drift (5 replicas) is not corrected, and the UI status no longer updates.

Restore the controller, then observe self-healing:
kubectl --context kind-lab -n argocd scale statefulset argocd-application-controller --replicas=1
kubectl --context kind-lab -n argocd rollout status statefulset argocd-application-controller
sleep 30; kubectl --context kind-lab2 -n team-a-dev get deploy podinfo
NAME      READY   UP-TO-DATE   AVAILABLE   AGE
podinfo   2/2     2            2           22m
Think about it: one Argo CD per cluster (optional, needs about 1 GB of extra memory): install a second instance on lab2 using the same chart helm --kube-context kind-lab2 upgrade --install argocd argo/argo-cd --version 10.18.0 -n argocd --create-namespace, so that it manages lab2's team-a-podinfo (target in-cluster), and remove from the lab Hub team-a-podinfo-lab2 (first when deleting the app on the Hub, choose non-cascading: argocd app delete team-a-podinfo-lab2 --cascade=false, to avoid deleting resources; if you have already committed argocd/apps/team-a/podinfo-lab2.yaml to Git, root will recreate it — during the lab, first delete that file from Git and restore it afterward). Compare the impact of “stopping lab's controller” on lab2 under both approaches. When done helm --kube-context kind-lab2 -n argocd uninstall argocd and restore the Hub app.

Case 1: one Hub per environment

Problem: Audit requires: “a system that can change dev must not hold prod credentials.”Approach: Two Hubs: argocd-nonprod one manages dev/stg, while argocd-prod the other manages only prod clusters; the prod Hub's SSO allows only the release group to sign in; both Hubs' config is maintained by one “management repo” via GitOps. Limitations: Two UIs; promotion flows span Hubs (you can promote by version in Git, using tools such as Kargo from Lesson 8).

Case 2: 800 edge clusters at retail stores

Problem: Store networks sit behind NAT and are often disconnected, so the Hub cannot connect. Approach: Each store cluster runs a lightweight Argo CD (or argocd-agent in autonomous mode) that pulls from a nearby Git mirror; the center only observes. Limitations: Upgrading N instances requires batching and automation; the agent approach needs its maturity and support evaluated.

Case 3: Hub controller OOM

Problem: After the Hub manages 40 clusters, the controller frequently gets OOMKilled. Approach: Enable 3 shards; keep the default exclusions for high-churn resources such as Events and EndpointSlice (v3 already excludes a set of high-churn resources by default); move one oversized cluster to a dedicated Hub. Limitations: Sharding is per cluster, so the largest cluster sets the minimum memory floor for a single shard (Lesson 7).

Common errors and fixes

Cluster status Failed: context deadline exceeded / i/o timeout

Cause: Network from the Hub to the spoke is blocked (firewall, API allowlist, proxy).

kubectl -n argocd run nettest --rm -it --restart=Never --image=curlimages/curl -- curl -skm5 https://SPOKE:6443/version

Fix: Open the network or set proxyUrl; if the network direction cannot be met, switch to pull mode.

controller log: Failed to watch … the server could not find the requested resource

Cause: A CRD on the spoke was deleted or its API version was removed, while the cache is still watching it. Fix:argocd cluster get Check the cache status; the controller usually rebuilds the cache, and restart the controller if needed.

OOMKilled: argocd-application-controller

Cause: The total resource cache across all clusters is too large.

argocd admin cluster stats -n argocd

Fix: Add shards and resource exclusions (resource.exclusions), and on the cluster Secret set namespaces to scope it, and raise the memory limit.

Two Argo CD instances “fighting” each other (resources keep changing)

Cause: The Hub and the local spoke instance both manage the same set of resources (common during migration). Fix: When migrating, first on the old instance, use --cascade=false to delete the app, then let the new instance take over; with annotation tracking, watch out for installationID (used to tell ownership apart when multiple instances manage the same cluster; the official docs are authoritative).

Command-line exercises
1. View the resource count and shard for each cluster.
argocd admin cluster stats -n argocd
2. When migrating, delete the app from the Hub but keep its resources in the cluster.
argocd app delete team-a-podinfo-lab2 --cascade=false
Scenario analysis
The company has 3 regions, with 4 dev and 4 prod clusters per region, a platform team of 4, and requires prod credential isolation plus a unified view for management. Design the topology.

Two Hubs (nonprod, prod), each managing 12 clusters, with 2–3 shards per Hub when needed; both Hubs share the same SSO and project/RBAC templates (generated by the management repo); the unified view aggregates both Hubs' argocd_app_info metrics (Lesson 7 and the Prometheus course). If some regions do not allow inbound traffic, evaluate argocd-agent or local instances for those regions.

Verified teaching videos

▶
Control Plane, Service, or Both? – Argo CD Multi-Cluster Architectures - Nicholas Morey, Akuity — Continuous Delivery Foundation
English · Conference talk · Trade-offs of centralized, distributed, and hybrid architectures
▶
Scale GitOps With the Argo CD Agent and Open Cluster Management - Joshua Packer, Red Hat — CNCF [Cloud Native Computing Foundation]
English · Conference talk · argocd-agent pull mode

Official docs

Video storyboard script (about 90 seconds)

Shot 1 · 0–25s
Visual: a central Hub extends arrows to all clusters, with a key hanging on each arrow.
Narration: a centralized Hub gives you one screen for everything, but it holds the keys to every cluster.
Shot 2 · 25–50s
Visual: the Hub turns red and goes dark; the “self-heal” icons on all clusters turn gray, but the app icons stay green.
Narration: when the Hub is down, apps keep running, but every cluster stops deploying and self-healing.
Shot 3 · 50–75s
Visual: each cluster grows its own small Argo CD, with arrows pointing to Git.
Narration: one instance per cluster has the smallest blast radius; the cost is more upgrade and configuration work.
Shot 4 · 75–90s
Visual: the agents on edge clusters connect back to the Hub.
Narration: a pull-mode agent is the compromise: the center sees the whole picture, and the edge initiates the connection.
or score ≥ 70% on the quiz

Module 7 · Applications in any namespace

42:00 – 50:00 · Let teams declare Applications in their own namespaces with kubectl / GitOps, while ensuring they can only use their own projects
8 minSupported since v2.5 · must be explicitly enabledRBAC objects become project/namespace/application★★★★☆
Learning objectives
  • Explain why “anyone who can write argocd Application objects in a namespace = Argo CD admin”, and how this feature addresses it.
  • Configure the two gates: global application.namespaces (argocd-server and controller) + project sourceNamespaces; understand how they work with Kubernetes RBAC.
  • Master the CLI names namespace/application, REST appNamespace parameters and RBAC objects project/namespace/application syntax and pitfalls.
Prerequisites: Modules 1 and 3. Importance:★★★★☆ (key to team self-service)

What: what the feature is

By default, Applications can only live in the Argo CD control-plane namespace argocd. Since v2.5, admins can allow Applications to exist in other namespaces; whether they are accepted is decided by the AppProject that these apps' spec.project points to. The official docs warn right at the start: Read carefully before enabling; misconfiguration can cause security problems.

Why: what problem it solves

Anyone with write access to the argocd namespace (especially who can create or modify Applications) should be treated as an Argo CD admin—they can point spec.project at any project. Previously, regular users could only create apps through the Argo CD API (governed by Argo CD RBAC); this feature lets teams declaratively write Applications in their own namespace (including the App of Apps pattern) without being able to use other projects. Another benefit: teams can configure notifications within their own namespace (namespace-level Notifications config).

How: two gates + one Kubernetes RBAC rule

  1. Global gate:argocd-server and argocd-application-controller ’s --application-namespaces parameter (recommended: set via argocd-cmd-params-cm ’s application.namespaces unified setting, restart both after changes). Shell wildcards are supported (team-*) and /regex/; namespaces not in the list cannot be used by any project.
  2. Project gate: AppProject’s .spec.sourceNamespaces lists the namespaces allowed to use this project (wildcards supported). On mismatch, the controller refuses to reconcile the app, and the API rejects it too—unrelated to Argo CD RBAC.
  3. Kubernetes RBAC: argocd-server by default has no permission to create or modify Applications in other namespaces. The official docs provide examples/k8s-rbac/argocd-server-applications; the Helm chart, when configs.params."application.namespaces" is set, automatically adds create/delete/update/patch on applications to argocd-server’s ClusterRole (verified against the chart templates).
  4. Prerequisite: Only applies to cluster-scoped installations of Argo CD (not namespace-scoped installs). For resource tracking, annotations are recommended (the app name becomes “namespace_app”, which can easily exceed the 63-character label value limit); since v3, annotation tracking is already the default.

Changes to names and RBAC

ContextSyntaxNotes
CLI / UIteam-a-apps/podinfoApps in the control-plane namespace can omit the prefix (argocd/x and x are equivalent)
REST APIGET /api/v1/applications/podinfo?appNamespace=team-a-appsin the request body for POST/PUT
RBAC objectsteam-a/team-a-apps/podinfoproject/namespace/application; apps in the control plane still use the two-part form project/application

Wildcard trap: glob does not split on segments,team-a/* matches the apps under the team-a project in any namespace apps; to restrict the namespace, write team-a/team-a-apps/*. For backward compatibility, you cannot use foo/argocd/* to separately constrain apps in the control-plane namespace (they are always normalized to the two-part form).

When: when to enable it

  • Enable it when teams want to manage their own Application manifests via GitOps (App of Apps) and the platform does not want to approve each one → enable, with one app namespace per team (e.g. team-a-apps), and give the team K8s write permission on that namespace only.
  • If only the platform team writes Applications → not needed; keeping the default is simpler.
  • ApplicationSet also has its own “any namespace” switch (applicationsetcontroller.namespaces), but currently an ApplicationSet in one namespace cannot generate Applications in another namespace (official issue #11104).
Common misconceptions and pitfalls① Don't add user-controllable namespaces to privileged projects (such as default, platform)’s sourceNamespaces. ② Never in any project's sourceNamespaces add argocd. ③ Apps in the control-plane namespace can reference any project (for backward compatibility), so argocd namespace's K8s write permission should still go only to admins. ④ “Just enabling application.namespaces is enough”—if the project does not list the namespace, the app is rejected.

Admission overview: two gates

Application podinfons: team-a-appsproject: team-a Gate 1: application.namespaces"team-a-apps, team-b-apps"server + controller both need to be configured Gate 2: team-a.sourceNamespaces[team-a-apps]unrelated to Argo CD RBAC Reconcile Application evilns: team-a-appsproject: platform Gate 1 passed Gate 2 rejects: platform.sourceNamespaces does not include team-a-appscontroller does not reconcile, API rejects → cannot borrow a privileged project Exception: Applications in the argocd namespace can reference any project → write access to the argocd namespace = admin RBAC object: team-a/team-a-apps/podinfo (three-part)
Figure 7-1 The global switch decides “which namespaces may hold apps”; the project decides “which namespace can use this project”

Responsibilities

Platform teamapplication.namespacesAppProject (incl. sourceNamespaces)write access to the argocd namespace Team AApplications in team-a-apps(K8s RoleBinding: this namespace only)can do App of Apps Argo CDValidates both gatesValidates the project's sources / destinations / resourcesRBAC on three-part objects
Figure 7-2 Teams own the app manifests; the platform owns the boundaries

Interactive: sourceNamespaces admission simulator

Set the global application.namespaces, choose the namespace the Application lives in, and spec.project, see whether it gets reconciled, and the matching RBAC object string. The project's sourceNamespaces comes from this module's lab: team-a → team-a-apps, team-b → team-b-apps, platform → none.

application.namespaces
Application namespace spec.project Name

Core commands and config

Command / configPurposeNotes
argocd-cmd-params-cm: application.namespacesGlobally allowed namespacescomma-separated; supports wildcards and /regex/; restart server and controller after changing
AppProject.spec.sourceNamespacesNamespaces accepted by the projectsupports wildcards
argocd app get NS/NAMEView apps in other namespacescan also use -N NS (--app-namespace)
argocd app create NS/NAME …Create an app in a specified namespaceIn the UI, enter the name as NS/NAME
argocd app list -N NSFilter by namespace—
kubectl -n argocd rollout restart deploy/argocd-server sts/argocd-application-controllermake the parameter take effectA Helm upgrade that changes the CM usually rolls these workloads (check actual behavior)
kubectl -n argocd get cm argocd-cmd-params-cm -o jsonpath='{.data.application\.namespaces}{"\n"}'
kubectl -n argocd get deploy argocd-server -o yaml | grep -A2 ARGOCD_APPLICATION_NAMESPACES
argocd app list -N team-a-apps
team-a-apps, team-b-apps
        - name: ARGOCD_APPLICATION_NAMESPACES
          valueFrom:
            configMapKeyRef:
NAME                 CLUSTER                         NAMESPACE   PROJECT  STATUS  HEALTH
team-a-apps/podinfo  https://kubernetes.default.svc  team-a-dev  team-a   Synced  Healthy

How to verify: The second line confirms the parameter is injected from the CM via an environment variable. Common mistakes: Changing only server or only controller is not enough; both are needed (using a CM avoids this). Production use: The team repo's argocd/apps/team-a/ directory is synced by team-a's own root app to team-a-apps.

Lab 7: team-a declares an Application in its own namespace (about 8 min)

Turn on the global switch (append to values) and upgrade:
configs:
  params:
    application.namespaces: "team-a-apps, team-b-apps"
kubectl --context kind-lab create namespace team-a-apps
kubectl --context kind-lab create namespace team-b-apps
helm upgrade argocd argo/argo-cd --version 10.18.0 -n argocd -f ~/gitops-lab/bootstrap/argocd-values.yaml --wait
kubectl -n argocd rollout restart deploy/argocd-server sts/argocd-application-controller
kubectl -n argocd rollout status sts/argocd-application-controller
kubectl get clusterrole argocd-server -o yaml | grep -B2 -A8 'applications$' | head -30
Declare sourceNamespaces in the project: edit argocd/projects/team-a.yaml (team-b is the same):
spec:
  sourceNamespaces:
  - team-a-apps
kubectl --context kind-lab apply -f ~/gitops-lab/argocd/projects/team-a.yaml -f ~/gitops-lab/argocd/projects/team-b.yaml
Grant the team K8s permissions, limited to its own app namespace (in the lab, use the K8s username alice to simulate impersonation):
kubectl --context kind-lab -n team-a-apps create role app-editor \
  --verb=get,list,watch,create,update,patch,delete --resource=applications.argoproj.io
kubectl --context kind-lab -n team-a-apps create rolebinding alice-app-editor --role=app-editor --user=alice
kubectl --context kind-lab auth can-i create applications.argoproj.io -n team-a-apps --as alice
kubectl --context kind-lab auth can-i create applications.argoproj.io -n argocd --as alice
yes
no
Declare one valid app and one “overreaching” app as alice:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: podinfo
  namespace: team-a-apps
spec:
  project: team-a
  source:
    repoURL: https://github.com/<you>/gitops-lab.git
    targetRevision: main
    path: apps/team-a/podinfo-dev
  destination: { name: in-cluster, namespace: team-a-dev }
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: evil
  namespace: team-a-apps
spec:
  project: platform            # tries to borrow a project that can deploy cluster-level resources
  source:
    repoURL: https://github.com/<you>/gitops-lab.git
    targetRevision: main
    path: apps/podinfo/base
  destination: { name: in-cluster, namespace: kube-system }
kubectl --context kind-lab apply -f team-a-apps.yaml --as alice
sleep 20
argocd app list -N team-a-apps
kubectl -n team-a-apps get applications.argoproj.io evil -o jsonpath='{.status.conditions}{"\n"}'
NAME                 CLUSTER                         NAMESPACE    PROJECT   STATUS   HEALTH
team-a-apps/evil     https://kubernetes.default.svc  kube-system  platform  Unknown  Unknown
team-a-apps/podinfo  https://kubernetes.default.svc  team-a-dev   team-a    Synced   Healthy
[{"lastTransitionTime":"…","message":"application 'evil' in namespace 'team-a-apps' is not permitted to use project 'platform'","type":"InvalidSpecError"}]

Note: podinfo has the same target as team-a-podinfo from Lesson 1, so they will compete for resources (SharedResourceWarning). After the lab, delete one of them, or change this app's target to team-a-prod.

RBAC three-part form: alice's Argo CD policy is team-a/*, since glob does not split on segments, it also matches team-a/team-a-apps/podinfo. Tighten it to allow only this namespace:
argocd admin settings rbac can alice sync applications 'team-a/team-a-apps/podinfo' --namespace argocd
cat > /tmp/p.csv <<'EOF'
p, alice, applications, sync, team-a/team-a-apps/*, allow
EOF
argocd admin settings rbac can alice sync applications 'team-a/team-a-apps/podinfo' --policy-file /tmp/p.csv
argocd admin settings rbac can alice sync applications 'team-a/team-a-podinfo' --policy-file /tmp/p.csv
Yes
Yes
No
Cleanup: kubectl -n team-a-apps delete application evil; keep podinfo (or change its target). Commit the values and project changes to Git.

Case 1: team self-service App of Apps

Problem: The platform team handles dozens of “new app” tickets each week. Approach: For each team, create a team-x-apps namespace and project sourceNamespaces; the platform's ApplicationSet (Lesson 3) generates one root app per team, deployed to team-x-apps, with contents from the team repo's argocd/apps/; teams add and remove their own apps. Limitations: The root app itself is created by the platform in the argocd namespace (referencing the team project); teams cannot modify it.

Case 2: accidentally opened the platform project to team namespaces

Problem: To let teams deploy Ingress, someone edited the platform project’s sourceNamespaces to include team-*. Any team could declare project: platform apps that deploy ClusterRoleBinding. Approach: Roll back; instead, open only the needed resources precisely in the team project, or have the platform deploy them. Use CI validation: the privileged project’s sourceNamespaces must be empty. Limitations: Needs policy checks on project YAML (such as conftest / Kyverno CLI).

Case 3: notifications configured per team

Problem: Each team wants sync-failure notifications sent to its own Slack channel, but cannot change the global notification config. Approach: After enabling apps-in-any-namespace, teams configure notifications in their own namespace (the official namespace-level notifications config); the platform only maintains global templates. Limitations: The notifications controller needs matching cluster-level read permissions (provided by the chart and official examples).

Common errors and fixes

app is not allowed in project "platform", or the project does not exist (API) / application 'evil' in namespace 'team-a-apps' is not permitted to use project 'platform' (controller condition)

Cause: The app's namespace is not in the project's sourceNamespaces (or the project does not exist). The API deliberately returns vague errors, so it does not reveal whether the project exists.

argocd proj get team-a -o yaml | grep -A3 sourceNamespaces

Fix: Change spec.project to a project that allows that namespace; don't loosen a privileged project for this.

The app exists in team-a-apps but Argo CD cannot see it at all

Cause: The namespace is not in application.namespaces , or the server/controller was not restarted.

kubectl -n argocd get cm argocd-cmd-params-cm -o yaml | grep application.namespaces
kubectl -n argocd logs sts/argocd-application-controller | grep -i namespace | tail
applications.argoproj.io is forbidden: User "system:serviceaccount:argocd:argocd-server" cannot create resource "applications" in the namespace "team-a-apps"

Cause: argocd-server lacks K8s permission to write Applications in other namespaces (when created via UI/CLI).

Fix: Apply the official examples/k8s-rbac/argocd-server-applications, or confirm the chart's configs.params."application.namespaces" is set (the chart adds the rule automatically).

Label value too long / resource tracking issue

Cause: With label tracking, the app instance name is “namespace_app”, which exceeds 63 characters. Fix: Use annotation or annotation+label tracking (v3 defaults to annotation).

Command-line exercises
1. Sync team-b-apps apps in the namespace api.
argocd app sync team-b-apps/api
# or
argocd app sync api -N team-b-apps
2. Write one policy line: role:team-b-dev can only view apps in the team-b project that are in the team-b-apps namespace.
p, role:team-b-dev, applications, get, team-b/team-b-apps/*, allow
Scenario analysis
The platform also wants teams to self-serve app generation with ApplicationSet. How would you design it? What are the limitations?

Enable applicationsetcontroller.namespaces to allow ApplicationSets in team namespaces; Applications generated by an ApplicationSet must be in the same namespace as it (cross-namespace generation is not supported yet, issue #11104), so place the team's ApplicationSet in team-x-apps and reference the team-x project; also restrict SCM providers (applicationsetcontroller.allowed.scm.providers) and templated project fields to prevent generating apps in projects the team is not allowed to use; in RBAC, applicationsets the object's project part determines which projects it can generate apps for.

Teaching videos

No dedicated video on “Applications in any namespace” verified via YouTube oEmbed was found. The conference talk below covers the multi-tenant design background where this feature sits:

▶
Managing Argo CD Multi-Tenancy Effectively - Gerald Nunn, Red Hat — CNCF [Cloud Native Computing Foundation]
English · Multi-tenancy, namespace-scoped design

Official docs

Video storyboard script (about 90 seconds)

Shot 1 · 0–20s
Visual: the argocd namespace is a locked vault, and teams queue outside the door to file tickets.
Narration: by default, only people who can write to the argocd namespace can declare apps, and those people are effectively admins.
Shot 2 · 20–45s
Visual: each team gets its own small room, team-a-apps, with the allowed projects written on the door.
Narration: once any-namespace is enabled, teams write Applications in their own namespace.
Shot 3 · 45–70s
Visual: an app declaring project: platform tries to leave team-a-apps and is stopped by the second gate.
Narration: the project's sourceNamespaces decides which namespace can use it; borrowing a privileged project gets rejected.
Shot 4 · 70–90s
Visual: the RBAC string changes from two parts to three: team-a/team-a-apps/podinfo.
Narration: remember that RBAC objects become three-part, and wildcards do not split on segments.
or score ≥ 70% on the quiz

Module 8 · Multi-tenant architecture review

50:00 – 60:00 · Review from an “attacker's perspective”: who can write to Git? who can write to the argocd namespace? who holds cluster credentials? how big is the blast radius of a single mistake?
10 minReview scorecard + troubleshooting treeSynthesis of M1–M7★★★★★
Learning objectives
  • List the main privilege-escalation paths in multi-tenant Argo CD, and the matching controls.
  • Review a design against a checklist: identity, RBAC, projects, cluster credentials, Git and network, operations.
  • Use the troubleshooting tree to quickly locate four kinds of problems: “permission denied / project rejected / cluster unreachable / SSO has no groups”.
Prerequisites: All modules in this course. Importance:★★★★★

What: the six areas of the review

AreaKey questionsModules in this lesson
IdentityWho can log in? Is admin disabled? Where do groups come from and how often are they refreshed? What credentials does CI use?M3, M4
RBACpolicy.default What role? Are there any */* non-admin roles? Are logs / exec minimized? Is the policy covered by automated tests?M3
ProjectsIs default locked down? Are cluster-level resources given only to platform? Does the deny list include Quota / LimitRange / NetworkPolicy / RBAC? sourceNamespaces Are they only given to team projects?M1, M2, M7
Cluster credentialsIs the Secret encrypted in Git? Is cloud identity used with no keys? Is argocd-manager's permission narrowed? Are clusters scoped per project?M5
Git and supply chainCan teams change the platform repo? Is PR review with CODEOWNERS required? Are Helm/OCI sources restricted?M2 (see also the GitHub / GitLab courses)
Topology and operationsHub blast radius? Are prod / non-prod isolated? Sharding and capacity? Backup and DR (argocd admin export)?M6

Why: typical privilege-escalation paths

#PathControls
1Create an app in the default project that deploys a ClusterRoleBindingLock down default; give the cluster-level resource allowlist only to platform
2Has argocd namespace with K8s write permission → change an Application's project / edit argocd-rbac-cm / read cluster SecretsGive the argocd namespace only to platform admins; teams use apps-in-any-namespace
3A team repo deploys a RoleBinding that binds admin to an external principalNamespace deny list includes RBAC resources, or admission policy restricts it
4A projects, update team member loosens their own project's destinationsProject YAML lives in the platform repo; team roles only get projects, get
5exec permission + privileged Pod → enter the container and read the mounted tokenDisable exec by default; grant only to on-call roles, scoped to projects
6ApplicationSet templated project field / SCM generator reading untrusted reposRestrict applicationsets with RBAC; restrict SCM providers
7Non-expiring JWT / leaked local-account apiKeySet token expiry, rotate, and apply least privilege per project
8policy.default: role:readonly Leaks configuration of all apps and the cluster listLeave default empty or give minimal role
9An SSO group with the same name as a local user gets the local user's roleLocal users use direct p lines; disable local users where possible
10override permission syncs any local manifest / any revisionDon't grant override; enable requireOverridePrivilegeForRevisionSync

How: review process

  1. Draw the data flow: Git → repo-server → controller → clusters; identity flow: IdP → Dex/OIDC → server → RBAC.
  2. For each role, list “what it can do”, then use argocd admin settings rbac can to verify key negative cases (team-a cannot touch team-b, cannot delete apps, cannot exec).
  3. For each project, list sources, destinations, and resources, and try the M2 “three boundary-crossing attempts”.
  4. Check argocd namespace's K8s RoleBinding: kubectl -n argocd get rolebinding -o wide and any ClusterRole that can read or write Secrets.
  5. Assess the blast radius: Hub outage, Hub compromise, a single team repo compromised; what does each affect?

When: when to do it

Before onboarding a new team, before adding a new cluster type (e.g. first onboarding prod), before a major Argo CD upgrade (e.g. v2 → v3 RBAC changes), and a routine quarterly review.

Common misconceptions① “Projects + RBAC done means multi-tenancy”—the controller's K8s permissions, the argocd namespace's K8s permissions, and Git write access also determine the boundary. ② “It doesn't matter if the team repo and platform repo are the same repo”—without CODEOWNERS / branch protection, teams can modify project definitions. ③ “One review is enough”—major releases like v3 change default behavior.

Trust boundary diagram

Git Platform repoprojects · rbac · clusters team-a repo / directoryCODEOWNERS: team-a team-b repo / directoryCODEOWNERS: team-b High-trust zone: argocd namespace (platform admins only) argocd-serverSSO · RBAC controllerCluster credentials AppProjects · argocd-rbac-cm · cluster Secrets team-a-appsTeam-writablesourceNamespaces team-b-appsTeam-writable Target clusters lab (in-cluster) lab2 argocd-manager(default: full permissions)Narrow down or use cloud identity
Figure 8-1 Three trust zones: Git (owned by directory), the argocd control plane (platform only), and target clusters (minimal credentials)

Review decision flow

Draw data / identity flow List roles and permissions rbac can assertion three boundary-crossing attempts Blast radius Remediate + retest
Figure 8-2 Review steps

Interactive: multi-tenant architecture review scorecard

Below is a preset “current state of a company” (many items unchecked). Judge item by item whether your design meets each one; the scorecard calculates the risk score and highest-risk items in real time. Weights are illustrative, for practicing prioritization.

Review commands

CommandWhat it checks
argocd proj list / argocd proj get P -o yamlWhether default is locked; cluster-level allowlist; sourceNamespaces
kubectl -n argocd get cm argocd-rbac-cm -o yamlpolicy.default, wildcard grants, logs/exec
argocd admin settings rbac can … --namespace argocdKey negative assertions
kubectl -n argocd get rolebinding,clusterrolebinding -o wide | grep -i argocdWho can write to the argocd namespace
kubectl auth can-i --list -n argocd --as USERA user's K8s permissions in the control-plane namespace
kubectl -n argocd get cm argocd-cm -o yaml | grep -E 'admin.enabled|exec.enabled|accounts\.'admin, exec, local accounts
argocd cluster list + target clusters kubectl get clusterrolebinding | grep argocdCluster credentials and permissions
argocd admin export -n argocd > backup.yamlDR export (contains secrets; keep it safe)
# A set of RBAC negative assertions (all should output No)
for t in "my-org:team-a sync applications team-b/*" \
         "my-org:team-a delete applications team-a/team-a-podinfo" \
         "my-org:team-a create exec team-a/team-a-podinfo" \
         "my-org:team-a update projects team-a" \
         "my-org:team-b get logs team-a/team-a-podinfo"; do
  set -- $t; printf '%-60s ' "$t"; argocd admin settings rbac can "$1" "$2" "$3" "$4" --namespace argocd
done
my-org:team-a sync applications team-b/*                    No
my-org:team-a delete applications team-a/team-a-podinfo      No
my-org:team-a create exec team-a/team-a-podinfo              No
my-org:team-a update projects team-a                         No
my-org:team-b get logs team-a/team-a-podinfo                 No

How to verify: Any line showing Yes is a finding for the review. Production use: Put this script in the platform repo's CI,--policy-file pointing to argocd-rbac-cm.yaml in the PR.

Lab 8: review and fix a design that “looks fine” (about 10 min)

A team submitted the configuration below. Find at least 6 problems, then fix them against the reference answers.

## argocd-cm
data:
  admin.enabled: "true"
  exec.enabled: "true"
  accounts.ci: apiKey, login
## argocd-rbac-cm
data:
  policy.default: role:readonly
  policy.csv: |
    p, role:dev, applications, *, */*, allow
    p, role:dev, exec, create, */*, allow
    p, role:dev, projects, update, *, allow
    g, my-org:developers, role:dev
    g, ci, role:admin
## AppProject team-a
spec:
  sourceRepos: ['https://github.com/my-org/*']
  destinations: [{ server: '*', namespace: 'team-a-*' }]
  clusterResourceWhitelist: [{ group: '*', kind: '*' }]
  sourceNamespaces: ['*']
## AppProject default: unmodified
## Cluster Secret lab2: stored in plaintext in Git, argocd-manager is cluster-admin
Reference answer: list of problems
  1. policy.default: role:readonly: all logged-in users can see all apps and clusters, and deny cannot revoke it → leave empty or minimal role.
  2. role:dev For */* role, which has all application actions (including delete, override, action) → authorize per team project; grant only get/sync/necessary actions.
  3. exec, create, */* + exec.enabled → disable it or grant only to on-call roles, scoped to projects.
  4. projects, update, *: developers can change project boundaries → grant only get.
  5. g, ci, role:admin and ci is an apiKey account → use project-role JWTs (with expiry), authorized per project.
  6. team-a clusterResourceWhitelist: */* → leave empty.
  7. sourceNamespaces: ['*']: any enabled namespace can use team-a; and if the global list includes platform namespaces besides argocd, the risk is higher → list only team-a-apps.
  8. sourceRepos: https://github.com/my-org/* allows any repo in the organization (including other teams' and personal experiment repos) → list them precisely.
  9. destinations server: '*': can deploy to any registered cluster (including future prod) → list by cluster name.
  10. The default project is not locked down.
  11. The cluster Secret is plaintext in Git, and argocd-manager is cluster-admin → use Sealed Secrets / ESO (Lesson 5) or cloud identity, and narrow target cluster permissions.
  12. admin.enabled: "true": once SSO is in place, disable it and keep a break-glass procedure.
Apply the reference fixes to your environment: check this lesson's values and project YAML, and confirm items 1–12 are all satisfied in your lab environment (exec not enabled, default locked, team projects have no cluster-level resources, sourceNamespaces precise, cluster-lab2 Secret not committed to Git).
Run the negative assertion script (from the “Commands” tab); all should output No.
Check K8s write permission on the argocd namespace: kubectl auth can-i create applications.argoproj.io -n argocd --as alice should be no; kubectl auth can-i get secrets -n argocd --as alice should be no.
Export backup: argocd admin export -n argocd > ~/argocd-backup-$(date +%F).yaml, and confirm the file contains projects, apps, and cluster Secrets; this file contains secrets, so move it to a protected location and then delete the local copy.

Case 1: quarterly review finds a “shadow admin”

Problem: The review found a CI service account with access to the argocd namespace, has a edit ClusterRole binding (to “auto-create apps”), which is equivalent to an Argo CD admin and can read all cluster Secrets. Approach: Change to apps-in-any-namespace + team namespaces, or create apps via the Argo CD API using a project token. Limitations: Requires reworking the CI pipeline.

Case 2: review before the v3 upgrade

Problem: Plan to upgrade from 2.14 to 3.x. Approach: Add to the review checklist: complete logs permissions, fine-grained update/delete changes, Dex principal changes, default annotation tracking, default resource exclusions; in the staging environment, use rbac can to run all assertions. Limitations: When upgrading across multiple minor versions, read each upgrading doc one by one (3.0→3.1→…→3.6).

Case 3: team count grows from 5 to 50

Problem: Hand-written projects and policies are unmaintainable. Approach: Use one Helm chart / ApplicationSet to generate AppProject from a “team list” (YAML list: team name, group, repo, clusters),policy.<team>.csv, team namespaces, and RoleBindings; the review object changes from “50 YAML files” to “1 template + 1 list”. Limitations: A template error affects all teams at once, so it needs stricter testing.

Interactive troubleshooting tree: multi-tenant and multi-cluster

Quick reference of common errors

permission denied: …, sub: …

RBAC denied → Module 3 (run with the four-part tuple from the error rbac can).

InvalidSpecError: … is not permitted in project / do not match any of the allowed destinations

Project denied → Module 2

resource GROUP:KIND is not permitted in project P

Resource kind rejected → Module 2.

Cluster … connection refused / no such host / x509

Cluster address or certificate issues → Module 5.

is not permitted to use project

sourceNamespaces → Module 7.

Command-line exercises
1. List all Kubernetes permissions that user alice has in the argocd namespace.
kubectl auth can-i --list -n argocd --as alice
2. Use an offline policy file to assert that the team-b group cannot sync any app in the platform project.
argocd admin settings rbac can my-org:team-b sync applications 'platform/*' --policy-file argocd-rbac-cm.yaml
Scenario analysis
The CISO asks: “If team-a's GitHub repo is compromised, what is the worst that could happen?” Answer based on this lesson's target design.

An attacker can change manifests in the team-a directory, and Argo CD will sync them to what the team-a project allows: the team-a-* namespaces on both clusters, limited to namespace-scoped resources not on the deny list (no ClusterRole, Quota, NetworkPolicy, or RoleBinding). Possible consequences: running malicious workloads in the team-a namespace (crypto mining, lateral scanning) and reading Secrets inside the team-a namespace. Controls: image policy / admission control, default-deny NetworkPolicy (pushed by the platform), ResourceQuota, branch protection and signed commits (project sourceIntegrity), monitoring for anomalous syncs. team-b and the platform are unaffected.

Verified teaching videos

▶
Scaling Argo Security and Multi-Tenancy in AWS EKS at the New York... David Grizzanti & Luke Philips — CNCF [Cloud Native Computing Foundation]
English · Real-world multi-tenant security design and review points
▶
Declarative...ish? Fixing Hidden Argo CD Pitfalls in Your GitOps Setup - Regina Voloshin — CNCF [Cloud Native Computing Foundation]
English · Hidden traps in declarative configuration
▶
Control Plane, Service, or Both? – Argo CD Multi-Cluster Architectures - Nicholas Morey, Akuity — Continuous Delivery Foundation
English · Architecture trade-offs

Official docs

Video storyboard script (about 90 seconds)

Shot 1 · 0–20s
Visual: three zones: Git, the argocd control plane, and target clusters, with a dashed trust boundary drawn between them.
Narration: when reviewing multi-tenant Argo CD, first map out the three trust zones.
Shot 2 · 20–50s
Visual: a red arrow tries to cross the boundary from the team repo, and is stopped in turn by the project, RBAC, and sourceNamespaces.
Narration: go through the privilege-escalation paths one by one: the default project, write access to the argocd namespace, RBAC wildcards, and exec.
Shot 3 · 50–75s
Visual: in the terminal, a column of rbac can assertions all output No.
Narration: write the negative assertions as a script, put it in CI, and validate automatically every time the policy changes.
Shot 4 · 75–90s
Visual: the scorecard changes from red to green.
Narration: a review is not one-off; repeat it for major upgrades and when onboarding new teams.
or score ≥ 70% on the quiz

Command cheat sheet

Argo CD v3.6 · Multi-cluster and multi-tenant · every code block can be copied with one click
After-class reference

AppProject

argocd proj list
argocd proj create P -d https://kubernetes.default.svc,'P-*' -s REPO
argocd proj add-source P REPO           # '!REPO' means negation
argocd proj add-destination P lab2 'P-*' --name
argocd proj allow-cluster-resource P "" Namespace
argocd proj deny-namespace-resource P "" ResourceQuota
argocd proj get P -o yaml
argocd app set APP --project P          # only for hand-written apps
# Apps generated by ApplicationSet: change spec.template.spec.project in Git
kubectl -n argocd get appset -o custom-columns=NAME:.metadata.name,PROJECT:.spec.template.spec.project
kubectl -n argocd get app APP -o jsonpath='{.metadata.ownerReferences[*].name}'
kubectl -n argocd get appproj

Sync windows and orphaned resources

argocd proj windows add P --kind allow --schedule "0 9 * * 1-5" \
  --duration 8h --namespaces 'P-prod' --manual-sync --time-zone "America/Toronto"
argocd proj windows list P
argocd proj windows delete P ID
argocd app resources APP --orphaned
# spec.orphanedResources: { warn: true, ignore: [{kind: ConfigMap, name: "x-*"}] }

RBAC

g, my-org:team-a, role:team-a-dev
p, role:team-a-dev, applications, get,  team-a/*, allow
p, role:team-a-dev, applications, sync, team-a/*, allow
p, role:team-a-dev, logs, get, team-a/*, allow          # v3 requires explicit grant
p, role:team-a-dev, applications, delete/*/Pod/*/*, team-a/*, allow
p, role:team-a-dev, applications, delete, team-a/*, deny
p, role:oncall, applications, action/apps/Deployment/restart, */*, allow
# Any namespace: project/namespace/application
p, role:team-a-dev, applications, get, team-a/team-a-apps/*, allow

RBAC tests

argocd admin settings rbac validate --policy-file argocd-rbac-cm.yaml
argocd admin settings rbac can SUBJ ACTION RESOURCE OBJ --policy-file F
argocd admin settings rbac can SUBJ ACTION RESOURCE OBJ --namespace argocd
argocd account can-i sync applications 'team-a/*'
argocd account get-user-info
argocd account list

Local users and project tokens

# argocd-cm: accounts.alice: login   accounts.ci: apiKey
argocd account update-password --account alice --current-password ADMINPW --new-password NEW
argocd proj role create P ci
argocd proj role add-policy P ci -a sync -o APP -p allow
argocd proj role create-token P ci -e 24h -t
argocd proj role get P ci
argocd proj role delete-token P ci ISSUED_AT
ARGOCD_AUTH_TOKEN=… argocd app sync APP

SSO

url: https://argocd.example.com
dex.config: |
  connectors:
  - type: github
    id: github
    name: GitHub
    config:
      clientID: …
      clientSecret: $argocd-sso:dex.github.clientSecret
      orgs: [{ name: my-org, teams: [team-a, platform] }]
      teamNameField: slug
# or direct OIDC (Entra ID)
oidc.config: |
  name: Entra ID
  issuer: https://login.microsoftonline.com/TENANT/v2.0
  clientID: …
  azure: { useWorkloadIdentity: true }
  requestedIDTokenClaims: { groups: { essential: true, value: ApplicationGroup } }
  requestedScopes: [openid, profile, email]

Multi-cluster

argocd cluster add kind-lab2 --name lab2 --cluster-endpoint kube-public --yes
argocd cluster add CTX --name N --namespace ns1 --namespace ns2 --project P
argocd cluster list
argocd cluster get lab2 -o yaml
argocd cluster rotate-auth lab2
argocd cluster rm lab2 --yes
kubectl -n argocd get secret -l argocd.argoproj.io/secret-type=cluster
kubectl -n argocd annotate secret S argocd.argoproj.io/skip-reconcile=true
kubectl -n argocd label secret cluster-lab2 gitops-lab/managed=true   # = lets the label-selected ApplicationSet fan out to lab2
argocd appset generate ~/appset-lab/podinfo-matrix.yaml               # preview before and after adding labels
argocd admin cluster stats -n argocd
kind get kubeconfig --name lab2 --internal | grep server

Cluster Secret

apiVersion: v1
kind: Secret
metadata:
  name: cluster-lab2
  namespace: argocd
  labels: { argocd.argoproj.io/secret-type: cluster, env: lab2 }
type: Opaque
stringData:
  name: lab2
  server: https://lab2-control-plane:6443
  # namespaces: team-a-dev,team-b-dev
  # clusterResources: "false"
  # project: team-b
  config: |
    { "bearerToken": "…", "tlsClientConfig": { "caData": "…" } }

Applications in any namespace

# argocd-cmd-params-cm: application.namespaces: "team-a-apps, team-b-apps"
# AppProject: spec.sourceNamespaces: [team-a-apps]
kubectl -n argocd rollout restart deploy/argocd-server sts/argocd-application-controller
argocd app list -N team-a-apps
argocd app get team-a-apps/podinfo
argocd app sync podinfo -N team-a-apps
# REST: GET /api/v1/applications/podinfo?appNamespace=team-a-apps

Review

kubectl auth can-i --list -n argocd --as USER
kubectl -n argocd get rolebinding,clusterrolebinding -o wide | grep -i argocd
kubectl -n argocd get cm argocd-cm -o yaml | grep -E 'admin.enabled|exec.enabled|accounts\.'
kubectl -n argocd get cm argocd-rbac-cm -o jsonpath='{.data.policy\.default}'
argocd admin export -n argocd > backup.yaml

v3 changes at a glance

ChangeKey takeaway
logs permissionRequired since 3.0 logs, get
update / deleteSince 3.0, applies only to the Application itself; for sub-resources, use update/*,delete/*
Dex principalSince 3.0, uses federated_claims.user_id
Resource trackingDefault annotation since 3.0
Cluster version formatSince 3.4 vMajor.Minor.Patch
impersonationSince 3.5, also applies to API server operations (logs, events, resource deletion, etc.)
Project signing keysSince 3.5 signatureKeys Deprecated; use sourceIntegrity

Capstone lab + final quiz

Deliver a dual-cluster Argo CD platform for team-a / team-b that is “self-service but stays within bounds”, and use assertions to prove the boundaries work
After class ≈ 40 minCovers all modules
Scenario The platform team must hand lab (Hub) and lab2 to two teams. Requirements: ① each team can deploy only from its own repo directory into its own namespaces (on both clusters), and cannot deploy cluster-level resources or quota/network policies; ② team members log in via SSO (members without a GitHub org use local users alice/bob instead), can only see and sync their own team's apps, can view logs and delete Pods, but cannot delete apps; ③ CI can only sync specified apps, with tokens expiring after 24 hours; ④ team-a-prod can auto-sync only on weekdays from 9–17; ⑤ teams can self-serve, declaring Applications in team-x-apps namespaces; ⑥ lab2 is registered with a declarative Secret and uses the Docker internal address; ⑦ all configuration lives in Git (except cluster tokens).
Prerequisite checks (Modules 0, 5)
kubectl --context kind-lab -n argocd get pods
argocd cluster list
argocd proj list
kubectl --context kind-lab get ns | grep -E 'team-(a|b)'

lab2 not in the list → go back to the Module 5 lab; missing project → Module 1 lab.

Projects (Modules 1, 2, 7): confirm argocd/projects/team-a.yaml and team-b include, precisely: sourceRepos; destinations are in-cluster and lab2 ’s team-x-*; clusterResourceWhitelist: [] the deny list includes ResourceQuota, LimitRange, NetworkPolicy,rbac.authorization.k8s.io ’s Role and RoleBinding orphanedResources.warn: true; sourceNamespaces: [team-x-apps] team-a adds:
  syncWindows:
  - kind: allow
    schedule: "0 9 * * 1-5"
    duration: 8h
    namespaces: ["team-a-prod"]
    manualSync: true
    timeZone: "America/Toronto"
  roles:
  - name: developer
    groups: ["my-org:team-a"]
    policies:
    - p, proj:team-a:developer, applications, get, team-a/*, allow
    - p, proj:team-a:developer, applications, sync, team-a/*, allow
    - p, proj:team-a:developer, logs, get, team-a/*, allow
    - p, proj:team-a:developer, applications, delete/*/Pod/*/*, team-a/*, allow
  - name: ci
    policies:
    - p, proj:team-a:ci, applications, sync, team-a/team-a-podinfo, allow
    - p, proj:team-a:ci, applications, get, team-a/team-a-podinfo, allow
default locked down, generated apps migrated (Module 1): argocd proj get default ’s Destinations and Repositories are <none>, and confirm the migration was done at the template layer:
kubectl -n argocd get appset -o custom-columns=NAME:.metadata.name,PROJECT:.spec.template.spec.project
kubectl -n argocd get app -o custom-columns=NAME:.metadata.name,PROJECT:.spec.project,OWNER:.metadata.ownerReferences[0].name
grep -rn "project: default" ~/gitops-lab/argocd/ || echo "no default left in Git"
NAME              PROJECT
podinfo           platform
podinfo-preview   platform
NAME                  PROJECT    OWNER
podinfo-dev           platform   podinfo
podinfo-prod          platform   podinfo
podinfo-staging       platform   podinfo
root                  platform   <none>
team-a-podinfo        team-a     <none>
team-a-podinfo-lab2   team-a     <none>
no default left in Git
RBAC and SSO (Modules 3, 4): in values, set policy.default: "",scopes: "[groups, email]", the platform group role:admin, team groups are authorized via project roles (previous step) or argocd-rbac-cm; exec.enabled: false. helm upgrade Then run the Module 8 negative assertion script (all No), then run the positive assertions:
argocd admin settings rbac can my-org:team-a sync applications 'team-a/team-a-podinfo' --namespace argocd
argocd admin settings rbac can my-org:team-a get logs 'team-a/team-a-podinfo' --namespace argocd
argocd admin settings rbac can my-org:team-a 'delete//Pod/team-a-dev/podinfo-x' applications 'team-a/team-a-podinfo' --namespace argocd
argocd admin settings rbac can my-org:team-a delete applications 'team-a/team-a-podinfo' --namespace argocd

The first three should be Yes, the last should be No. Sub-resource actions go in the “action” position, in the format delete/<group>/<kind>/<ns>/<name>, where the core group is empty (two slashes in a row). If you use project roles instead of argocd-rbac-cm for authorization,rbac can reads only ConfigMap; instead, use the SSO-logged-in argocd account can-i to verify.

CI token (Module 3): argocd proj role create-token team-a ci -e 24h -t, use it to confirm team-a-podinfo syncs successfully and a team-b app sync fails, then revoke it.
Multi-cluster (Module 5): argocd cluster list in lab2’s SERVER is https://lab2-control-plane:6443 (or container IP + serverName), status Successful; the cluster Secret does not appear in Git (git -C ~/gitops-lab grep -n bearerToken returns no results).
Team self-service (Module 7): alice (K8s identity), in team-a-apps declares an app that deploys to lab2 team-a-prod ; outside working hours, observe it blocked from auto-sync by the sync window (argocd app get shows window info), and during working hours auto-sync succeeds.
Commit and clean up: git add -A && git commit -m "Lesson 4: multi-tenant platform" && git push. Keep lab and lab2 for Lesson 5 (Lesson 5 encrypts the cluster-lab2 Secret and puts it in Git). If you need to free resources: kind delete cluster --name lab2.
Acceptance checklist

Open-ended self-check (answer first, then expand the reference answer)

1. What question does RBAC answer, and what does AppProject answer? Why is the relationship AND?

RBAC answers “who can perform what action on which project/application”; AppProject answers “where this app can be pulled from, deployed to, and what it may deploy”. Having sync permission does not mean the app can deploy a ClusterRole; a project allowing ClusterRole deployment does not mean any user can trigger a sync. A change happens only when both checks pass.

2. Describe the RBAC decision order for a request.

First, evaluate by policy.default ; a match takes effect; otherwise match the user itself, then each group (from scopes) — g lines expand role inheritance (project roles generate g lines at runtime); in glob matching, “/” is not a separator; any deny rejects; allow with no deny is permitted; no match means deny.

3. What breaking RBAC changes are in v3? How do you migrate each one?

logs permission is now enforced by default: for every role with applications get, add logs, get; update/delete no longer inherit to sub-resources: when needed, write update/*,delete/* or finer-grained sub-resource actions, or set server.rbac.disableApplicationFineGrainedRBACInheritance: "false" to restore the old behavior; the Dex principal changes to federated_claims.user_id: policies written for users need updating.

4. In kind, why can't you use the address in kubeconfig to register a second cluster? What are the correct approaches?

In kubeconfig it is the host's port mapping 127.0.0.1:port, but a controller inside a Pod reaching 127.0.0.1 only reaches itself. Correct approaches: argocd cluster add … --cluster-endpoint kube-public (read the https://lab2-control-plane:6443) in cluster-info, or write the address / container IP into a declarative Secret (with serverName). Do not use internal, as that would point to the Hub itself.

5. When does Hub-and-spoke versus one Argo CD per cluster each fit?

Hub: few clusters, reachable network, need a unified view and config; the cost is centralized credentials and a large blast radius. One per cluster: edge / disconnected / strong isolation / team autonomy; the cost is N upgrades and configs. Compromise: one Hub per environment, sharding, argocd-agent pull mode.

6. When enabling “Applications in any namespace”, what security rules must you follow?

Global application.namespaces lists only team app namespaces; the project sourceNamespaces is only granted to the matching team project; never to default/platform or other privileged projects; never include argocd; K8s write permission on the argocd namespace goes only to admins (apps there can reference any project); use three-part RBAC objects and note wildcards don't split; annotation resource tracking is recommended.

Final quiz (12 questions, covering all modules)

Sources and version notes

Verification basis for all technical facts in this lesson (verified 2026-11-17)
TopicVerification resultSource (accessed 2026-11-17)
Argo CD versionLatest v3.6.1 (2026-11-04), v3.6.0 (2026-11-03); concurrent patches v3.5.7, v3.4.13, v3.3.19argo-cd releases
Helm chartargo/argo-cd 10.18.0, appVersion v3.6.1; bundled Dex image v2.46.1; configs.cm,configs.rbac (default scopes: "[groups]"),configs.params,configs.clusterCredentials,configs.secret.extra; when configs.params."application.namespaces" is set, argocd-server's ClusterRole automatically adds create/delete/update/patch on applicationsargo-helm/charts/argo-cd(Chart.yaml, values.yaml, templates/argocd-server/clusterrole.yaml)
AppProjectfield and default semantics; the default project starts fully open, editable but not deletable, with an official locked-down example; for sourceRepos/destinations: *,**,! matching; cluster-level allowlist / namespace-level denylist; name restrictions; project-level cluster implicit destinations and permitOnlyProjectScopedClusters; global projects; project roles and JWTProjects · project.yaml
orphaned resources / sync windowsexception resources, ignore, performance tips; allow/deny evaluation with deny precedence, manualSync, syncOverrun, timeZone, andOperator; CLI argocd proj windows add parametersOrphaned Resources · Sync Windows
RBACresource/action table; object format; policy.default cannot be revoked by deny; evaluation order; in glob “/” is not a separator; clusters object is a URL; scopes default [groups]; warning for local users with the same name as SSO users; policy.*.csv concatenation; rollback / override switches; built-in roles (builtin-policy.csv)RBAC Configuration · builtin-policy.csv
v3 Breaking Changes3.0: logs enforced (removed server.rbac.log.enforce.enable), update/delete not inherited (server.rbac.disableApplicationFineGrainedRBACInheritance), Dex principal federated_claims.user_id, default annotation tracking, default resource.exclusions; 3.4: Dex upgrade, cluster version format; 3.5: impersonation extended to API operations,signatureKeys deprecated, changed to sourceIntegrity2.14→3.0 · 3.3→3.4 · 3.4→3.5
SSOthe choice between Dex and direct OIDC, callback paths,$secret:key reference and label requirements, groups refreshed only at authentication,dex.auth.connectorId (Alpha); Entra: callback, User.Read, groups claim, object ID, Workload Identity, 200-group overflow enableUserGroupOverageClaimUser Management · Microsoft
Dex GitHub connectorgroup claims (org):(team); teams filtering; teamNameField (name / slug / both); loadAllGroupsDex GitHub connector
cluster registrationcluster Secret fields; namespaces connection-count hint; skip-reconcile annotation; EKS / GKE / AKS (argocd-k8s-auth, workloadidentity) examples; argocd cluster add parameters (--cluster-endpoint kubeconfig|kube-public|internal,--server-proxy-url etc.), read from the kube-public endpoint kube-public/cluster-info (checked against v3.6.1 source cmd/argocd/commands/cluster.go and cmd/util/cluster.go)Declarative Setup · Clusters · argocd cluster add
any namespacesince v2.5; requires cluster-wide installation; --application-namespaces / application.namespaces; sourceNamespaces; apps in the control plane may reference any project; name ns/name, REST appNamespace, RBAC three-part form; ApplicationSet cannot generate across namespaces (#11104)Applications in any namespace
Sharding and topologysharding algorithms legacy / round-robin / consistent-hashing (the last two are experimental); argocd-agent v0.11.0 (2026-11-11), argoproj-labs, managed / autonomous modesHigh Availability · argocd-agent
Original error messagesapplication repo … is not permitted in project,… do not match any of the allowed destinations in project,resource G:K is not permitted in project,cannot sync: blocked by sync window,app is not allowed in project …, or the project does not exist,… is not permitted to use project … (checked against v3.6.1 source: util/argo/argo.go, controller/sync.go, server/application/application.go)argo-cd v3.6.1 source
kind / podinfokind v0.33.0 (2026-08-26), node image kindest/node:v1.37.0 (consistent with the K8s lesson); latest podinfo 6.17.0 (2026-10-26)kind releases · podinfo releases

Video verification notes

The following videos were checked on 2026-11-17 via the YouTube oEmbed endpoint for title and channel: Gerald Nunn, “Managing Argo CD Multi-Tenancy Effectively” (CNCF, HoVljPnJO1c); “Scaling Argo Security and Multi-Tenancy in AWS EKS at the New York... David Grizzanti & Luke Philips” (CNCF, rro686bRIQU); “🔐 ArgoCD User Management & RBAC Explained 👥 | Create Users, Passwords & Okta SSO 🌐” (Ashok Kumar, NPIo1c5LXI8); “How to configure GitHub Single Sign-On (SSO) with ArgoCD | GitOps | Adding Certbot SSL to ArgoCD SSO” (DevOps Hint, jnV4IBD6Q0Y); “ArgoCD SSO with Entra ID Made Easy” (Programming with Wolfgang, cI3G8hBrKXg); “How to add External Cluster to ArgoCD | ArgoCD Tutorial” (FoxuTech, El7zRS5w0dc); “Control Plane, Service, or Both? – Argo CD Multi-Cluster Architectures - Nicholas Morey, Akuity” (Continuous Delivery Foundation, 6Pqbks-SZfE); “Scale GitOps With the Argo CD Agent and Open Cluster Management - Joshua Packer, Red Hat” (CNCF, trR8OcmizXQ); “Argo CD Self-Heal, Sync Windows and Diffing” (mkdev, I77xIKNaNRg); “Declarative...ish? Fixing Hidden Argo CD Pitfalls in Your GitOps Setup - Regina Voloshin” (CNCF, VfVQj4Oa3z0); “ArgoCD Tutorial for Beginners | GitOps CD for Kubernetes” (TechWorld with Nana, MeU5_k9ssrs). No verified topic video was found for Module 7 (applications in any namespace), so a shot script is provided instead. Community videos may have been recorded against v2; where they touch RBAC default behavior, follow this lesson's v3 notes.

Audio narration notes

The “Audio” tab uses the browser's Web Speech API (speechSynthesis, en-US) reads the narration script aloud in real time; English terms are pronounced with en-US, and the result depends on the voices installed in the operating system. This courseware has no embedded MP3; for offline audio, hand the narration script to a TTS service to generate it.

Known limitations

  • Commands in this courseware have not been run on a real cluster; “Expected output” examples were compiled from official documentation and source code; name suffixes, IPs, ports, timestamps, token IDs and resource counts are sample values, and column widths and wording may differ slightly from your version.
  • This lesson's starting point depends on the results of Lesson 3 (root, ApplicationSet podinfo / podinfo-preview, carrying gitops-lab/managed the label on the in-cluster Secret,~/appset-lab/podinfo-matrix.yaml); Module 1's sed assumes that the project: default format matches Lesson 3; if you edited these files, make the changes by hand. Put team application overlays in apps/team-a/ rather than apps/podinfo/overlays/, so they are not treated as new environments by the ApplicationSet podinfo 's Git directory generator.
  • Cross-cluster access in kind depends on the Docker network kind and Docker's built-in DNS; in some environments (certain Docker Desktop / rootless / custom network setups), Pods cannot resolve container names, so use the container IP instead and set serverName; whether the kubeadm certificate SAN includes the IP must be verified in your environment. kube-public/cluster-info The address depends on kind's kubeadm configuration; confirm it first by following Module 0, step 3.
  • The SSO lab requires a GitHub organization and an OAuth App; Entra ID, AKS Workload Identity and EKS IAM are only shown as configuration shapes and are not exercised in this lesson, so follow the official docs and chart values for the fields (helm show values argo/argo-cd --version 10.18.0).
  • The exact location of project role JWT issuance records in the project object changes between versions; this lesson only gives the principle of “configuring ignoreDifferences on the token records”. Check the specific fields against the kubectl get appproj -o yaml actual output is authoritative.
  • argocd-agent is still published under argoproj-labs; for its features and maturity, refer to its documentation. The round-robin / consistent-hashing sharding algorithms are officially marked as experimental.
  • The decision logic in the animations is a simplified implementation of the official rules (glob uses simple wildcards, windows use preset times); the weights in the topology calculator and review scorecard are illustrative teaching values.