MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

ArgoCD Assignment & Excercise

This page is a hands-on Argo CD and Argo Rollouts assignment. It lists exercises on application creation, syncing, secrets, Helm, blue/green and canary rollouts, followed by interview-style questions with answers. Below the original list you will find a working lab setup, runnable solutions for the core exercises, and fixes for several answers that are wrong or out of date.



How to use this assignment

The exercise tables above link to files such as exercises/app_creation/exercise.md. Those are relative links copied from a GitHub repository, so they do not open from this page. The sections below give you working tasks and solutions for the same topics: creating an app, syncing from Git, fixing drift in the cluster, Helm apps, secrets and rollouts.

Do the exercises in order and check each result with kubectl and the argocd CLI. Then answer the questions without looking at the answers, and compare your answers with the corrections further down.

  • A local Kubernetes cluster (kind, minikube or k3d) and kubectl configured for it
  • The argocd CLI and, for the rollout exercises, the kubectl argo rollouts plugin
  • A Git repository you can push to (a fork of a sample app repo works well)
  • Basic knowledge of Deployments, Services and namespaces

Lab setup: install Argo CD and log in

kubectl create namespace argocd
kubectl apply -n argocd --server-side --force-conflicts \
  -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml

# Wait until all components are ready
kubectl -n argocd rollout status deployment/argocd-server

# Get the initial admin password
argocd admin initial-password -n argocd

# Expose the API server locally (keep this running in a separate terminal)
kubectl port-forward svc/argocd-server -n argocd 8080:443

# Log in with the CLI
argocd login localhost:8080 --username admin --insecure

Server-side apply avoids the annotation size limit that some large Argo CD CRDs hit with client-side kubectl apply. The --insecure flag skips TLS verification for the self-signed certificate. Use it only in a local lab. After the first login, change the admin password with argocd account update-password and delete the argocd-initial-admin-secret Secret.

Exercise solutions: create and sync an application

Creating an app. Applications should be declared in YAML and stored in Git. This example deploys the public guestbook sample into the same cluster that Argo CD runs in:

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: guestbook
  namespace: argocd          # Application objects live in Argo CD's namespace
spec:
  project: default
  source:
    repoURL: https://github.com/argoproj/argocd-example-apps.git
    targetRevision: HEAD
    path: guestbook
  destination:
    server: https://kubernetes.default.svc   # the in-cluster API server
    namespace: guestbook
  syncPolicy:
    syncOptions:
      - CreateNamespace=true
kubectl apply -f guestbook-app.yaml
argocd app get guestbook      # Sync Status: OutOfSync, Health: Missing
argocd app sync guestbook
argocd app wait guestbook --health
kubectl get all -n guestbookCode language: JavaScript (javascript)

Without a sync policy, the app shows OutOfSync until you run a sync. After the sync it should show Synced and Healthy. CreateNamespace=true creates the destination namespace. Without it, the sync fails if the namespace does not exist (see the "yay" namespace question above).

Syncing from Git and from the cluster. Turn on automated sync with pruning and self-heal, then test both directions:

argocd app set guestbook --sync-policy automated --auto-prune --self-heal

# Drift from the cluster side: change a live object by hand
kubectl -n guestbook scale deployment guestbook-ui --replicas=5
kubectl -n guestbook get deployment guestbook-ui -w   # Argo CD reverts it to the Git value

# Drift from the Git side: edit replicas in your fork, commit and push,
# then force an immediate check instead of waiting for the next poll
argocd app get guestbook --refreshCode language: PHP (php)

Note: Self-heal and pruning only work when automated sync is on. With automated sync but no --self-heal, a manual kubectl scale makes the app show OutOfSync, and Argo CD does not revert the change.

Exercise solutions: Helm apps and secrets

Argo CD renders Helm charts with helm template and applies the output like any other manifests. Values can be overridden in the Application:

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: helm-guestbook
  namespace: argocd
spec:
  project: default
  source:
    repoURL: https://github.com/argoproj/argocd-example-apps.git
    targetRevision: HEAD
    path: helm-guestbook
    helm:
      parameters:
        - name: replicaCount
          value: "2"
  destination:
    server: https://kubernetes.default.svc
    namespace: helm-guestbook
  syncPolicy:
    automated: {}
    syncOptions:
      - CreateNamespace=trueCode language: JavaScript (javascript)

After the sync, helm ls -n helm-guestbook returns nothing, because Argo CD never creates a Helm release. To deploy a chart from a Helm repository, set repoURL to the repository, replace path with chart: <name>, and set targetRevision to the chart version.

Secrets 101. Never commit plain Kubernetes Secrets to a GitOps repository. Base64 is an encoding, not encryption. The usual patterns are Sealed Secrets (an encrypted SealedSecret that the cluster controller decrypts), External Secrets Operator (an ExternalSecret that pulls values from Vault or a cloud secret manager), and SOPS-encrypted files decrypted by a plugin. With each of these, only the encrypted or reference object lives in Git, and Argo CD syncs it like any other resource.

Exercise solutions: Argo Rollouts canary

kubectl create namespace argo-rollouts
kubectl apply -n argo-rollouts \
  -f https://github.com/argoproj/argo-rollouts/releases/latest/download/install.yamlCode language: JavaScript (javascript)
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
  name: rollouts-demo
spec:
  replicas: 5
  selector:
    matchLabels:
      app: rollouts-demo
  template:
    metadata:
      labels:
        app: rollouts-demo
    spec:
      containers:
        - name: rollouts-demo
          image: argoproj/rollouts-demo:blue
          ports:
            - containerPort: 8080
  strategy:
    canary:
      steps:
        - setWeight: 20
        - pause: {}               # wait for manual promotion
        - setWeight: 60
        - pause: {duration: 30s}Code language: PHP (php)
kubectl apply -f rollout.yaml
kubectl argo rollouts set image rollouts-demo rollouts-demo=argoproj/rollouts-demo:yellow
kubectl argo rollouts get rollout rollouts-demo --watch   # pauses at 20%
kubectl argo rollouts promote rollouts-demo              # continue to 60%, then 100%
kubectl argo rollouts abort rollouts-demo                # or abort and return to the stable versionCode language: PHP (php)

Without a traffic router such as an ingress controller or service mesh, the weight is approximated by the number of replicas. With 5 replicas, 20% means one canary pod. For the blue/green exercise, replace canary with blueGreen, and set activeService and previewService to two Services that you create. When the Rollout is managed by Argo CD, change the image in Git instead of using set image. Otherwise the app shows OutOfSync.

Corrections to the questions and answers above

QuestionOriginal answerCorrect answer
Sorina made manual changesArgo CD always overwrites themOnly with automated sync and selfHeal: true. Otherwise the app is just marked OutOfSync.
Nate: can Argo CD skip syncing manual changes?"configure ArgoCD to sync to desired state"Yes. Leave self-heal off (it is off by default) and alert on OutOfSync through notifications.
CRD for grouping appsAddProjectAppProject. It also restricts source repos, destinations and resource kinds.
What happens every sync periodOnly auto-sync apps are comparedAll apps are refreshed and compared with Git. Auto-sync only decides whether Argo CD applies the difference.
Sync period3 minutesThe default Git polling (reconciliation) interval is 180 seconds, and newer versions add jitter. Webhooks can trigger refreshes right away.
timeout.reconciliation: 0sSync is disabledPeriodic Git polling is disabled. Manual syncs, hard refreshes and webhooks still work.
Destination sectionserver: http://..., namespace: devopsExercisesThe API server URL uses https, and namespace names must be lowercase (RFC 1123).
argocd app create--project with no value, --dest-server my.kubernetes.cluster--project default and a full API URL, for example https://kubernetes.default.svc, or use --dest-name.
argocd cluster addTakes an addressTakes a kubeconfig context name, for example argocd cluster add my-context.
Access managementNo ClusterRole neededArgo CD still needs Kubernetes RBAC for its controller, and has its own RBAC in argocd-rbac-cm. Git controls who can change the desired state.
Helm supportMonitors packaged charts for new versionsArgo CD renders charts with helm template. It picks up new versions only if targetRevision is a semver range.
Helm ArgoCD App table rowTopic: SecretsTopic: Helm.

Changing the polling interval in argocd-cm takes effect only after you restart the components that read it:

kubectl -n argocd patch configmap argocd-cm --type merge \
  -p '{"data":{"timeout.reconciliation":"300s"}}'
kubectl -n argocd rollout restart statefulset argocd-application-controller
kubectl -n argocd rollout restart deployment argocd-repo-serverCode language: JavaScript (javascript)

The disaster recovery answer above is cut off. The full point: if every application is stored in Git, you can create a new cluster, install Argo CD, register the cluster, and apply the root Application (app of apps). The workloads then come back in the state recorded in Git. Data in persistent volumes still needs its own backup.

Corrected AnalysisTemplate

The AnalysisTemplate example above has two errors: the Prometheus address has a single slash (http:/), and the query is missing a closing parenthesis. The corrected version:

apiVersion: argoproj.io/v1alpha1
kind: AnalysisTemplate
metadata:
  name: success-rate
spec:
  args:
    - name: service-name
  metrics:
    - name: success-rate
      interval: 4m
      count: 3
      successCondition: result[0] >= 0.90
      failureLimit: 1
      provider:
        prometheus:
          address: http://some-prometheus-instance:80
          query: |
            sum(response_status{app="{{args.service-name}}",role="canary",status=~"2.*"})
            /
            sum(response_status{app="{{args.service-name}}",role="canary"})Code language: JavaScript (javascript)

The template takes three measurements, four minutes apart. Each one passes when the canary's 2xx ratio is 0.90 or higher (not only "more than 0.90"). When the number of failed measurements goes over failureLimit, the analysis fails and Argo Rollouts aborts the rollout, sending traffic back to the stable ReplicaSet. If you omit failureLimit, it defaults to 0, so a single failed measurement aborts the rollout.

Frequently asked questions

What is the default sync interval in Argo CD?

By default, Argo CD polls Git about every 180 seconds, and newer versions add a small jitter. You can change this with timeout.reconciliation in argocd-cm, or configure Git webhooks so changes are picked up almost immediately.

Does Argo CD revert manual kubectl changes?

Only when the application has automated sync with self-heal enabled. Otherwise Argo CD marks the application OutOfSync and leaves the live change in place until someone syncs.

Why does helm ls not show applications deployed by Argo CD?

Argo CD renders charts with helm template and applies the resulting manifests itself, so no Helm release record is created. You manage these apps with the argocd CLI or UI instead of helm.

Do I need Argo CD to use Argo Rollouts?

No. Argo Rollouts is a separate controller and works with plain kubectl or any deployment tool. Argo CD adds Git-driven delivery and shows rollout health, but it is optional.

How do I store secrets safely in an Argo CD GitOps repository?

Do not commit plain Secret manifests. Use Sealed Secrets, External Secrets Operator, or SOPS-encrypted files, so that Git holds only encrypted data or references to an external secret store.

Related tutorials

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services โ€” all in one place.

Explore Hospitals
I'm Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms. I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.

Related Posts

ArgoCd Commands Reference

This page collects the Argo CD commands engineers use most: getting the initial admin password, finding the Argo CD URL, changing or resetting the admin password with…

Read More

GitOps vs. DevOps: What Are The Differences?

Versus often compares two sides to see which one is better but in the case of GitOps and DevOps, the two are considered more of complimentary methodologies…

Read More

Top 10 GitOps Tools: Features, Pros, Cons & Comparison

Introduction GitOps tools enable teams to manage infrastructure and application deployments using Git as the single source of truth. In a GitOps model, desired system statesโ€”such as…

Read More

Feature-by-Feature Comparison: Argo CD vs Flux

Here is a very comprehensive, feature-by-feature comparison between Argo CD and Flux, including: ๐Ÿ“Š Feature-by-Feature Comparison: Argo CD vs Flux Feature Argo CD Flux GitOps Core Functionality…

Read More

GitOps Tutorial

Introduction to GitOps GitOps is a modern approach to managing infrastructure and application deployments using Git as the single source of truth. It leverages Git repositories to…

Read More

What is GitOps and use cases of GitOps?

What is GitOps ? GitOps is a modern approach to managing infrastructure and applications by treating their desired state as code stored in Git repositories. It leverages…

Read More
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
0
Would love your thoughts, please comment.x
()
x