
Once infrastructure is created, someone has to configure servers and ship apps to Kubernetes again and again without mistakes. This sixth set covers the tools that do that work: Ansible for configuration management, Helm and Kustomize for packaging Kubernetes apps, and GitOps with Argo CD for keeping clusters in sync with Git. These topics come up often in DevOps and SRE interviews.
How to practise: read each question and tap the option you think is correct. You will see right away whether you got it, along with a short explanation, and your score is tracked at the bottom of the screen. This set has 15 questions.
Topics covered in this set
- Agentless Ansible, inventory and playbooks
- Idempotency, modules vs shell and handlers
- Roles, variable precedence and Ansible Vault
- Helm charts, values, upgrades and rollbacks
- Kustomize bases and overlays
- GitOps principles, Argo CD sync and drift
DevOps MCQs with answers and explanations
Q1. How does Ansible usually connect to the Linux servers it manages?
a) Through an agent that must be installed on every server
b) Over SSH, without needing an agent on the managed servers
c) Through a VPN created by Ansible
d) Over FTP
Q2. What is an Ansible inventory?
a) A list of the hosts Ansible manages, grouped (for example web and db), with optional variables per host or group
b) The list of installed Ansible modules
c) A log of every past playbook run
d) A file that stores encrypted passwords only
Q3. A playbook installs nginx and copies a config file. You run it a second time with nothing changed. What should a well-written playbook report?
a) Every task as changed
b) An error, because nginx is already installed
c) All tasks as ok with no changes, because the servers are already in the desired state
d) It should ask for confirmation
Q4. Why is it better to use a module such as apt or copy instead of running the same thing with the shell or command module?
a) Shell commands are not allowed in playbooks
b) Modules run on the control node only
c) Shell is slower to type
d) Modules are idempotent and report changed or ok correctly, while a shell command runs every time and Ansible cannot tell if anything changed
Q5. A task updates nginx.conf and notifies a handler called restart nginx. Three tasks in the play notify it. When does the handler run?
a) Once, at the end of the play, and only if at least one notifying task reported changed
b) Three times, right after each task
c) Before any task runs
d) Only when you run the playbook with --handlers
Q6. What is an Ansible role?
a) A user account on the managed server
b) A standard folder structure (tasks, handlers, templates, defaults, vars, files) that packages related automation so it can be reused
c) A cloud IAM permission
d) A type of inventory group
Q7. Which variable source has the highest precedence in Ansible, overriding everything else?
a) Role defaults
b) Group variables in the inventory
c) Extra variables passed on the command line with -e
d) Facts gathered from the host
Q8. What is Ansible Vault used for?
a) Encrypting secrets such as passwords and API keys in variable files, so they can be kept safely in Git
b) Backing up the managed servers
c) Storing playbook run history
d) Speeding up SSH connections
Q9. What is a Helm chart?
a) A graph of cluster CPU usage
b) A Docker image format
c) A list of Kubernetes nodes
d) A package of templated Kubernetes manifests plus a values.yaml file with default settings, which can be installed as a release
Q10. What does helm upgrade --install myapp ./chart do?
a) Always deletes and recreates the release
b) Installs the release if it does not exist yet, and upgrades it if it does, which makes it safe to use in CI pipelines
c) Only installs Helm itself
d) Upgrades the Kubernetes version
Q11. A Helm upgrade to revision 5 broke the app. Revision 3 was the last good one. Which command restores it?
a) helm delete myapp 3
b) kubectl undo myapp
c) helm rollback myapp 3
d) helm install myapp --revision 3
Q12. Which tool customises plain Kubernetes YAML using a base and environment overlays with patches, without any templating language?
a) Kustomize
b) Helm
c) Terraform
d) Jenkins
Q13. Which statement best describes GitOps?
a) Developers SSH into servers and run git pull
b) Git stores the desired state of the system in declarative files, and an agent in the cluster keeps pulling from Git and reconciling the live state to match it
c) Every commit is deployed straight to production with no review
d) Git is used only for application code, never for infrastructure
Q14. Someone changes the replica count of a Deployment directly with kubectl. Argo CD shows the app as OutOfSync. With self-heal turned on, what will Argo CD do?
a) Commit the kubectl change back to Git
b) Delete the whole application
c) Ignore the change forever
d) Revert the live object to what is declared in Git
Q15. What is a security advantage of pull-based GitOps compared with a CI pipeline that runs kubectl apply against production?
a) Pull-based deploys need no Kubernetes RBAC at all
b) Pull-based deploys encrypt every Pod
c) The CI system does not need to hold production cluster credentials, because the agent running inside the cluster pulls the changes
d) It removes the need for code review
Quick revision notes
- Ansible is agentless (SSH); inventory lists hosts and groups; playbooks are YAML lists of plays and tasks.
- Prefer modules over shell/command for idempotency; handlers run once at the end of the play and only if notified by a change.
- Roles package reusable automation; -e extra vars beat everything; role defaults are the lowest precedence; Vault encrypts secrets.
- Helm: chart + values = release; helm upgrade --install for CI; helm rollback to a revision. Kustomize patches YAML with overlays.
- GitOps: Git is the source of truth, an in-cluster agent pulls and reconciles; Argo CD self-heal reverts manual drift.
Frequently asked questions
Should I learn Ansible or Terraform first?
They solve different problems. Terraform creates infrastructure such as networks, VMs and managed databases. Ansible configures what runs on servers. Many teams use Terraform to create machines and Ansible to set them up, so learning both is useful.
Is Helm or Kustomize better?
Helm is better when you want to package and share an app with many settings, or install third-party software. Kustomize is simpler when you own the YAML and only need small differences between environments. Argo CD supports both.
What is the difference between Argo CD and Flux?
Both are CNCF GitOps tools that reconcile clusters from Git. Argo CD has a rich web UI and an application-centric model. Flux is a set of controllers that is lighter and fits well with automation-first setups.
Comments
Post a Comment