Argo CD Hour 4: Multi-Cluster and Multi-Tenancy — Project, RBAC, and SSO
- Use AppProject for
team-a,team-b, andplatformto 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-cmConfigMap'spolicy.csv(p/g— two kinds of lines),policy.default,scopes; understand the v3 RBAC changes:logs, getis enforced by default,update/deleteare 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
lab2to Argo CD:argocd cluster add --cluster-endpoint kube-publicand 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
| # | Time | Module | Core content | Animation / interaction | Lab (kind: lab + lab2) |
|---|---|---|---|---|---|
| 0 | Before class | Prep: second cluster and team examples | Create kind cluster lab2, verify the Docker network, and prepare team namespaces and the repo directory | Environment self-check checklist | Both clusters on the same kind network |
| 1 | 00–06 | Multi-tenancy model: AppProject boundaries | default project risks, five AppProject constraints, tenant models (project / namespace / cluster), global projects | Tenant boundary explorer | Create team-a / team-b / platform projects and lock down default |
| 2 | 06–13 | Sources, destinations, and cluster resource allowlists | sourceRepos wildcards and negations, destinations (server/name), cluster resource allowlist vs. namespace resource denylist, orphaned resources, sync windows | AppProject validation simulator (core animation #2) | Deploy out of bounds on purpose and observe InvalidSpecError and SyncError |
| 3 | 13–21 | RBAC: policy.csv, roles, and project tokens | Casbin model, p/g lines, built-in roles, policy.default, deny precedence, v3 changes (logs, fine-grained update/delete), project roles + JWT | RBAC decision animation (core animation #1) | Local users alice/bob + argocd admin settings rbac can + CI token |
| 4 | 21–28 | SSO: Dex and OIDC (GitHub / Entra ID) | Two SSO approaches, callback URLs, group claims, scopes, Entra group IDs and the 200-group overflow, Workload Identity credentials | OIDC login sequence animation | (optional) GitHub OAuth App + Dex, localhost callback |
| 5 | 28–35 | Multi-cluster: registering clusters and declarative cluster Secrets | argocd 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 animation | Register lab2 and deploy podinfo to lab2 |
| 6 | 35–42 | Hub-and-spoke vs. one Argo CD per cluster | blast radius, network direction, credential centralization, scale and sharding, argocd-agent, and hybrid designs for the two topologies | Topology trade-off calculator | Observe the controller's connection to and cache of lab2 |
| 7 | 42–50 | Applications in any namespace | application.namespaces,sourceNamespaces, RBAC object three-part format, caveats (control-plane namespace, ApplicationSet limits) | sourceNamespaces admission simulator | team-a declares an Application in its own namespace |
| 8 | 50–60 | Multi-tenant architecture review | Privilege-escalation path checklist, review scoring, common anti-patterns, troubleshooting tree | Architecture review scorecard + troubleshooting tree | Review a given design and fix it |
| — | After class | Cheat sheet · Capstone lab | Deliver a self-service but in-bounds dual-cluster platform for team-a / team-b | Final quiz (12 questions) | Capstone lab |
Knowledge Coverage Matrix
| Target skills | M1 | M2 | M3 | M4 | M5 | M6 | M7 | M8 | Key commands / objects | Lab |
|---|---|---|---|---|---|---|---|---|---|---|
| Isolate teams with AppProject | ✓ | ✓ | · | · | · | · | ✓ | ✓ | argocd proj create/get | Three projects |
| Restrict sources, destinations, and resource kinds | · | ✓ | · | · | ✓ | · | · | ✓ | sourceRepos,destinations, allowlists/denylists | Out-of-bounds deployment |
| Orphaned resources and sync windows | · | ✓ | · | · | · | · | · | ✓ | orphanedResources,argocd proj windows | prod window |
| Write and test RBAC policies | · | · | ✓ | ✓ | · | · | ✓ | ✓ | argocd admin settings rbac can | alice / bob |
| Use least-privilege tokens in CI | · | · | ✓ | · | · | · | · | ✓ | argocd proj role create-token | ci role |
| SSO and group mapping | · | · | ✓ | ✓ | · | · | · | ✓ | dex.config,oidc.config,scopes | GitHub Dex (optional) |
| Register and manage external clusters | · | · | · | · | ✓ | ✓ | · | ✓ | argocd cluster add/list, cluster Secret | lab2 |
| Choose a multi-cluster topology | · | · | · | · | ✓ | ✓ | · | ✓ | sharding, argocd-agent | topology calculator |
| Tenant self-service: declaring Applications | · | · | ✓ | · | · | · | ✓ | ✓ | application.namespaces,sourceNamespaces | team-a namespace |
| Multi-tenant architecture review | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | Review checklist | Capstone lab |
What this course does not cover (and where to learn it)
| Topic | Why it is not in this course | Where to learn it |
|---|---|---|
| Argo CD installation, Application basics, sync and health | Covered in Lessons 1–2 | Lesson 1 · Lesson 2 |
| ApplicationSet generators (the Cluster generator expands per cluster) | A Lesson 3 topic; this course only references cluster Secret labels in M5/M6 | Lesson 3 |
| Repository credentials and secrets management (Sealed Secrets / ESO / SOPS) | Belongs to the secrets topic | Lesson 5 |
| Controller sharding tuning, performance, and OutOfSync troubleshooting | Belongs to the advanced operations topic; this course's M6 covers concepts only | Lesson 7 |
| Full cloud labs for AKS Workload Identity and EKS IAM | Requires a cloud subscription and incurs costs; this course covers configuration shapes only | AKS 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 relate | Kubernetes 8 + 1 hour course(security lesson) |
How to use this courseware
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.
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).
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.
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)
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- Lesson 1 output: kind cluster
lab(contextkind-lab), namespaceargocdwhere Argo CD was installed with Helm releaseargocdand values file~/gitops-lab/bootstrap/argocd-values.yaml. - GitHub repository
https://github.com/<you>/gitops-lab(local~/gitops-lab), which containsapps/podinfo/base/andoverlays/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
adminadmin 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.
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
kind 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",
…
}
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).
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
- 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
defaultproject, and what happens after you lock it. - For
team-a,team-b, andplatformchoose the right tenant model and manage projects with declarative YAML.
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).
| Field | Question it answers | Default (when unset) |
|---|---|---|
sourceRepos | Which Git / Helm / OCI repositories can manifests be pulled from? | empty = none allowed |
destinations | Which namespaces in which clusters can be deployed to? | empty = none allowed |
clusterResourceWhitelist / clusterResourceBlacklist | Which cluster-scoped resources (Namespace, ClusterRole, CRD…) can be created? | an empty allowlist = no cluster-scoped resources allowed |
namespaceResourceBlacklist / namespaceResourceWhitelist | Which namespace-scoped resources can be created? | all empty = all namespace-scoped resources allowed |
roles | Who can do what to this project's applications (project-internal RBAC + JWT)? | no roles |
syncWindows | When is sync allowed / forbidden? | no windows = can sync at any time |
orphanedResources | Are there resources in the target namespace that “do not belong to any application”? | off |
sourceNamespaces | Which namespaces can host Applications that use this project (M7)? | only argocd |
destinationServiceAccounts | When 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
- RBAC (who): argocd-server first checks whether “this user / token is allowed to perform
project/applicationperform this action” (M3). - 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
| Model | Approach | Suitable for | Caveat |
|---|---|---|---|
| Project = team | One project per team, with destinations restricted to team-x-* namespaces (may span multiple clusters) | this lesson's team-a / team-b | Environment differences (dev/prod) are handled by sync windows and roles |
| Project = team × environment | team-a-dev,team-a-prod two projects, with stricter roles on the prod project | prod requires different approvers | number of projects = teams × environments; global projects can reduce duplication |
| Project = platform layer | platform the project can deploy cluster-scoped resources (CRDs, Ingress controllers, monitoring stack) | platform team | only 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 AppProject | Flux multi-tenancy | Kubernetes-native | |
|---|---|---|---|
| Boundary carrier | AppProject CRD (argocd namespace) | One namespace per tenant + the serviceAccountName | Namespace + RBAC + ResourceQuota |
| Who performs deployment | controller SA (optionally impersonating the tenant SA) | tenant SA (impersonation is the default practice) | the user themselves |
| Restrict source repositories | sourceRepos | Source objects live in the tenant namespace; restrictable with policies | none |
| UI / SSO | Built-in UI + SSO + project roles | no built-in UI | — |
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
Flowchart: checks an Application creation must pass
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
| Command | Purpose | Key parameters / notes |
|---|---|---|
argocd proj create | Create project | -d SERVER,NS (target),-s REPO (source) ,--description,--upsert |
argocd proj get / list | View projects | -o yaml View the full spec |
argocd proj add-source / remove-source | Add or remove allowed sources | supports !REPO negation |
argocd proj add-destination | Add destinations | PROJECT SERVER NAMESPACE (space-separated); add --name indicates the second argument is a cluster name |
argocd proj allow-cluster-resource | cluster-scoped resource allowlist | PROJECT GROUP KIND, core group written as "" |
argocd proj deny-namespace-resource | namespace-scoped resource denylist | PROJECT GROUP KIND |
argocd app set APP --project P | Move an application to another project | requires permission on the new project |
kubectl -n argocd get appproj | View CRDs directly | short 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)
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: truecd ~/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: '*'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 …
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.
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.
# 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.
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: */* …
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.
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
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
Official documentation
Video storyboard (about 90 seconds)
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.
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.
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.
On screen: the default gate is locked, with a sign reading “cleared.”
Narration: finally, clear the default project. Migrate first, then lock.
Module 2 · Sources, destinations, and cluster resource allowlists
- Write correct
sourceRepos(*,**,!negation) anddestinations(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).
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 examplehttps://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
refvalues.
2. destinations — where things can be deployed
- Each rule has
server(API address) and/orname(cluster name) andnamespace, all of which support wildcards and!negation; matching works the same as for sources. - CLI
argocd proj add-destinationMatching 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
projectfield, 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. SettingpermitOnlyProjectScopedClusters: truecan restrict the project so that it deploys only to clusters that belong to it.
3. Resource kinds — what can be deployed
| Resource scope | Main mechanism | When neither is set | Restrict by name |
|---|---|---|---|
| Cluster-scoped (Namespace, ClusterRole, CRD, StorageClass…) | clusterResourceWhitelist (allowlist) + clusterResourceBlacklist | all denied | supports name (glob), for example to allow only team1-* Namespaces with the name pattern |
| Namespace-scoped (Deployment, Secret, ResourceQuota…) | namespaceResourceBlacklist (denylist) or namespaceResourceWhitelist | all allowed | CLI 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: truethe application showsOrphanedResourceWarningcondition. The following are never treated as orphans: resources denied by the project, the ServiceAccount nameddefaultServiceAccount,defaultthe namespace'skubernetesService, and each namespace'skube-root-ca.crtConfigMap; you can useignorean 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+ cronschedule+duration, usingapplications/namespaces/clustersto select applications (OR by default; can setandOperator), and can also settimeZone. 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: trueManual sync outside a window is allowed whensyncOverrunallows 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
- argocd-server: when creating or updating an Application, the source and destination are validated (API layer; errors are shown immediately).
- application-controller: each reconciliation re-validates source and destination (to stop anyone writing CRs directly with kubectl); if invalid, the application shows
InvalidSpecErroran InvalidSpecError condition. - 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.
- Before sync: checks sync windows; when blocked, automatic sync is skipped and manual sync errors (unless
manualSync).
When: recommended configuration
| Project | sourceRepos | destinations | Resources | Windows |
|---|---|---|---|---|
| team-a / team-b | Team repository (exact URL) | team-x-*, matched by cluster name | Cluster-scoped: none; denylist: Quota / LimitRange / NetworkPolicy | prod namespaces: allow on weekday daytime,manualSync: true |
| platform | Platform repo + specified Helm repos | all clusters,!kube-system | Cluster-scoped: allowlist as needed (avoid *) | holiday freeze deny |
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
Sync window timeline (example: team-a-prod allow on weekdays 09:00–17:00, deny on Fridays 16:00–24:00)
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.
Core commands and parameters
| Command | Purpose | Notes |
|---|---|---|
argocd proj add-source P '!URL' | Add a negated source | In the shell, ! use single quotes |
argocd proj add-destination P lab2 'team-a-*' --name | Add a destination by cluster name | Without --name the first argument is the server URL |
argocd proj allow-cluster-resource P GROUP KIND | cluster-scoped allowlist | core group written as "" |
argocd proj deny-namespace-resource P GROUP KIND | namespace-scoped denylist | — |
argocd proj windows add P | Add a sync window | --kind allow|deny --schedule "0 9 * * 1-5" --duration 8h --namespaces … --manual-sync --time-zone |
argocd proj windows list P | View windows and whether they are currently active | — |
argocd app get APP --show-operation | View the reason for a sync failure | CONDITION / MESSAGE columns |
argocd app resources APP --orphaned | List orphaned resources | requires 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)
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'
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'
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.
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.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
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.
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*'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
Official documentation
- Projects (wildcards and negation for sources and destinations)
- Orphaned Resources Monitoring
- Sync Windows
Video storyboard (about 90 seconds)
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.
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.
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.
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.
Module 3 · RBAC: policy.csv, roles, and project tokens
- Read and write
argocd-rbac-cm:policy.csv(pandglines),policy.default,scopes,policy.matchMode,policy.<any>.csvconcatenated. - 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 canandargocd account can-ito test policies.
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
| Resource | Common actions | Object format |
|---|---|---|
applications | get, create, update, delete, sync, rollback, action/…, override | project/application; when applications in any namespace are enabled, use project/namespace/application (M7) |
applicationsets | get, create, update, delete | project/name (project = the project it can generate applications in) |
logs | get | project/application |
exec | create | project/application (also requires enabling in argocd-cm exec.enabled) |
clusters | get, create, update, delete | cluster server URL; project-scoped clusters use project/URL; does not accept cluster names |
projects,repositories,write-repositories,accounts,certificates,gpgkeys | get, create, update, delete (depending on the resource) | name or URL |
extensions | invoke | extension (and requires get on the corresponding application) |
Built-in roles and default policy
role:readonly: get on all resources (includinglogs, get, */*);role:admin: full permissions, inherits readonly; built-ing, admin, role:admin. Definition inassets/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 asrole:authenticated) or leave it empty, rather thanrole: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”)
- First use the default policy to decide: if the default role already allows (or denies), the result takes effect immediately and evaluation stops.
- Otherwise, check in turn using the user itself, then the each group (from
scopes) to match;grows expand role inheritance (for exampleg, role:admin, role:readonly). Project roles are generated at runtime:g, <group>, proj:<project>:<role>. - Matching mode
policy.matchModedefaultglob:/is not a separator,*can span/. - 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)
| Change | v2 behavior | v3 behavior | Migration |
|---|---|---|---|
| logs permission enforced by default | having 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 UI | Recommended: 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 resources | update/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
plines directly. - For large policies, use
policy.team-a.csvsuch additional keys to split them (concatenated in key-name order afterpolicy.csv, making overlays with Kustomize / Helm easier.
Comparison with Kubernetes RBAC
| Argo CD RBAC | Kubernetes RBAC | |
|---|---|---|
| Protected object | Argo CD API (applications, projects, clusters, repositories, logs, exec) | Kubernetes API |
| deny | supported, and takes precedence | not supported (allow only) |
| Subject sources | local users, SSO groups/emails, project JWTs | User, Group, ServiceAccount |
| Who actually changes the cluster | the controller's SA (or impersonation SA) | the caller themselves |
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
Sequence diagram: CI syncs with a project token
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).
Core commands and parameters
| Command | Purpose | Notes |
|---|---|---|
argocd admin settings rbac validate --policy-file F | Validate policy syntax | F 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 OBJ | Test with the currently logged-in identity | Outputs yes / no |
argocd account list / get-user-info | View the account, current identity, and groups | get-user-info shows Groups |
argocd account update-password --account U | Set a password for a local user | --current-password is the executing account (admin) password |
argocd proj role create / add-policy / add-group | Manage project roles | add-policy -a sync -o APP -p allow -r applications |
argocd proj role create-token P ROLE | Issue JWT | -e 24h expiry,-t output only the token,-i specify the ID |
argocd proj role delete-token P ROLE ISSUED-AT | Revoke tokens | ISSUED-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)
~/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
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.
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.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)
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: …
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.
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
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
Official documentation
Video storyboard (about 90 seconds)
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.
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.
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.
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.
Module 4 · SSO: Dex and OIDC (GitHub / Entra ID)
- 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 claimmy-org:team-ato 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.
What: two SSO approaches
| Built-in Dex | Direct OIDC (Existing OIDC Provider) | |
|---|---|---|
| Configuration keys (argocd-cm) | dex.config | oidc.config |
| Callback URL | https://<argocd>/api/dex/callback (Argo CD sets redirectURI automatically) | https://<argocd>/auth/callback; the CLI additionally needs http://localhost:8085/auth/callback |
| Applies to | the 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 from | produced by the connector (GitHub: org:team) | of the ID token groups claim (or the UserInfo endpoint) |
| Extra components | argocd-dex-server Deployment | none (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
groupsscope when requestingorgs, and the group claim format is(org):(team); ifteamsis listed, only those teams are returned.teamNameFielddecides whether to use the team display name,slug or both—it is recommended to set it explicitly toslug, 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'sfederated:idscope), no longer the internal Dex-encodedsub. 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 callbackhttp://localhost:8085/auth/callback(CLI); grant Microsoft GraphUser.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 Podazure.workload.identity/use: "true", add an annotation to the SAazure.workload.identity/client-id, and add a federated credential in the App registration (AKS OIDC issuer +argocdnamespace +argocd-serverSA). 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
groupsin the token, but an overflow indicator; inoidc.configsetazure.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
| Scenario | Recommended |
|---|---|
| team identities are in GitHub org/team | Dex + GitHub connector |
| enterprise uses Entra ID / Okta, with groups managed in the IdP | Direct OIDC (one fewer component; supports PKCE and refreshTokenThreshold) |
| LDAP / SAML | Dex (LDAP and SAML connectors) |
| need the UserInfo endpoint to supplement groups | Direct OIDC's enableUserInfoGroups, or Dex OIDC connector's getUserInfo |
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
Comparison diagram: Entra ID direct OIDC
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.
Core commands and configuration
| Command / key | Purpose | Notes |
|---|---|---|
argocd login HOST --sso | CLI SSO login | Opens the browser; callback localhost:8085; --sso-port the port can be changed |
argocd account get-user-info | View the current user and groups | View the Groups text here before writing g lines |
argocd-cm: url | External access address | Required for SSO; separate multiple addresses with additionalUrls |
argocd-cm: dex.config | Dex connectors | Dex reloads automatically after changes |
argocd-cm: oidc.config | Direct OIDC | issuer,clientID,requestedScopes,requestedIDTokenClaims,enablePKCEAuthentication,refreshTokenThreshold,logoutURL,rootCA |
argocd-cm: dex.auth.connectorId | Jump directly to a Dex connector (Alpha) | Avoid the selection page when there are multiple connectors |
kubectl -n argocd logs deploy/argocd-dex-server | Dex troubleshooting | View 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)
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.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.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
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 …
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
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.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.
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
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
Official docs
Video storyboard script (about 90 seconds)
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.
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.
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.
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.
Module 5 · Multi-cluster: registering clusters and declarative cluster Secrets
- Explain
argocd cluster addthe actions behind it: in the target cluster, createargocd-managera 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.1is invalid for the controller, and how to use--cluster-endpoint kube-publicor a declarative Secret to write ithttps://lab2-control-plane:6443. - Write a declarative cluster Secret (
name,server,config, optionalnamespaces,clusterResources,project), and understand the authentication models for AKS (Workload Identity) and EKS (IAM).
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:
| Field | Required | Meaning |
|---|---|---|
name | Yes | Cluster name (the Application's destination.name, AppProject destinations use it) |
server | Yes | API server URL —reachable from the controller / server Pod's perspective. |
config | Yes | JSON: bearerToken / username+password / awsAuthConfig / execProviderConfig,tlsClientConfig (caData,certData,keyData,serverName,insecure),proxyUrl,disableCompression |
namespaces | No | Comma-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) |
project | No | Project-scoped cluster: only that project's Applications can use it, and implicitly added to this project's destinations |
shard | No | Specifies which controller shard processes it (Lesson 7) |
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
- The CLI reads the local kubeconfig context (for example
kind-lab2), using your admin credentials to connect to the target cluster. - On the target cluster, in the
kube-system(--system-namespacecan be changed), create a ServiceAccountargocd-manager, ClusterRoleargocd-manager-role(full permissions on all resources) and ClusterRoleBinding, and fetch its long-lived token. When using--namespaceinstead, create Role/RoleBinding in each namespace. - Determines the
server:--cluster-endpoint kubeconfig(default: the address from kubeconfig),kube-public(read the target cluster'skube-public/cluster-infopublished address and CA),internal(equivalent to--in-cluster, writeshttps://kubernetes.default.svc). - 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 add | Declarative Secret (or the chart's configs.clusterCredentials) | |
|---|---|---|
| Pros | One command handles the SA, permissions, and token | Can live in Git (with the Lesson 5 secrets approach), auditable, batchable, and supports exec / IAM auth |
| Cons | Requires your machine to reach both the target cluster and Argo CD at the same time; argocd-manager has full permissions | SA and RBAC must be prepared on the target cluster yourself (can be managed by the target cluster's own GitOps) |
| Suited for | labs and a few clusters | production, dozens to hundreds of clusters, and managed cloud clusters |
Authentication for managed cloud clusters (not part of this lab)
- AKS:
execProviderConfigUses the built-inargocd-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:
execProviderConfigCallsargocd-k8s-auth gcp.
Network diagram: why the Docker internal address must be used
Flow chart: the four outputs of cluster add
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".
Core commands and flags
| Command | Purpose | Key flags |
|---|---|---|
argocd cluster add CONTEXT | Register a cluster | --name,--cluster-endpoint kubeconfig|kube-public|internal,--namespace (repeatable),--cluster-resources,--project,--label,--annotation,--upsert,--yes,--server-proxy-url |
argocd cluster list | List clusters and connection status | -o wide|json|yaml|server |
argocd cluster get NAME|URL | Details (version, cache info) | -o wide |
argocd cluster set NAME | Change name, namespace, etc. | — |
argocd cluster rotate-auth | Rotate the argocd-manager token | Only applies to the SA created by cluster add |
argocd cluster rm NAME|URL | Remove the registration | Migrate 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)
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
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
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: - '*'
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).
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.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).
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.
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)"; done2. 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
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
Official docs
- Declarative Setup · Clusters (includes EKS / GKE / AKS examples)
- argocd cluster add
- kind Configuration
Video storyboard script (about 90 seconds)
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.
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.
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.
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.
Module 6 · Hub-and-spoke and one Argo CD per cluster
- 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.”
What: three topologies
| Topology | Description | Mapping 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 server | lab (hub) → lab2 (spoke) |
| One Argo CD per cluster (standalone) | Each cluster runs its own Argo CD, managing only in-cluster, each pulling from Git | Also install an Argo CD on lab2 |
| Hybrid | Multiple 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
| Dimension | Hub-and-spoke | One 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 direction | The Hub must reach each spoke's API (inbound to the spoke) | Each cluster only needs outbound access to Git / image registry |
| Credentials | Centrally stores high-privilege credentials for all clusters | No cross-cluster credentials |
| Scale | Controller memory grows with the total resources across all clusters, so sharding is needed (each shard handles a subset of clusters) | Naturally distributed |
| Tenant isolation | Relies on projects + RBAC (M1–M4 in this course) | Can be “one instance per team,” with physical isolation |
| Operational cost | One upgrade; but one upgrade affects everything | N upgrades, N monitoring stacks; can upgrade in batches |
How: scaling the Hub
- Controller sharding: increase
argocd-application-controllerreplicas and setARGOCD_CONTROLLER_REPLICAS, clusters are assigned to shards by an algorithm; the algorithmlegacy(by UID, uneven, default),round-robin,consistent-hashing(the last two are officially experimental); you can also useshardto 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 getYou 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
| Situation | Leaning toward |
|---|---|
| < 20 clusters, same network domain, one platform team | Hub-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 NAT | One per cluster, or argocd-agent (pull mode) |
| Hundreds of clusters | Multiple 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) |
Comparison: push vs pull model
Failure diagram: blast radius of a Hub outage
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).
Core commands
| Command | Purpose | Notes |
|---|---|---|
argocd cluster get lab2 -o wide | View cluster cache and connection info | Includes serverVersion, connectionState, cacheInfo (APIs / resource count / last sync) |
argocd admin cluster stats | Per-cluster resource counts and inferred shard numbers | Reads the cluster Argo CD runs on directly (requires a kubectl context) |
argocd admin cluster shards | View shard assignments | Details in Lesson 7 |
kubectl -n argocd scale sts argocd-application-controller --replicas=0 | Simulate a Hub controller failure | Lab only |
helm upgrade … --set controller.replicas=2 | Enable 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)
argocd cluster get and argocd admin cluster stats, then record the resource counts of both clusters.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.
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
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).
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
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
Official docs
Video storyboard script (about 90 seconds)
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.
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.
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.
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.
Module 7 · Applications in any namespace
- Explain why “anyone who can write
argocdApplication objects in a namespace = Argo CD admin”, and how this feature addresses it. - Configure the two gates: global
application.namespaces(argocd-server and controller) + projectsourceNamespaces; understand how they work with Kubernetes RBAC. - Master the CLI names
namespace/application, RESTappNamespaceparameters and RBAC objectsproject/namespace/applicationsyntax and pitfalls.
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
- Global gate:
argocd-serverandargocd-application-controller’s--application-namespacesparameter (recommended: set viaargocd-cmd-params-cm’sapplication.namespacesunified setting, restart both after changes). Shell wildcards are supported (team-*) and/regex/; namespaces not in the list cannot be used by any project. - Project gate: AppProject’s
.spec.sourceNamespaceslists 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. - 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, whenconfigs.params."application.namespaces"is set, automatically adds create/delete/update/patch on applications to argocd-server’s ClusterRole (verified against the chart templates). - 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
| Context | Syntax | Notes |
|---|---|---|
| CLI / UI | team-a-apps/podinfo | Apps in the control-plane namespace can omit the prefix (argocd/x and x are equivalent) |
| REST API | GET /api/v1/applications/podinfo?appNamespace=team-a-apps | in the request body for POST/PUT |
| RBAC objects | team-a/team-a-apps/podinfo | project/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).
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
Responsibilities
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.
Core commands and config
| Command / config | Purpose | Notes |
|---|---|---|
argocd-cmd-params-cm: application.namespaces | Globally allowed namespaces | comma-separated; supports wildcards and /regex/; restart server and controller after changing |
AppProject.spec.sourceNamespaces | Namespaces accepted by the project | supports wildcards |
argocd app get NS/NAME | View apps in other namespaces | can also use -N NS (--app-namespace) |
argocd app create NS/NAME … | Create an app in a specified namespace | In the UI, enter the name as NS/NAME |
argocd app list -N NS | Filter by namespace | — |
kubectl -n argocd rollout restart deploy/argocd-server sts/argocd-application-controller | make the parameter take effect | A 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)
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
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
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
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.
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
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).
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
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:
Official docs
Video storyboard script (about 90 seconds)
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.
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.
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.
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.
Module 8 · Multi-tenant architecture review
- 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”.
What: the six areas of the review
| Area | Key questions | Modules in this lesson |
|---|---|---|
| Identity | Who can log in? Is admin disabled? Where do groups come from and how often are they refreshed? What credentials does CI use? | M3, M4 |
| RBAC | policy.default What role? Are there any */* non-admin roles? Are logs / exec minimized? Is the policy covered by automated tests? | M3 |
| Projects | Is 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 credentials | Is 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 chain | Can 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 operations | Hub blast radius? Are prod / non-prod isolated? Sharding and capacity? Backup and DR (argocd admin export)? | M6 |
Why: typical privilege-escalation paths
| # | Path | Controls |
|---|---|---|
| 1 | Create an app in the default project that deploys a ClusterRoleBinding | Lock down default; give the cluster-level resource allowlist only to platform |
| 2 | Has argocd namespace with K8s write permission → change an Application's project / edit argocd-rbac-cm / read cluster Secrets | Give the argocd namespace only to platform admins; teams use apps-in-any-namespace |
| 3 | A team repo deploys a RoleBinding that binds admin to an external principal | Namespace deny list includes RBAC resources, or admission policy restricts it |
| 4 | A projects, update team member loosens their own project's destinations | Project YAML lives in the platform repo; team roles only get projects, get |
| 5 | exec permission + privileged Pod → enter the container and read the mounted token | Disable exec by default; grant only to on-call roles, scoped to projects |
| 6 | ApplicationSet templated project field / SCM generator reading untrusted repos | Restrict applicationsets with RBAC; restrict SCM providers |
| 7 | Non-expiring JWT / leaked local-account apiKey | Set token expiry, rotate, and apply least privilege per project |
| 8 | policy.default: role:readonly Leaks configuration of all apps and the cluster list | Leave default empty or give minimal role |
| 9 | An SSO group with the same name as a local user gets the local user's role | Local users use direct p lines; disable local users where possible |
| 10 | override permission syncs any local manifest / any revision | Don't grant override; enable requireOverridePrivilegeForRevisionSync |
How: review process
- Draw the data flow: Git → repo-server → controller → clusters; identity flow: IdP → Dex/OIDC → server → RBAC.
- For each role, list “what it can do”, then use
argocd admin settings rbac canto verify key negative cases (team-a cannot touch team-b, cannot delete apps, cannot exec). - For each project, list sources, destinations, and resources, and try the M2 “three boundary-crossing attempts”.
- Check
argocdnamespace's K8s RoleBinding:kubectl -n argocd get rolebinding -o wideand any ClusterRole that can read or write Secrets. - 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.
Trust boundary diagram
Review decision flow
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
| Command | What it checks |
|---|---|
argocd proj list / argocd proj get P -o yaml | Whether default is locked; cluster-level allowlist; sourceNamespaces |
kubectl -n argocd get cm argocd-rbac-cm -o yaml | policy.default, wildcard grants, logs/exec |
argocd admin settings rbac can … --namespace argocd | Key negative assertions |
kubectl -n argocd get rolebinding,clusterrolebinding -o wide | grep -i argocd | Who can write to the argocd namespace |
kubectl auth can-i --list -n argocd --as USER | A 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 argocd | Cluster credentials and permissions |
argocd admin export -n argocd > backup.yaml | DR 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
policy.default: role:readonly: all logged-in users can see all apps and clusters, and deny cannot revoke it → leave empty or minimal role.role:devFor*/*role, which has all application actions (including delete, override, action) → authorize per team project; grant only get/sync/necessary actions.exec, create, */*+exec.enabled→ disable it or grant only to on-call roles, scoped to projects.projects, update, *: developers can change project boundaries → grant only get.g, ci, role:adminandciis an apiKey account → use project-role JWTs (with expiry), authorized per project.- team-a
clusterResourceWhitelist: */*→ leave empty. sourceNamespaces: ['*']: any enabled namespace can use team-a; and if the global list includes platform namespaces besides argocd, the risk is higher → list onlyteam-a-apps.sourceRepos: https://github.com/my-org/*allows any repo in the organization (including other teams' and personal experiment repos) → list them precisely.destinations server: '*': can deploy to any registered cluster (including future prod) → list by cluster name.- The default project is not locked down.
- 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.
admin.enabled: "true": once SSO is in place, disable it and keep a break-glass procedure.
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.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.
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
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
Official docs
Video storyboard script (about 90 seconds)
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.
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.
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.
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.
Command cheat sheet
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 appprojSync 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.yamlv3 changes at a glance
| Change | Key takeaway |
|---|---|
| logs permission | Required since 3.0 logs, get |
| update / delete | Since 3.0, applies only to the Application itself; for sub-resources, use update/*,delete/* |
| Dex principal | Since 3.0, uses federated_claims.user_id |
| Resource tracking | Default annotation since 3.0 |
| Cluster version format | Since 3.4 vMajor.Minor.Patch |
| impersonation | Since 3.5, also applies to API server operations (logs, events, resource deletion, etc.) |
| Project signing keys | Since 3.5 signatureKeys Deprecated; use sourceIntegrity |
Capstone lab + final quiz
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).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.
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, allowargocd 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
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.
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.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-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.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.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
| Topic | Verification result | Source (accessed 2026-11-17) |
|---|---|---|
| Argo CD version | Latest v3.6.1 (2026-11-04), v3.6.0 (2026-11-03); concurrent patches v3.5.7, v3.4.13, v3.3.19 | argo-cd releases |
| Helm chart | argo/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 applications | argo-helm/charts/argo-cd(Chart.yaml, values.yaml, templates/argocd-server/clusterrole.yaml) |
| AppProject | field 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 JWT | Projects · project.yaml |
| orphaned resources / sync windows | exception resources, ignore, performance tips; allow/deny evaluation with deny precedence, manualSync, syncOverrun, timeZone, andOperator; CLI argocd proj windows add parameters | Orphaned Resources · Sync Windows |
| RBAC | resource/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 Changes | 3.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 sourceIntegrity | 2.14→3.0 · 3.3→3.4 · 3.4→3.5 |
| SSO | the 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 enableUserGroupOverageClaim | User Management · Microsoft |
| Dex GitHub connector | group claims (org):(team); teams filtering; teamNameField (name / slug / both); loadAllGroups | Dex GitHub connector |
| cluster registration | cluster 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 namespace | since 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 topology | sharding algorithms legacy / round-robin / consistent-hashing (the last two are experimental); argocd-agent v0.11.0 (2026-11-11), argoproj-labs, managed / autonomous modes | High Availability · argocd-agent |
| Original error messages | application 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 / podinfo | kind 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, carryinggitops-lab/managedthe label on the in-cluster Secret,~/appset-lab/podinfo-matrix.yaml); Module 1'ssedassumes that theproject: defaultformat matches Lesson 3; if you edited these files, make the changes by hand. Put team application overlays inapps/team-a/rather thanapps/podinfo/overlays/, so they are not treated as new environments by the ApplicationSetpodinfo's Git directory generator. - Cross-cluster access in kind depends on the Docker network
kindand 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 setserverName; whether the kubeadm certificate SAN includes the IP must be verified in your environment.kube-public/cluster-infoThe 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 yamlactual 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.