#gitops #kubernetes ![[Image-29-10-2024-2.png]] - Declarative Configuration - Versioning and Immutability - Desired State Automation - Continuous Reconciliation ![[Image-29-10-2024-3.png]] - Commits to application repositories trigger an automated build + test CI/CD pipeline. Upon successful test execution, a container image is built, tagged and pushed to the container registry. - CI/CD system **_does_** **_NOT_** imperatively deploy the built application, but rather **_commits a configuration change to the GitOps repository_**, updating the image tag in the deployment manifest with the one that was just built. - GitOps Agent is configured to watch for changes within the GitOps repository and apply them automatically. It will detect that the desired state in the GitOps repository has changed and no longer matches the actual state within the cluster, since the running image tag does not match the desired (newly built) image tag. - GitOps Agent then figures out what all needs to be changed (in this case, just the image tag reference of the application deployment, and then applies the changes to the underlying Kubernetes resources. - Kubernetes will pull the specified image the from the container registry and replace the running instance of the application with a new version. - GitOps Agent will continuously monitor for drift between the actual and desired state of the cluster and run the reconciliation loop to ensure the state of the cluster matches the state declared within the GitOps repository.