Professional Documents
Culture Documents
The purpose of this deck is to dive deeper into how Argo CD works. It’s intended for SAs/Consultants presenting to the technical
staff/team of a customer.
You can use all or a subset of this presentation as you see fit.
Business value/overview presentation can be found here: Continuous Delivery and GitOps on OpenShift
1
OpenShift GitOps Deep Dive
Technical Deep Dive into Argo CD
2
OpenShift GitOps
Declarative GitOps for multi-cluster
continuous delivery
3
OpenShift GitOps
Powered by
Argo CD
5
Argo CD
OpenShift
Pull Request (on-premises)
merged webhook sync
OpenShift
(public cloud)
poll
Kubernetes
hooks
6
Flexible Deployment Strategies
App A App B
Auth
OpenShift
NS NS
Registry
Networking
NS NS
Storage
Install Operators
NS NS
Namespaces
... App A App B
OpenShift OpenShift
A central Argo CD pushes Git A cluster-scope Argo CD pulls cluster An application scoped Argo CD pulls
repository content to remote service configurations into the application deployment and
OpenShift and Kubernetes clusters OpenShift cluster configurations into app namespaces
7
Argo CD Applications
Atomic Unit of Work within Argo CD
8
Argo CD Application
apiVersion: argoproj.io/v1alpha1
● “Application” is a custom resource kind: Application
metadata:
provided by Argo CD name: product-catalog-dev
namespace: argocd
● Unit of work within Argo CD spec:
destination:
● Logical collection of YAML namespace: argocd
server: https://kubernetes.default.svc
● Support for Helm and Kustomize project: product-catalog
source:
● Configuration specs path: manifests/app/overlays/dev-quay
repoURL: https://github.com/gnunn-gitops/product-catalog.git
○ Git Repository targetRevision: main
syncPolicy:
automated:
○ Revision/Branch prune: false
selfHeal: false
○ What cluster and namespace
Application Scope of Deployment
12
App of Apps Pattern
● Very flexible
Manifest Templeting
Working with Kustomize and Helm
20
Avoiding YAML Duplication
apiVersion: kustomize.config.k8s.io/v1beta1
└── apps
kind: Kustomization
└── myapp
├── base
resources:
│ ├── kustomization.yaml
- service.yaml
│ ├── service.yaml
- route.yaml
│ ├── route.yaml
- deployment.yaml
│ └── deployment.yaml
│
└── overlays
├── dev
apiVersion: kustomize.config.k8s.io/v1beta1
│ ├── patch-route.yaml
kind: Kustomization
│ ├── namespace.yaml
│ └── kustomization.yaml
Namespace: dev
└── stage
bases:
├── patch-route.yaml
- ../../base
├── namespace.yaml
resources:
└── kustomization.yaml
- namespace.yaml
patchesStrategicMerge:
- patch-route.yaml
Helm Templates
apiVersion: argoproj.io/v1alpha1
● Argo CD supports Kustomize kind: Application
metadata:
natively name: product-catalog-dev
namespace: argocd
● No special configuration is needed. spec:
destination:
● Automatically detects that you’re namespace: argocd
using Kustomize server: https://kubernetes.default.svc
project: product-catalog
● YAML is validated before applying source:
path: manifests/app/overlays/dev-quay
repoURL: https://github.com/gnunn-gitops/product-catalog.git
targetRevision: main
syncPolicy:
automated:
prune: false
selfHeal: false
Helm Integration with ArgoCD
26
Argo CD Sync
27
Sync Operation
29
SyncWaves
How to deploy your manifests in a
specific order
30
Ordering Deployment
32
NOTE: Since an application can be unhealthy at any point of any wave, it may be that
your Application will never get to healthy!
SyncHooks
Using a phased sync process to refine
your deployments
33
Phased Deployment
● Argo CD has 3 main deployment phases (Hooks)
○ PreSync
○ Sync
○ PostSync
● Deletion Policies
○ HookSucceeded
○ HookFailed
○ BeforeHookCreation
Hook Deletion
● Deletion Policies
○ HookSucceeded
○ HookFailed
○ BeforeHookCreation
Using Syncwaves and
Hooks
Example of how to use both Syncwaves
and Hooks together.
36
Syncwaves and Hooks
37
Syncwaves and Hooks
Passage of Time
38
Syncwaves and Hooks
Passage of Time
Phases
39
Syncwaves and Hooks
Passage of Time
Phases
job
40
Syncwaves and Hooks
Passage of Time
Phases
job
41
Syncwaves and Hooks
Passage of Time
Phases
job
42
Syncwaves and Hooks
Passage of Time
Phases
0 1 2
job
43
Syncwaves and Hooks
Passage of Time
Phases
0 1 2
job
44
Syncwaves and Hooks
Passage of Time
Phases
0 1 2
job
45
Syncwaves and Hooks
Passage of Time
Phases
0 1 2
job
46
Syncwaves and Hooks
Passage of Time
Phases
0 1 2
job
47
Syncwaves and Hooks
Passage of Time
Phases
0 1 2
job
48
Syncwaves and Hooks
Passage of Time
Phases
0 1 2
job
49
Syncwaves and Hooks
Passage of Time
Phases
0 1 2
job
50
Thank You! linkedin.com/company/red-hat
youtube.com/user/RedHatVideos
facebook.com/redhatinc
twitter.com/RedHat
51