Kubernetes and Cloud Native Associate (KCNA)Cloud Native ArchitectureMedium
A cloud-native application is deployed using a GitOps workflow. The operations team needs to revert the entire application and infrastructure configuration to a previous known good state quickly and reliably after an erroneous change was committed to the Git repository and automatically applied. What is the most effective way to achieve this in a GitOps model?
- APerform a Git revert or reset command on the repository, then let the GitOps agent reconcile.
- BDelete the current deployment and redeploy the application from scratch.
- CUse the cloud provider's console to manually roll back each resource.
- DManually SSH into each server and revert configurations.
Show answer & explanationAnswer & explanation
Correct answer: A. Perform a Git revert or reset command on the repository, then let the GitOps agent reconcile.
In a GitOps workflow, Git is the single source of truth. To revert to a previous state, you simply perform a Git revert or reset on the configuration repository. The GitOps agent will then detect the change in the desired state and automatically reconcile the cluster's actual state to match the reverted Git state.
Why the other options are wrong
- B. Deleting and redeploying from scratch is disruptive and not an efficient way to 'revert' to a previous state.
- C. Manually rolling back resources via a cloud console bypasses the GitOps workflow, leading to state drift and loss of auditability.
- D. Manually SSHing into servers is antithetical to GitOps and cloud-native automation, and error-prone.
GitOps Rollback
The process of reverting a cloud-native environment to a previous desired state by manipulating the Git repository that serves as the single source of truth, typically using Git revert or reset commands.
- Achieved by modifying the Git repository, not the live system directly.
- Leverages the GitOps agent's reconciliation loop.
- Provides auditability and traceability of rollbacks.
- Ensures consistency between Git and the operational environment.
Memory trick: Git's good for go-back.