ArgoCD Sync Strategies Quiz
This quiz tests your understanding of ArgoCD synchronization strategies and options.
- What is the difference between a "Sync" and a "Refresh" in ArgoCD?
- A) They are the same operation
- B) Refresh compares the current state to Git; Sync applies changes to make them match
- C) Sync is manual, Refresh is automatic
- D) Refresh deletes resources, Sync creates them
Show Answer
Answer: B) Refresh compares the current state to Git; Sync applies changes to make them match
Explanation: A Refresh operation fetches the latest manifests from Git and compares them to the live state, updating the Application status. A Sync operation actually applies changes to the cluster to bring the live state in line with the desired state in Git.
- What does enabling
automatedsync policy do?- A) Automatically deletes the application
- B) Enables automatic synchronization when the desired state differs from live state
- C) Enables automatic rollback
- D) Automatically creates backups
Show Answer
Answer: B) Enables automatic synchronization when the desired state differs from live state
Explanation: When syncPolicy.automated is enabled, ArgoCD will automatically sync the application whenever it detects that the live state has drifted from the desired state defined in Git.
- What is the purpose of the
pruneoption in automated sync?- A) To clean up old Git branches
- B) To automatically delete resources that are no longer defined in Git
- C) To remove failed deployments
- D) To delete the application itself
Show Answer
Answer: B) To automatically delete resources that are no longer defined in Git
Explanation: When prune: true is set in automated sync, ArgoCD will automatically delete Kubernetes resources that exist in the cluster but are no longer defined in the Git repository.
- What does
selfHeal: truedo in a sync policy?- A) Automatically fixes YAML syntax errors
- B) Automatically syncs when live state deviates from desired state due to manual changes
- C) Restarts unhealthy pods
- D) Repairs corrupted Git repositories
Show Answer
Answer: B) Automatically syncs when live state deviates from desired state due to manual changes
Explanation: Self-heal ensures that if someone makes a manual change to a resource in the cluster (outside of Git), ArgoCD will automatically revert it to match the desired state in Git.
- Which sync option would you use to replace resources instead of applying patches?
- A) Force=true
- B) Replace=true
- C) Recreate=true
- D) Update=true
Show Answer
Answer: B) Replace=true
Explanation: The Replace=true sync option tells ArgoCD to use kubectl replace instead of kubectl apply, which completely replaces the resource rather than patching it. This is useful when dealing with immutable fields.