Home »
Trending Technologies MCQs
GitOps MCQs (Multiple-Choice Questions)
GitOps is a modern approach to managing infrastructure and application deployments using Git repositories as the source of truth. It applies version control, automation, and continuous reconciliation to maintain the desired state of systems.
GitOps MCQs
GitOps uses declarative configuration files stored in Git repositories to describe how applications and infrastructure should operate. Automated controllers monitor these repositories and reconcile the actual system state with the desired state defined in the configuration.
GitOps is widely used in Kubernetes environments and modern DevOps workflows. Tools such as Argo CD and Flux help automate application deployments, configuration management, synchronization, and continuous delivery while providing version history and traceability.
List of GitOps MCQs
The following GitOps MCQs cover fundamental concepts, operating principles, Git repositories, declarative configuration, continuous reconciliation, Kubernetes, deployment automation, security, monitoring, and popular GitOps tools. Each question includes four options, the correct answer, and an explanation.
1. What is GitOps?
- A programming language used for developing websites
- A practice of managing infrastructure and application deployments through Git-based workflows
- A database management system
- A tool used only for writing application documentation
Answer: B) A practice of managing infrastructure and application deployments through Git-based workflows
Explanation:
GitOps uses Git repositories as the source of truth for declarative infrastructure and application configurations. Automated systems apply and maintain the desired state in the target environment.
2. What is the primary objective of GitOps?
- To eliminate version control systems
- To replace all application programming languages
- To automate deployments and maintain the desired system state using Git
- To increase manual infrastructure configuration
Answer: C) To automate deployments and maintain the desired system state using Git
Explanation:
GitOps automates application and infrastructure management by connecting Git-based configuration changes with deployment and reconciliation processes. It improves consistency, traceability, and operational control.
3. Which system acts as the source of truth in GitOps?
- Git repository
- Application log file
- Local desktop folder
- Manual deployment checklist
Answer: A) Git repository
Explanation:
In GitOps, the Git repository stores the desired configuration of applications and infrastructure. Automated controllers use this configuration to determine how the target environment should be configured.
4. What does GitOps stand for?
- Global Integration Operations
- General Infrastructure Processing
- Graphical Internet Operations
- Git-based Operations
Answer: D) Git-based Operations
Explanation:
GitOps refers to operational practices that use Git as the central mechanism for managing and tracking infrastructure and application configuration changes.
5. Which version control system is most commonly associated with GitOps?
- Subversion only
- Git
- Microsoft Access
- Apache Hadoop
Answer: B) Git
Explanation:
Git is a distributed version control system used to track changes in source code and configuration files. GitOps relies on Git repositories to maintain configuration history and provide a controlled workflow for changes.
6. What is the role of a GitOps controller?
- To design application user interfaces
- To manage employee records
- To monitor configuration changes and reconcile the actual state with the desired state
- To replace Git repositories
Answer: C) To monitor configuration changes and reconcile the actual state with the desired state
Explanation:
A GitOps controller continuously observes the target environment and compares its actual state with the desired configuration stored in Git. It takes corrective actions when differences are detected.
7. Which tool is commonly used for GitOps-based continuous delivery in Kubernetes?
- Argo CD
- Adobe Photoshop
- Microsoft Word
- VLC Media Player
Answer: A) Argo CD
Explanation:
Argo CD is a declarative GitOps continuous delivery tool for Kubernetes. It monitors Git repositories and synchronizes application configurations with Kubernetes clusters.
8. Which of the following is another popular GitOps tool for Kubernetes?
- MySQL Workbench
- Figma
- Jenkins
- Flux
Answer: D) Flux
Explanation:
Flux is an open-source GitOps toolkit for Kubernetes. It uses controllers to automate application deployment and configuration management based on declarative sources.
9. What does declarative configuration mean in GitOps?
- Specifying every manual command required to deploy an application
- Describing the desired final state of an application or infrastructure
- Managing infrastructure without configuration files
- Performing all deployments through graphical interfaces
Answer: B) Describing the desired final state of an application or infrastructure
Explanation:
Declarative configuration defines what the system should look like rather than specifying every operation needed to reach that state. GitOps controllers use these definitions to manage the target environment.
10. What is continuous reconciliation in GitOps?
- Manually reviewing application screenshots
- Deleting configuration files after deployment
- Repeatedly comparing actual system state with desired state and correcting differences
- Disabling automated deployment processes
Answer: C) Repeatedly comparing actual system state with desired state and correcting differences
Explanation:
Continuous reconciliation is a core GitOps principle. Controllers periodically or eventfully inspect the target environment and work to make it match the configuration stored in the source repository.
11. Which platform is most commonly associated with GitOps deployment workflows?
- Kubernetes
- Microsoft Excel
- Adobe Illustrator
- LibreOffice Writer
Answer: A) Kubernetes
Explanation:
Kubernetes is widely used with GitOps because it supports declarative resource definitions and controllers that continuously reconcile actual resources with their desired state.
12. What is the purpose of a GitOps repository?
- To store employee payroll information
- To manage office inventory
- To host application videos
- To store version-controlled application and infrastructure configuration
Answer: D) To store version-controlled application and infrastructure configuration
Explanation:
A GitOps repository contains declarative configuration files, manifests, deployment definitions, and related resources. It provides a versioned record of the desired system state.
13. What is a Git commit?
- A command that deletes an entire repository
- A recorded snapshot of changes in a Git repository
- A method for creating cloud virtual machines
- A Kubernetes networking resource
Answer: B) A recorded snapshot of changes in a Git repository
Explanation:
A Git commit records changes to files in a repository. In GitOps workflows, commits provide a traceable history of modifications to application and infrastructure configurations.
14. Why are pull requests useful in GitOps?
- They automatically remove all infrastructure resources
- They disable version control history
- They allow configuration changes to be reviewed before merging
- They replace deployment controllers
Answer: C) They allow configuration changes to be reviewed before merging
Explanation:
Pull requests provide a structured way to review proposed configuration changes. Team members can inspect modifications, run automated checks, and approve changes before they become part of the desired configuration.
15. What is the purpose of a Git branch?
- To support independent development and configuration changes
- To replace the Git repository
- To store Kubernetes cluster logs permanently
- To disable collaboration between developers
Answer: A) To support independent development and configuration changes
Explanation:
Git branches allow developers to work on separate changes without immediately modifying the main branch. In GitOps, branches can be used to prepare and review deployment configuration updates.
16. What is a Kubernetes manifest?
- A document containing employee details
- A binary application executable
- A graphical dashboard for cloud billing
- A YAML or JSON file that describes Kubernetes resources and their desired configuration
Answer: D) A YAML or JSON file that describes Kubernetes resources and their desired configuration
Explanation:
Kubernetes manifests define resources such as Deployments, Services, ConfigMaps, and Secrets. GitOps tools can monitor repositories containing these manifests and apply their configurations to clusters.
17. What is the purpose of the Kubernetes Deployment resource?
- To manage employee access permissions
- To manage replicated application Pods and their rollout updates
- To store source code in Git
- To monitor cloud provider billing
Answer: B) To manage replicated application Pods and their rollout updates
Explanation:
A Kubernetes Deployment manages application Pods through ReplicaSets. It supports declarative updates, scaling, and controlled rollout of application versions.
18. What does synchronization mean in GitOps?
- Copying application files to a personal computer
- Deleting all configuration files from Git
- Applying the desired configuration from the source repository to the target environment
- Disabling cluster monitoring
Answer: C) Applying the desired configuration from the source repository to the target environment
Explanation:
Synchronization brings the target environment into alignment with the desired configuration stored in Git. GitOps tools such as Argo CD can perform this operation automatically or through an approved manual action.
19. What does an OutOfSync status indicate in Argo CD?
- The live application state differs from the desired state in Git
- The Git repository has been permanently deleted
- The Kubernetes cluster has no network connection in every case
- The application has been removed from the service catalog
Answer: A) The live application state differs from the desired state in Git
Explanation:
Argo CD reports an application as OutOfSync when the live resources do not match the desired configuration in the repository. Synchronization can be used to apply the required changes.
20. What does a Synced status generally indicate in Argo CD?
- The application has no Git repository
- The application is permanently stopped
- The cluster has no resources
- The live application configuration matches the desired configuration in Git
Answer: D) The live application configuration matches the desired configuration in Git
Explanation:
A Synced status indicates that the live resources are aligned with the desired configuration tracked by Argo CD. It does not, by itself, guarantee that the application is healthy or functioning correctly.
21. What is the purpose of automated synchronization in GitOps?
- To require manual deployment for every configuration change
- To automatically apply approved changes from the Git repository to the target environment
- To delete Git history after each deployment
- To prevent controllers from checking configuration changes
Answer: B) To automatically apply approved changes from the Git repository to the target environment
Explanation:
Automated synchronization allows GitOps controllers to apply repository changes without requiring a person to initiate each deployment. Depending on the tool and configuration, additional controls such as validation and approval may be used.
22. What is the pull-based deployment model in GitOps?
- A model in which developers manually copy files to production servers
- A method of deploying applications without configuration files
- A model in which an agent or controller inside the target environment retrieves desired configuration from a repository
- A system that prevents target environments from accessing Git repositories
Answer: C) A model in which an agent or controller inside the target environment retrieves desired configuration from a repository
Explanation:
In a pull-based GitOps model, a controller running in or associated with the target environment monitors the source repository and applies changes. This reduces the need for external deployment systems to directly access the cluster.
23. What is a push-based deployment model?
- An external automation system sends deployment changes to the target environment
- A controller inside the cluster retrieves all configurations from Git
- A developer manually changes every running container
- A repository automatically deletes all previous commits
Answer: A) An external automation system sends deployment changes to the target environment
Explanation:
In a push-based deployment model, an external system initiates deployment operations and sends changes to the target environment. Traditional CI/CD pipelines often use this approach.
24. What is the main security advantage of a pull-based GitOps model?
- It removes the need for authentication
- It allows all users to access the production cluster
- It prevents Git repositories from being protected
- It can reduce the need to expose cluster credentials to external deployment systems
Answer: D) It can reduce the need to expose cluster credentials to external deployment systems
Explanation:
In a pull-based model, the controller inside the target environment initiates communication with the repository. This can reduce the number of external systems that require direct access to cluster credentials.
25. What is the role of a CI pipeline in a GitOps workflow?
- To permanently replace Git repositories
- To build, test, scan, and publish application artifacts or configuration changes
- To manage employee payroll information
- To disable automated deployment processes
Answer: B) To build, test, scan, and publish application artifacts or configuration changes
Explanation:
Continuous Integration pipelines commonly build and test application code, perform security checks, and publish container images. A subsequent Git change can update the desired image version, which a GitOps controller then deploys.
26. What is the relationship between CI and GitOps?
- They are identical processes
- GitOps replaces all software testing activities
- CI builds and validates artifacts, while GitOps manages deployment through declarative configuration
- CI is used only for database administration
Answer: C) CI builds and validates artifacts, while GitOps manages deployment through declarative configuration
Explanation:
CI focuses on integrating and validating code changes. GitOps focuses on maintaining and deploying the desired application and infrastructure state. They work together in many modern software delivery workflows.
27. What is a GitOps reconciliation loop?
- A repeated process of observing the system, comparing states, and applying corrective actions
- A method of creating unlimited Git branches
- A process of deleting application logs
- A technique for manually installing operating systems
Answer: A) A repeated process of observing the system, comparing states, and applying corrective actions
Explanation:
The reconciliation loop is the mechanism through which GitOps controllers maintain the desired state. It continuously checks the environment and corrects differences according to the configured reconciliation behavior.
28. What happens when someone manually changes a resource managed by GitOps?
- The Git repository is automatically deleted
- The application must always be rebuilt
- The GitOps controller permanently stops working
- The controller may detect the drift and restore the configuration defined in Git
Answer: D) The controller may detect the drift and restore the configuration defined in Git
Explanation:
GitOps controllers compare actual resources with the desired configuration. When manual changes cause drift, the controller can restore the declared state if reconciliation and self-healing behavior are configured.
29. What is self-healing in GitOps?
- Automatically repairing application source code errors
- Automatically correcting configuration drift to restore the desired state
- Replacing all application developers
- Deleting Git repositories after deployment
Answer: B) Automatically correcting configuration drift to restore the desired state
Explanation:
Self-healing is a GitOps capability in which controllers detect differences between actual and desired configurations and automatically correct them. It helps maintain consistency in managed environments.
30. Which file format is commonly used for Kubernetes configuration in GitOps repositories?
- MP3
- JPEG
- YAML
- PDF
Answer: C) YAML
Explanation:
YAML is commonly used to define Kubernetes resources such as Deployments, Services, ConfigMaps, and Ingress objects. GitOps tools can monitor repositories containing these files and apply their definitions.
31. What is Helm used for in GitOps workflows?
- Managing employee access cards
- Monitoring physical server temperatures
- Replacing Kubernetes entirely
- Packaging and managing Kubernetes applications using charts
Answer: D) Packaging and managing Kubernetes applications using charts
Explanation:
Helm is a package manager for Kubernetes. Helm charts define application resources and configurable values, allowing GitOps tools to manage application releases through version-controlled configurations.
32. What is Kustomize commonly used for?
- Customizing Kubernetes configuration using reusable bases and overlays
- Building desktop graphics applications
- Managing database transactions
- Replacing Git version control
Answer: A) Customizing Kubernetes configuration using reusable bases and overlays
Explanation:
Kustomize allows users to customize Kubernetes manifests without requiring a template language. It supports reusable bases and environment-specific overlays, making it useful in GitOps repositories.
33. What is a GitOps application definition in Argo CD?
- A document describing employee responsibilities
- A configuration that identifies the source repository, target cluster, namespace, and deployment path
- A database backup file
- A container image stored in a registry
Answer: B) A configuration that identifies the source repository, target cluster, namespace, and deployment path
Explanation:
An Argo CD Application resource defines how a repository or configuration source maps to a destination cluster and namespace. It also specifies the desired deployment path and synchronization behavior.
34. What is the purpose of an ApplicationSet in Argo CD?
- To store application passwords in plain text
- To replace Kubernetes namespaces
- To delete all application resources automatically
- To generate and manage multiple Argo CD Application resources from templates and generators
Answer: D) To generate and manage multiple Argo CD Application resources from templates and generators
Explanation:
Argo CD ApplicationSet helps manage applications across multiple clusters, environments, or repository paths. It uses templates and generators to create Application resources automatically.
35. What is the purpose of a GitOps repository structure?
- To store unrelated personal documents
- To replace all infrastructure documentation
- To organize application manifests, environment configurations, and deployment definitions
- To prevent teams from reusing configuration files
Answer: C) To organize application manifests, environment configurations, and deployment definitions
Explanation:
A well-organized GitOps repository makes configuration easier to understand and maintain. Teams may separate application definitions, environment overlays, infrastructure resources, and shared components into structured directories.
36. What is the purpose of separating development, staging, and production configurations in GitOps?
- To support environment-specific settings and controlled promotion of changes
- To eliminate configuration versioning
- To make all environments use unrelated application versions permanently
- To prevent testing before production deployment
Answer: A) To support environment-specific settings and controlled promotion of changes
Explanation:
Different environments may require different resource settings, replicas, endpoints, and security configurations. Separating these settings helps teams test changes before promoting them to production.
37. How can GitOps support rollback?
- By permanently deleting previous commits
- By disabling the reconciliation controller
- By replacing Git with manual configuration
- By reverting the repository to a previously approved configuration version
Answer: D) By reverting the repository to a previously approved configuration version
Explanation:
Git maintains a history of configuration changes. Teams can revert a problematic change or restore an earlier approved version, allowing the GitOps controller to reconcile the environment with that configuration.
38. What is the role of container registries in GitOps workflows?
- To store employee records
- To store and distribute container images used by applications
- To replace Git repositories
- To manage source code branches
Answer: B) To store and distribute container images used by applications
Explanation:
Container registries store application images that are referenced by Kubernetes manifests or deployment configurations. CI pipelines commonly publish images to registries, while GitOps updates the desired image version in Git.
39. Why are immutable container image tags or digests useful in GitOps?
- They automatically remove application dependencies
- They eliminate the need for image registries
- They help identify the exact image version intended for deployment
- They prevent applications from being updated
Answer: C) They help identify the exact image version intended for deployment
Explanation:
Using unique image tags or image digests makes deployments more predictable by identifying a specific image version. This improves traceability and reduces uncertainty that can occur when mutable tags such as `latest` are used.
40. What is the purpose of secret management in GitOps?
- To securely handle sensitive values such as passwords, tokens, and API keys
- To store all credentials in publicly accessible Git repositories
- To disable authentication for Kubernetes clusters
- To replace application monitoring
Answer: A) To securely handle sensitive values such as passwords, tokens, and API keys
Explanation:
Secret management protects sensitive information used by applications and infrastructure. GitOps workflows can integrate with external secret managers or encryption solutions to avoid exposing confidential values in plain-text repositories.
41. Which tool can help manage encrypted secrets in GitOps repositories?
- Microsoft Paint
- Sealed Secrets
- VLC Media Player
- Google Slides
Answer: B) Sealed Secrets
Explanation:
Sealed Secrets is a Kubernetes-focused tool that allows encrypted secret resources to be stored in Git repositories. A controller in the cluster decrypts the sealed values into Kubernetes Secrets using the corresponding private key.
42. What is the purpose of GitOps monitoring?
- To manage employee attendance
- To replace source code management
- To disable deployment alerts
- To track synchronization status, reconciliation errors, application health, and deployment activity
Answer: D) To track synchronization status, reconciliation errors, application health, and deployment activity
Explanation:
Monitoring helps teams understand whether GitOps controllers are operating correctly and whether applications are synchronized and healthy. It also helps identify failed deployments and reconciliation problems.
43. What does a GitOps controller do when it cannot access the source repository?
- It may fail to retrieve new configuration changes and report reconciliation errors
- It automatically deletes the entire cluster
- It permanently removes all application images
- It converts the repository into a database
Answer: A) It may fail to retrieve new configuration changes and report reconciliation errors
Explanation:
A GitOps controller needs access to its configured source to retrieve desired state changes. If repository access fails, it may continue running the current workloads but cannot reliably process new configuration updates until connectivity is restored.
44. Which practice improves security in a GitOps environment?
- Allowing unrestricted repository access
- Storing production credentials in public files
- Using access controls, protected branches, and secure secret management
- Disabling audit logs and deployment reviews
Answer: C) Using access controls, protected branches, and secure secret management
Explanation:
GitOps security depends on protecting both repositories and deployment environments. Role-based access, branch protection, code reviews, signed commits where appropriate, and secure credential handling help reduce unauthorized changes.
45. What is the main benefit of using GitOps in multi-cluster Kubernetes environments?
- It removes the need for Kubernetes namespaces
- It enables consistent, version-controlled configuration management across multiple clusters
- It requires all clusters to run on the same physical server
- It eliminates the need for cluster monitoring
Answer: B) It enables consistent, version-controlled configuration management across multiple clusters
Explanation:
GitOps tools can manage applications and configurations across multiple Kubernetes clusters. Shared repository structures and reusable manifests help maintain consistency while allowing cluster-specific settings.
46. What is the relationship between GitOps and Infrastructure as Code (IaC)?
- They are completely unrelated practices
- GitOps replaces all infrastructure definitions
- IaC is used only for application testing
- IaC defines infrastructure through code, while GitOps uses Git-based workflows to manage and reconcile declared configurations
Answer: D) IaC defines infrastructure through code, while GitOps uses Git-based workflows to manage and reconcile declared configurations
Explanation:
Infrastructure as Code provides a way to define infrastructure in machine-readable files. GitOps builds on version-controlled configuration and automated reconciliation to manage how those definitions are applied and maintained.
47. Which of the following is a common GitOps anti-pattern?
- Making production changes manually without updating the Git source of truth
- Reviewing configuration changes through pull requests
- Using declarative Kubernetes manifests
- Monitoring reconciliation status
Answer: A) Making production changes manually without updating the Git source of truth
Explanation:
Manual changes outside the GitOps workflow can create configuration drift and make the repository an inaccurate representation of the environment. Changes should generally be recorded and reviewed through the version-controlled workflow.
48. What is the purpose of progressive delivery in a GitOps environment?
- To deploy every change to all users immediately
- To disable deployment monitoring
- To release application changes gradually while evaluating their impact
- To remove version control from deployment workflows
Answer: C) To release application changes gradually while evaluating their impact
Explanation:
Progressive delivery gradually introduces application changes using strategies such as canary releases and blue-green deployments. It allows teams to evaluate application behavior before completing a full rollout.
49. Which statement best describes the difference between traditional push-based deployment and pull-based GitOps?
- Both approaches always require manual configuration of every resource
- Push-based deployment sends changes from an external system, while pull-based GitOps uses a controller to retrieve desired configuration from a source repository
- Pull-based GitOps does not use Git repositories
- Push-based deployment is supported only by desktop applications
Answer: B) Push-based deployment sends changes from an external system, while pull-based GitOps uses a controller to retrieve desired configuration from a source repository
Explanation:
In push-based deployment, an external pipeline initiates changes in the target environment. In pull-based GitOps, a controller monitors the source repository and retrieves configuration changes to reconcile the target environment.
50. A development team uses GitOps to deploy an application. The desired configuration in Git specifies 5 replicas, but the Kubernetes cluster currently runs only 3 replicas. If the GitOps controller successfully reconciles the configuration, how many replicas should be running afterward?
- 3 replicas
- 4 replicas
- 6 replicas
- 5 replicas
Answer: D) 5 replicas
Explanation:
The desired state stored in Git specifies 5 replicas, while the actual cluster state has only 3 replicas.
Difference = 5 - 3 = 2 replicas.
During reconciliation, the GitOps controller detects the difference and applies the required change to reach the desired state.
Therefore, the Kubernetes deployment should have 5 replicas after successful reconciliation.