Logo

dev-resources.site

for different kinds of informations.

Stop using "GitOps" to sell your products

Published at
8/30/2024
Categories
kubernetes
gitops
Author
francoislp
Categories
2 categories in total
kubernetes
open
gitops
open
Author
10 person written this
francoislp
open
Stop using "GitOps" to sell your products

Hello there, and welcome to the first rant on this blog. No, deploying infrastructure from Git doesn't mean you are doing "GitOps". It's called Infrastructure-as-Code on Git.

GitOps is IaC, but IaC is not necessarily GitOps.

So what is GitOps?

Well, there is a specification, a standard, named OpenGitOps that defines it the following way (the main focus of this post is on the 4th principle):

1. Declarative

A system managed by GitOps must have its desired state expressed declaratively.

Well, there is not much to add, it shouldn't be a for-loop in a bash script that uses an API, but just plain declarative configuration code.

2. Versioned and Immutable

Desired state is stored in a way that enforces immutability, versioning and retains a complete version history.

That's the Git part of GitOps! Although it started with Git (and that's where the name comes from), now you can find another state store like OCI repositories.

3. Pulled Automatically

Software agents automatically pull the desired state declarations from the source.

The "software agents" are the tools like Flux, ArgoCD, etc. that will pull the desired state from the source (Git or OCI repository). It shouldn't be manual.

4. Continuously Reconciled

Software agents continuously observe actual system state and attempt to apply the desired state.

That's to me THE point where people get GitOps wrong (or on purpose wrong, to sell you more buzzwords).

If the state of the system changes, you should expect the software agent to reconcile the state to the desired state. In other words, what is in Git should be reflected in the Kubernetes Cluster all the time.

Adding a CI/CD pipeline to your repository that runs a kubectl apply is not GitOps. GitOps is to have a tool checking for drift detection and re-applying the desired state when needed.

Let's take an example: The new intern - let's name him Kevin - gets production access, and for debug purposes sets the replica number of a Kubernetes deployment to 0 instead of 3. Well, the GitOps software agent should see that the state of the cluster is different from the desired state and re-apply the desired state, causing the deployment to be back to the desired state: 3. it's a very powerful feature that brings production robustness to manual errors and drift detection!

Do you want to see a super powerful and strong GitOps agent? Here is mine:

āžœ  ~ while true; \
  do kubectl apply -f https://raw.githubusercontent.com/kubernetes/website/snapshot-initial-v1.31/content/en/examples/pods/simple-pod.yaml; \
  sleep 15; \
done
pod/nginx created
pod/nginx unchanged
pod/nginx unchanged
pod/nginx unchanged
Enter fullscreen mode Exit fullscreen mode

It's declarative, versioned and immutable in Git (Pod specs are in YAML here). It's pulled from Git, and it's continuously reconciled every 15 seconds. It's GitOps!

Final notes

This post is written by a "DevOps" engineer, so don't pay too much attention to buzzwords after all. I hope I shed some light on the GitOps principles at the cost of a clickbait title (and maybe a few Twitter dramas).

Sources

:wq

gitops Article's
30 articles in total
Favicon
How to Solve Common Kubernetes Multi-Cluster Deployment Issues
Favicon
Effortless vCluster Management with Sveltos: An Event-Driven Approach
Favicon
Google's Intent-Based Deployment with Prodspec and Annealing
Favicon
5 Best Practices for Multi-Cluster Kubernetes Add-on Management
Favicon
Emerging Trends in Git: GitOps, Monorepos, Distributed Repositories, and AI Integration
Favicon
Automating PostgreSQL Clusters: A Guide to Deployment with ArgoCD and CloudNativePG
Favicon
Advanced Kubernetes Deployment with GitOps: A Hands-On Guide To Terraform, Ansible, ArgoCD And Observability Tools
Favicon
GitOps and FluxCD: Continuous Deployment for Kubernetes on AWS
Favicon
GitOps vs Traditional DevOps: Understanding the Key Differences and Benefits
Favicon
Consistent Deployment Strategies for Kubernetes
Favicon
Why GitOps is Revolutionizing DevOps: A Guide for Agile Teams
Favicon
GitOps: A Strategic Advantage for Automation, Collaboration, and Cost Savings
Favicon
Setting Up Machine Learning Pipelines with GitOps Principles
Favicon
Automating CI/CD Pipelines for Kubernetes with Argo Rollouts, Argo CD, Argo Workflow & Events
Favicon
How Talking to a College Senior taught me Devops/Gitops
Favicon
Leveraging ArgoCD for Kubernetes Applications: Implementation, Use Cases, and Best Practices
Favicon
šŸ—‚ļø Master SQL Review with GUI šŸŽ›ļø, GitOps šŸ–‡ļø and API šŸ”Œ
Favicon
GitOps Across Clusters ā€” How ArgoCD and Kustomize Makes It Simple
Favicon
Portainer + gitops ā¤ļø: A simple way to deploy and manage your self-hosted applications
Favicon
Kargo - promote your application changes in a controlled (GitOps) way!
Favicon
Tekton - A Kubernetes-native CI/CD : Day 46 of 50 days DevOps Tools Series
Favicon
GitOps + ArgoCD: A Perfect Match for Kubernetes Continuous Delivery
Favicon
FluxCD - A lightweight GitOps CD tool: Day 44 of 50 days DevOps Tools Series
Favicon
CI/CD Pipeline for a Next.js Application Using GitHub Actions, ArgoCD, and MicroK8s
Favicon
GitOps Adoption: A Simple Guide to Modern Cloud Management
Favicon
A Production Ready EKS Deployment with GitOps - Part 1 - Introduction
Favicon
Kubernetes Multi-Cluster Management šŸ“¦
Favicon
Stop using "GitOps" to sell your products
Favicon
GitOps: ArgoCD vs FluxCD
Favicon
What is GitOps ?

Featured ones: