# What is GitOps?

### GitOps

GitOps is a framework where the entire code is controlled by the git.

GitOps can be considered an extension of Infrastructure as Code (IaC) that uses Git as the Version control System.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696085612946/e0786f54-e919-4628-932a-5c700b89d5d1.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696085748912/5ae143dc-319c-45cc-b0e5-608936c1608e.png align="center")

### GitOps Principles

1. Declarative vs imperative
    
2. Make use of Git.
    
3. Pull Request
    
4. Reconcile Loop
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696086014415/cc1c990f-db7e-4309-8daf-0036f22c1be5.png align="center")

### DevOps Vs GitOps

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696086093556/53bf01c4-361f-49aa-810c-bc851cdfe331.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696086201062/841a9bcc-608f-4a9c-9c1a-0b0448c2e6d6.png align="center")

### Push vs Pull based Deployments

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696165124211/81263942-6af4-453c-8e3b-64642ac6e369.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696165200482/a352145b-e8c8-46c1-8cc7-ad6d7e7677dd.png align="center")

### GitOps Features

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696165421938/38a89ed5-3289-46d6-b0fc-6546b57a5e0a.png align="center")

### GitOps Benefits & Challenges

Pro's

* Lightweight and Vendor-neutral
    
* Faster, Safer, Immutablem and Reproducible Deployments
    
* Eliminating configuration drift
    
* uses familiar tools and processes
    
* Revisions with history
    

Con's

* Doesn't help with Secret Management
    
* Number of Git repositories
    
* Challenges with programmatic updates.
    
* Governance other than PR approval.
    
* Malformed YAML/Config manifests.
    

GitOps Projects/Tools

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696167482480/18fbfd3d-8e07-4152-8cc6-ac9d1288c0ef.png align="center")

ArgoCD:

FluxCD

Atlantis

Autoapply

CloudBees Rollout:

JenkinsX: CI/CD Platform

Flagger:

Ignite: VM Manager

Faros

Helm Operator

Weave GitOps Core

KubeStack

Weave Cloud

GitKube

PipeCD

Werf

What is ArgoCD?

* Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes resources defined in a Git repository.
    
* Continuously monitors running applications and compares their live state to the desired state.
    
* It reports the deviations and provides visualizations to help developers manually or automatically sync the live state with the desired state.
    

Why use ArgoCD

* It extends the benefits of declarative specifications and Git-based configuration management.
    
* It is the first step in achieving continuous operations on monitoring, analytics, and automation remediation.
    
* It can deploy to multiple clusters and is Enterprise-friendly( audibility, compliance, security, RBAC, SSO and a lot more.
    

How ArgoCD works?

* It follows the GitOps pattern by using Git repositories as the source of truth for the desired state of the app and the target deployment envs.
    

Kustomize applications

Helm Charts

Ksonnet applications Jsonnet files

YAML/JSON manifests

* It automates the synchronization of the desired application state with each of the specified target environments.
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696169448761/ff9f978e-dcff-4881-a9ad-c60ab77f91e3.png align="center")

### ArgoCD Concepts & Terminology

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696169836800/919f84eb-95d5-44d7-8b07-5fd69c64a728.png align="center")

### ArgoCD Features

1. Automated deployment of applications to specified target environments in multiple clusters.
    
2. Support for multiple config management/templating tools (Kustomize, Helm, Ksonnet, Jsonnet, plain-YAML).
    
3. SSO Integrations (OIDC, OAuth2, LDAP, SAML 2.0, GitHub, GitLab, Microsoft, Linkedin)
    
4. Multi-tenancy and RBAC policies for authorization.
    
5. Rollback/Roll-anywhere to any application configuration committed in the Git repository.
    
6. Health status analysis of application resources.
    
7. Automated configuration drift detection and visualization.
    
8. Out-of-the-box Prometheus metrics.
    
9. Audit trails for application events and API Calls
    
10. PreSync, Sync, and PostSync hooks to support complex application rollouts (e.g. blue/green & Canary upgrades).
    
11. Webhook integration (GitHub, BitBucket, GitLab).
    
12. CLI and access tokens for automation and CI integration.
    
13. Web UI which provides a real-time view of application activity.
    
14. Automated or manual syncing of applications to their desired state.
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696172086680/d9329b9d-f796-4241-b68a-047042f61c11.png align="center")

### ArgoCD Architecture

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696172267415/21a7181b-f94a-431f-a633-af595d8028f2.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696172437184/8c45cd97-6c7f-42fa-9350-70d96eb76906.png align="center")

### Installation Options

ArgoCD has two types of installations.

Core

Multi-Tenant

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696176499919/28d55a32-55bc-4638-a3db-74286c4d4f87.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696176536277/904f36e3-6ad9-4717-aa53-e7eb584f4605.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696176569362/8e6d064e-c6ec-4871-8b7c-c56964d50d0d.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696176593362/6b08b769-8b36-4003-a47a-66a2ab0472b2.png align="center")

ArgoCD Commands

`argocd login ipaddress-argocd-server`

`argocd app list`

`argocd cluster list`

ArgoCD Application

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696177362759/3bbf2e64-12df-4d3f-b786-63589ee24108.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696177443137/beca8811-0ee8-4f15-8ae2-a29afc8eb63e.png align="center")

Creating application using the cli

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696177413119/a8868ca6-e36c-4f36-9083-ce4757697698.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696177472899/83fe895c-46d4-40ec-b258-46c1a43878b9.png align="center")

Demo Application

ArgoCD CLI  
`argocd app create application`

`argocd app list`

`argocd app sync application Name`

`argocd proj list`

### Reconciliation Loop

Using Timeout

The default timeout is 3 minutes

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696179142613/7a3cfde8-d10a-4247-8925-0db7fd3acc33.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696179163908/b752b2f6-406a-42b8-9c05-e7e1c417c8f0.png align="center")

WebHook

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696179204689/13b5543e-67a9-4184-ae31-1875114139e4.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696179224810/0ae657e8-df8a-4d9a-a592-4332496abe79.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696179260931/9faa6ed3-79bf-49b4-bc03-3f8c27211e43.png align="center")

Application Health Checks

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696179979606/47cffcf6-dab6-4d8d-a009-10eacbe6b9a8.png align="center")

ArgoCD supports custom health checks written in Lua.

Define a custom Health check in argocd-cm ConfigMap.

Contribute custom Health Checks.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696180154446/1dcb1c8d-5868-46ad-84b6-f9a9759a480d.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696180234740/d140353f-7d9e-4d28-982d-57bbe518fd66.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696180187621/9ccc2373-ba15-47a4-afdc-e325ea7d7083.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1696180207371/a221ca76-670c-41b3-afa8-ee1cefd54efc.png align="center")

---

Thanks for reading! I hope you found this helpful and informative.

I'm always happy to connect with fellow tech enthusiasts and answer any questions you may have. Don't forget to follow me for more updates on tech, programming, and more.😄😄

Follow me on LinkedIn to see interesting posts like this : ) [**Linkedin**](https://www.linkedin.com/in/subbaramireddy/)
