Skip to content
Tutorials Center
My learning

Topics

Lesson 37 of 37 ยท Projects and Practice

Practice: Argo CD and GitOps Scenarios

Test what you learned with realistic Argo CD scenarios on config tools, ApplicationSets, RBAC, secrets and operations, plus a runnable Application linter.

This lesson is a workbook. Each scenario describes a realistic situation; try to answer before opening the hint. Then use the linter stand-in at the end to check Application manifests the way a CI job might.

How to use this page

  1. Read the scenario and write down your answer (a field, a command or a design choice).
  2. Compare with the answer notes.
  3. If you were unsure, follow the lesson link and re-read that part.

Scenario 1: Chart from a vendor, values from your repo

A vendor publishes the chart ingress-nginx at version 4.11.3. Your values file lives in your GitOps repository at clusters/prod/ingress/values.yaml. How do you deploy this with one Application?

Answer notes: use spec.sources with the chart as the first source (helm.valueFiles: [$values/clusters/prod/ingress/values.yaml]) and your repo as the second source with ref: values. Pin the chart version. See Multiple Sources and Value Files.

Scenario 2: Which value wins?

values.yaml sets replicaCount: 2, values-prod.yaml (listed in valueFiles) sets 4, the inline valuesObject sets 6, and a parameters entry sets 8. What does the rendered Deployment get?

Answer notes: 8. Parameters override inline values, which override value files, which override chart defaults. See Helm Charts in Argo CD.

Scenario 3: The subfolder that never deploys

An Application with path: manifests uses plain YAML. Files in manifests/backend/ are not deployed. Why, and what do you change?

Answer notes: directory sources are not recursive by default. Set directory.recurse: true (and use include/exclude if needed). See Directory, Jsonnet and Plugins.

Scenario 4: Add-ons on every prod cluster

You want ingress, monitoring and cert-manager on every cluster labelled env=prod, including clusters registered next year. Which generators do you combine?

Answer notes: a matrix of the clusters generator (selector env: prod) and a git directory generator over addons/*. New clusters with the label get all add-ons automatically. See ApplicationSet Matrix, Merge, Templates and Progressive Sync.

Scenario 5: The git outage that nearly deleted production

Your Git provider has a brief outage and your ApplicationSet's Git generator returns no results. What prevents the controller from deleting every generated Application, and which settings do you set?

Answer notes: the generator error normally stops reconciliation, but a successful empty result would remove everything. Use syncPolicy.applicationsSync: create-update (never delete automatically), preserveResourcesOnDeletion: true and the finalizer discipline from The App of Apps Pattern. Protect production fleets deliberately.

Scenario 6: Group mapping does nothing

Users from the my-org SSO group can log in but see no applications. policy.default is empty. What do you check first?

Answer notes: whether the token actually carries the group claim (scopes setting, IdP claim configuration), whether the group string matches exactly, and whether a g, <group>, role:... line exists. See RBAC Policies and SSO and Authentication.

Scenario 7: A password in Git history

A developer committed a Kubernetes Secret with a database password last week. The commit was reverted the same day. Is the problem solved?

Answer notes: no. The value is in history and was readable by everyone with access. Rotate the password, then move to Sealed Secrets or External Secrets Operator, and add a CI scan. See Secrets in GitOps.

Scenario 8: Always OutOfSync after HPA

An HPA scales your Deployment between 3 and 10 replicas. The app shows OutOfSync because Git says 3. Which two changes fix it?

Answer notes: add ignoreDifferences for /spec/replicas and the RespectIgnoreDifferences=true sync option (or remove replicas from the manifest). See Troubleshooting Sync Problems.

Scenario 9: Merges take three minutes to show up

Developers complain that after merging they wait minutes for deployments. What do you configure and what stays as a fallback?

Answer notes: a Git webhook to /api/webhook with a shared secret; keep the polling interval as a fallback. See Notifications and Git Webhooks.

Scenario 10: The monorepo that refreshes everything

A monorepo with 400 Applications: every commit makes every Application re-render, and the repo server is overloaded. What do you add?

Answer notes: the argocd.argoproj.io/manifest-generate-paths annotation per Application, working webhooks, more repo-server replicas and a sensible parallelism limit. See High Availability and Performance.

Scenario 11: Lost management cluster

Your Argo CD cluster disappears. Workload clusters are fine. List the recovery steps in order.

Answer notes: new cluster, install the pinned Argo CD, restore credentials and key material from the secret manager, apply the root Application, let Applications reconcile. See Upgrades, Backup and Disaster Recovery.

Scenario 12: Canary aborted, Argo CD says Synced

An Argo Rollouts analysis aborted the canary. Argo CD shows Synced and Degraded. Why, and what is the GitOps fix?

Answer notes: the live Rollout spec equals Git, but the release failed. Revert or fix forward in Git. See Progressive Delivery with Argo Rollouts.

Stand-in: an Application linter

CI can catch common mistakes before they reach the cluster. This linter checks a few of the rules from this chapter on Application manifests represented as dictionaries.

Python Stand-in: lint Application manifests

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Extend the linter with your own team's rules: required labels, forbidden namespaces, a finalizer on root apps.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which field combination deploys a vendor chart with your own values from Git?

    Multiple sources, one with ref, let value files come from another repository.
  2. 2. Which two settings together stop an ApplicationSet from deleting Applications automatically?

    create-update never deletes Applications, and preserveResourcesOnDeletion keeps workloads if one is removed.
  3. 3. Where is the fix for an aborted canary that Argo CD reports as Synced and Degraded?

    The desired state in Git is the problem, so change it there.
  4. 4. What is the first step when RBAC group mappings seem not to work?

    Missing or mismatched group claims are the most common cause.

Summary

  • Practice maps to the chapter: config tools, ApplicationSets, security, operations.
  • Most real problems are ordering, ownership of fields, or Git being the wrong place for something (secrets, drift).
  • Automate checks in CI, such as linting Application manifests, so mistakes are caught before sync.
  • You now have a complete picture of running Argo CD for a team or a platform.

Next: Back to the Argo CD and GitOps track