SlideShare a Scribd company logo
if It hurts, do it more frequently
Nicola Baldi
naighes the journey to git-ops
how to automate much of the process of K8S
releases and deployments by using git as a
source of truth
nic.baldi@gmail.com
https://github.com/naighes
@nicolabaldi
development "on time, on budget, ..."
"best engineering practices" in place
a sad story
development "on time, on budget, ..."
"best engineering practices" in place
it never went into production actually :-(
a sad story
• Can I exactly reproduce any of my environments,
including the version of the operating system, its patch
level, the network configuration, the software stack, the
applications deployed into it, and their configuration?
• Can I easily make an incremental change to any of these
individual items and deploy the change to any, and all, of
my environments?
• Can I exactly reproduce any of my environments,
including the version of the operating system, its patch
level, the network configuration, the software stack, the
applications deployed into it, and their configuration?
• Can I easily make an incremental change to any of these
individual items and deploy the change to any, and all, of
my environments?
• Can I easily see each change that occurred to a particular
environment and trace it back to see exactly what the
change was, who made it, and when they made it?
canonical CI/CD pipeline
push trigger
SCM
build/test/lint/...
package
push
deploy
apply
cloneCI
deployments break and it's not clear that
a code change was responsible
config changes are also hard to track
enough of tons of bash!
fallacies
keep absolutely everything in version control
one reason that we use the
term version control in
preference to source control is
that version control isn't just for
source code; every single
artifact related to the creation
of your software should be
under version control
evolution
no-ops
devops
sysadmin
containers
virtualization
physical
microservices
SOA
monoliths
minutes
days
months
hours
IT culture Infrastructure
evolution
architecture release time
long time
ago…
2019
brings a set of opinionated and prescriptive practices
about applying git-based workflows, devops and
infrastructure as code in the context of kubernetes
git-ops
flux
push trigger
SCM
build/test/lint/...
package
push
cloneCI fluxd
sync
watch
HelmResource
apply
helm operator
deploymentdeploymentdeployment
git clone –mirror
# HEAD revision
git rev-list --max-count 1 heads/{branch}
# current revision (flux-sync is a git tag acting
# as a pointer)
git rev-list --max-count 1 flux-sync --
# retrieve changeset
changeset = repo.CommitsBetween(currentRev, headRev)
# load all manifests by walking the file system
# searching for resources (file content is inspected)
manifests = kresource.Load(baseDir)
# takes a definition of what should be running in
# the cluster and attempts to make the cluster conform
clus.Sync(manifests)
# retrieve all cluster resources
clustRes = c.getAllowedResourcesBySelector()
# for each resource, verify it exists into the
# cluster and put the change into a stage buffer
# (enrich with a couple of annotations (e.g. GC stuff)
resBytes = applyMetadata(clustRes)
kubectl apply
# Move the revision the sync state points to
ratchet.Update(currentRev, headRev)
git sync
git fetch origin refs/notes/flux:refs/notes/flux
From https://github.com/naighes/flux-get-started
* [new ref] refs/notes/flux -> refs/notes/flux
git notes --ref refs/notes/flux
1c060a70c46b7dd2d87451ce493afe2b0be76cd7
293baf09d3acec58492b69c9284879a77dc9d17d
ac01f9f47d8d724e33998388ff7153532d971aa2
40f78619092b43c4cf192795f54d87d6c7fb1869
git notes --ref refs/notes/flux show
293baf09d3acec58492b69c9284879a77dc9d17d
{
"jobID": "f1f49e8f-fb27-0a06-2a72-7ba7685dc641",
"spec": {
"type": "auto",
"spec": {
"Changes": [{
"WorkloadID": "demo:deployment/podinfo",
"Container": {
"Name": "podinfod",
"Image": "stefanprodan/podinfo:2.1.0"
},
"ImageID": "stefanprodan/podinfo:2.1.3"
}
]
}
},
"result": {
"demo:deployment/podinfo": {
"Status": "success",
"PerContainer": [{
"Container": "podinfod",
"Current": "stefanprodan/podinfo:2.1.0",
"Target": "stefanprodan/podinfo:2.1.3"
}
]
}
}
}
git notes as events
automatic releases
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
fluxcd.io/automated: "true"
fluxcd.io/tag.init: regex:^2.1.*
with the fluxcd.io annotations we instruct flux to automate this release
when a new tag with the MAJOR=2 and MINOR=1 is pushed to the docker registry,
flux will update the image field in the yaml file, will commit and push the change to
git and finally will apply the change on the cluster
a new tag is pushed
├── charts
│ └── podinfo
│ ├── Chart.yaml
│ ├── README.md
│ ├── templates
│ └── values.yaml
├── namespaces
│ ├── dev.yaml
│ └── stg.yaml
└── releases
├── dev
│ └── podinfo.yaml
└── stg
└── podinfo.yaml
apiVersion: flux.weave.works/v1beta1
kind: HelmRelease
metadata:
name: podinfo-dev
namespace: dev
labels:
chart: podinfo
annotations:
flux.weave.works/automated: "true"
flux.weave.works/tag.chart-image: glob:dev-*
spec:
releaseName: podinfo-dev
chart:
git: git@github.com:stefanprodan/gitops-helm
path: charts/podinfo
ref: master
values:
image: stefanprodan/podinfo:dev-kb9lm91e
replicaCount: 1
helm operator
--sync-state
// GitTagStateMode is a mode of state management where Flux
// uses a git tag for managing Flux state
GitTagStateMode = "git"
// NativeStateMode is a mode of state management where Flux use
// native Kubernetes resources for managing Flux state
NativeStateMode = "secret"
Default is GitTagStateMode (and it does not work in --git-readonly mode)
In this case a --git-sync-tag acts like a pointer for the revision flux is positioned at
state management
apply all the manifests in the git repo and give each
resource a label marking it as having been synced
from this source
ask the cluster for all the resources marked as being
from this source and delete those that were not
applied in previous step
be careful when git URL or branch are changed, path
is added and path is removed (NOTE: it's
"conservative")
garbage collection
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
fluxcd.io/automated: "true"
fluxcd.io/sync-checksum:
f388cbf998956871ac7b070a285dae684c250ca8
fluxcd.io/tag.init: regex:^2.1.*
--sync-garbage-collection (default is false)
where is orchestration?
where is orchestration?
+
Q&A
thank you!
Ad

More Related Content

What's hot (20)

GitOps - Modern best practices for high velocity app dev using cloud native t...
GitOps - Modern best practices for high velocity app dev using cloud native t...GitOps - Modern best practices for high velocity app dev using cloud native t...
GitOps - Modern best practices for high velocity app dev using cloud native t...
Weaveworks
 
GitOps and ArgoCD
GitOps and ArgoCDGitOps and ArgoCD
GitOps and ArgoCD
Omar Fathy
 
ArgoCD Meetup PPT final.pdf
ArgoCD Meetup PPT final.pdfArgoCD Meetup PPT final.pdf
ArgoCD Meetup PPT final.pdf
amanmakwana3
 
Speeding up your team with GitOps
Speeding up your team with GitOpsSpeeding up your team with GitOps
Speeding up your team with GitOps
Brice Fernandes
 
GitOps - Operation By Pull Request
GitOps - Operation By Pull RequestGitOps - Operation By Pull Request
GitOps - Operation By Pull Request
Kasper Nissen
 
GitOps 101 Presentation.pdf
GitOps 101 Presentation.pdfGitOps 101 Presentation.pdf
GitOps 101 Presentation.pdf
ssuser31375f
 
Continues Integration and Continuous Delivery with Azure DevOps - Deploy Anyt...
Continues Integration and Continuous Delivery with Azure DevOps - Deploy Anyt...Continues Integration and Continuous Delivery with Azure DevOps - Deploy Anyt...
Continues Integration and Continuous Delivery with Azure DevOps - Deploy Anyt...
Janusz Nowak
 
CD using ArgoCD(KnolX).pdf
CD using ArgoCD(KnolX).pdfCD using ArgoCD(KnolX).pdf
CD using ArgoCD(KnolX).pdf
Knoldus Inc.
 
Free GitOps Workshop + Intro to Kubernetes & GitOps
Free GitOps Workshop + Intro to Kubernetes & GitOpsFree GitOps Workshop + Intro to Kubernetes & GitOps
Free GitOps Workshop + Intro to Kubernetes & GitOps
Weaveworks
 
GitOps: Git come unica fonte di verità per applicazioni e infrastruttura
GitOps: Git come unica fonte di verità per applicazioni e infrastrutturaGitOps: Git come unica fonte di verità per applicazioni e infrastruttura
GitOps: Git come unica fonte di verità per applicazioni e infrastruttura
sparkfabrik
 
Gitlab, GitOps & ArgoCD
Gitlab, GitOps & ArgoCDGitlab, GitOps & ArgoCD
Gitlab, GitOps & ArgoCD
Haggai Philip Zagury
 
The Power of GitOps with Flux & GitOps Toolkit
The Power of GitOps with Flux & GitOps ToolkitThe Power of GitOps with Flux & GitOps Toolkit
The Power of GitOps with Flux & GitOps Toolkit
Weaveworks
 
Delivering Quality at Speed with GitOps
Delivering Quality at Speed with GitOpsDelivering Quality at Speed with GitOps
Delivering Quality at Speed with GitOps
Weaveworks
 
Introduction to Kubernetes Workshop
Introduction to Kubernetes WorkshopIntroduction to Kubernetes Workshop
Introduction to Kubernetes Workshop
Bob Killen
 
GitOps is the best modern practice for CD with Kubernetes
GitOps is the best modern practice for CD with KubernetesGitOps is the best modern practice for CD with Kubernetes
GitOps is the best modern practice for CD with Kubernetes
Volodymyr Shynkar
 
Modern CI/CD Pipeline Using Azure DevOps
Modern CI/CD Pipeline Using Azure DevOpsModern CI/CD Pipeline Using Azure DevOps
Modern CI/CD Pipeline Using Azure DevOps
GlobalLogic Ukraine
 
Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17
Ryan Jarvinen
 
Intro to Helm for Kubernetes
Intro to Helm for KubernetesIntro to Helm for Kubernetes
Intro to Helm for Kubernetes
Carlos E. Salazar
 
Docker introduction & benefits
Docker introduction & benefitsDocker introduction & benefits
Docker introduction & benefits
Amit Manwade
 
GitOps for Helm Users by Scott Rigby
GitOps for Helm Users by Scott RigbyGitOps for Helm Users by Scott Rigby
GitOps for Helm Users by Scott Rigby
Weaveworks
 
GitOps - Modern best practices for high velocity app dev using cloud native t...
GitOps - Modern best practices for high velocity app dev using cloud native t...GitOps - Modern best practices for high velocity app dev using cloud native t...
GitOps - Modern best practices for high velocity app dev using cloud native t...
Weaveworks
 
GitOps and ArgoCD
GitOps and ArgoCDGitOps and ArgoCD
GitOps and ArgoCD
Omar Fathy
 
ArgoCD Meetup PPT final.pdf
ArgoCD Meetup PPT final.pdfArgoCD Meetup PPT final.pdf
ArgoCD Meetup PPT final.pdf
amanmakwana3
 
Speeding up your team with GitOps
Speeding up your team with GitOpsSpeeding up your team with GitOps
Speeding up your team with GitOps
Brice Fernandes
 
GitOps - Operation By Pull Request
GitOps - Operation By Pull RequestGitOps - Operation By Pull Request
GitOps - Operation By Pull Request
Kasper Nissen
 
GitOps 101 Presentation.pdf
GitOps 101 Presentation.pdfGitOps 101 Presentation.pdf
GitOps 101 Presentation.pdf
ssuser31375f
 
Continues Integration and Continuous Delivery with Azure DevOps - Deploy Anyt...
Continues Integration and Continuous Delivery with Azure DevOps - Deploy Anyt...Continues Integration and Continuous Delivery with Azure DevOps - Deploy Anyt...
Continues Integration and Continuous Delivery with Azure DevOps - Deploy Anyt...
Janusz Nowak
 
CD using ArgoCD(KnolX).pdf
CD using ArgoCD(KnolX).pdfCD using ArgoCD(KnolX).pdf
CD using ArgoCD(KnolX).pdf
Knoldus Inc.
 
Free GitOps Workshop + Intro to Kubernetes & GitOps
Free GitOps Workshop + Intro to Kubernetes & GitOpsFree GitOps Workshop + Intro to Kubernetes & GitOps
Free GitOps Workshop + Intro to Kubernetes & GitOps
Weaveworks
 
GitOps: Git come unica fonte di verità per applicazioni e infrastruttura
GitOps: Git come unica fonte di verità per applicazioni e infrastrutturaGitOps: Git come unica fonte di verità per applicazioni e infrastruttura
GitOps: Git come unica fonte di verità per applicazioni e infrastruttura
sparkfabrik
 
The Power of GitOps with Flux & GitOps Toolkit
The Power of GitOps with Flux & GitOps ToolkitThe Power of GitOps with Flux & GitOps Toolkit
The Power of GitOps with Flux & GitOps Toolkit
Weaveworks
 
Delivering Quality at Speed with GitOps
Delivering Quality at Speed with GitOpsDelivering Quality at Speed with GitOps
Delivering Quality at Speed with GitOps
Weaveworks
 
Introduction to Kubernetes Workshop
Introduction to Kubernetes WorkshopIntroduction to Kubernetes Workshop
Introduction to Kubernetes Workshop
Bob Killen
 
GitOps is the best modern practice for CD with Kubernetes
GitOps is the best modern practice for CD with KubernetesGitOps is the best modern practice for CD with Kubernetes
GitOps is the best modern practice for CD with Kubernetes
Volodymyr Shynkar
 
Modern CI/CD Pipeline Using Azure DevOps
Modern CI/CD Pipeline Using Azure DevOpsModern CI/CD Pipeline Using Azure DevOps
Modern CI/CD Pipeline Using Azure DevOps
GlobalLogic Ukraine
 
Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17
Ryan Jarvinen
 
Intro to Helm for Kubernetes
Intro to Helm for KubernetesIntro to Helm for Kubernetes
Intro to Helm for Kubernetes
Carlos E. Salazar
 
Docker introduction & benefits
Docker introduction & benefitsDocker introduction & benefits
Docker introduction & benefits
Amit Manwade
 
GitOps for Helm Users by Scott Rigby
GitOps for Helm Users by Scott RigbyGitOps for Helm Users by Scott Rigby
GitOps for Helm Users by Scott Rigby
Weaveworks
 

Similar to The journey to GitOps (20)

Gerrit linuxtag2011
Gerrit linuxtag2011Gerrit linuxtag2011
Gerrit linuxtag2011
thkoch
 
빈스톡 첫인상 with Git
빈스톡 첫인상 with Git빈스톡 첫인상 with Git
빈스톡 첫인상 with Git
AWSKRUG - AWS한국사용자모임
 
Take the next step with git
Take the next step with gitTake the next step with git
Take the next step with git
Karin Taliga
 
Git Tutorial
Git Tutorial Git Tutorial
Git Tutorial
Ahmed Taha
 
Version Control Systems -- Git -- Part I
Version Control Systems -- Git -- Part IVersion Control Systems -- Git -- Part I
Version Control Systems -- Git -- Part I
Sergey Aganezov
 
Introduction to git and Github
Introduction to git and GithubIntroduction to git and Github
Introduction to git and Github
Wycliff1
 
Backstage Software Templates for Java Developers
Backstage Software Templates for Java DevelopersBackstage Software Templates for Java Developers
Backstage Software Templates for Java Developers
Markus Eisele
 
GitOps & the deployment branching models - DevOps D-day Marseille 2021
GitOps & the deployment branching models - DevOps D-day Marseille 2021GitOps & the deployment branching models - DevOps D-day Marseille 2021
GitOps & the deployment branching models - DevOps D-day Marseille 2021
SoKube
 
Git best practices 2016
Git best practices 2016Git best practices 2016
Git best practices 2016
Otto Kekäläinen
 
GitOps with Flux - IPC Munich 2022
GitOps with Flux - IPC Munich 2022GitOps with Flux - IPC Munich 2022
GitOps with Flux - IPC Munich 2022
Robert Lemke
 
XebiCon'18 - Passage à l'échelle de mes applications Kafka-Streams
XebiCon'18 - Passage à l'échelle de mes applications Kafka-StreamsXebiCon'18 - Passage à l'échelle de mes applications Kafka-Streams
XebiCon'18 - Passage à l'échelle de mes applications Kafka-Streams
Publicis Sapient Engineering
 
Git for developers
Git for developersGit for developers
Git for developers
Hacen Dadda
 
Mini-training: Let’s Git It!
Mini-training: Let’s Git It!Mini-training: Let’s Git It!
Mini-training: Let’s Git It!
Betclic Everest Group Tech Team
 
Hackaton for health 2015 - Sharing the Code we Make
Hackaton for health 2015 - Sharing the Code we MakeHackaton for health 2015 - Sharing the Code we Make
Hackaton for health 2015 - Sharing the Code we Make
esben1962
 
BLUG 2012 Version Control for Notes Developers
BLUG 2012 Version Control for Notes DevelopersBLUG 2012 Version Control for Notes Developers
BLUG 2012 Version Control for Notes Developers
Martin Jinoch
 
1-Intro to VC & GIT PDF.pptx
1-Intro to VC & GIT PDF.pptx1-Intro to VC & GIT PDF.pptx
1-Intro to VC & GIT PDF.pptx
HuthaifaAlmaqrami1
 
git github PPT_GDSCIIITK.pptx
git github PPT_GDSCIIITK.pptxgit github PPT_GDSCIIITK.pptx
git github PPT_GDSCIIITK.pptx
AbelPhilipJoseph
 
391Lecture0909 Vision control of git.ppt
391Lecture0909 Vision control of git.ppt391Lecture0909 Vision control of git.ppt
391Lecture0909 Vision control of git.ppt
GevitaChinnaiah
 
Git essential training & sharing self
Git essential training & sharing selfGit essential training & sharing self
Git essential training & sharing self
Chen-Tien Tsai
 
A GitOps model for High Availability and Disaster Recovery on EKS
A GitOps model for High Availability and Disaster Recovery on EKSA GitOps model for High Availability and Disaster Recovery on EKS
A GitOps model for High Availability and Disaster Recovery on EKS
Weaveworks
 
Gerrit linuxtag2011
Gerrit linuxtag2011Gerrit linuxtag2011
Gerrit linuxtag2011
thkoch
 
Take the next step with git
Take the next step with gitTake the next step with git
Take the next step with git
Karin Taliga
 
Version Control Systems -- Git -- Part I
Version Control Systems -- Git -- Part IVersion Control Systems -- Git -- Part I
Version Control Systems -- Git -- Part I
Sergey Aganezov
 
Introduction to git and Github
Introduction to git and GithubIntroduction to git and Github
Introduction to git and Github
Wycliff1
 
Backstage Software Templates for Java Developers
Backstage Software Templates for Java DevelopersBackstage Software Templates for Java Developers
Backstage Software Templates for Java Developers
Markus Eisele
 
GitOps & the deployment branching models - DevOps D-day Marseille 2021
GitOps & the deployment branching models - DevOps D-day Marseille 2021GitOps & the deployment branching models - DevOps D-day Marseille 2021
GitOps & the deployment branching models - DevOps D-day Marseille 2021
SoKube
 
GitOps with Flux - IPC Munich 2022
GitOps with Flux - IPC Munich 2022GitOps with Flux - IPC Munich 2022
GitOps with Flux - IPC Munich 2022
Robert Lemke
 
XebiCon'18 - Passage à l'échelle de mes applications Kafka-Streams
XebiCon'18 - Passage à l'échelle de mes applications Kafka-StreamsXebiCon'18 - Passage à l'échelle de mes applications Kafka-Streams
XebiCon'18 - Passage à l'échelle de mes applications Kafka-Streams
Publicis Sapient Engineering
 
Git for developers
Git for developersGit for developers
Git for developers
Hacen Dadda
 
Hackaton for health 2015 - Sharing the Code we Make
Hackaton for health 2015 - Sharing the Code we MakeHackaton for health 2015 - Sharing the Code we Make
Hackaton for health 2015 - Sharing the Code we Make
esben1962
 
BLUG 2012 Version Control for Notes Developers
BLUG 2012 Version Control for Notes DevelopersBLUG 2012 Version Control for Notes Developers
BLUG 2012 Version Control for Notes Developers
Martin Jinoch
 
git github PPT_GDSCIIITK.pptx
git github PPT_GDSCIIITK.pptxgit github PPT_GDSCIIITK.pptx
git github PPT_GDSCIIITK.pptx
AbelPhilipJoseph
 
391Lecture0909 Vision control of git.ppt
391Lecture0909 Vision control of git.ppt391Lecture0909 Vision control of git.ppt
391Lecture0909 Vision control of git.ppt
GevitaChinnaiah
 
Git essential training & sharing self
Git essential training & sharing selfGit essential training & sharing self
Git essential training & sharing self
Chen-Tien Tsai
 
A GitOps model for High Availability and Disaster Recovery on EKS
A GitOps model for High Availability and Disaster Recovery on EKSA GitOps model for High Availability and Disaster Recovery on EKS
A GitOps model for High Availability and Disaster Recovery on EKS
Weaveworks
 
Ad

Recently uploaded (20)

Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Ad

The journey to GitOps

  • 1. if It hurts, do it more frequently
  • 2. Nicola Baldi naighes the journey to git-ops how to automate much of the process of K8S releases and deployments by using git as a source of truth [email protected] https://github.com/naighes @nicolabaldi
  • 3. development "on time, on budget, ..." "best engineering practices" in place a sad story
  • 4. development "on time, on budget, ..." "best engineering practices" in place it never went into production actually :-( a sad story
  • 5. • Can I exactly reproduce any of my environments, including the version of the operating system, its patch level, the network configuration, the software stack, the applications deployed into it, and their configuration? • Can I easily make an incremental change to any of these individual items and deploy the change to any, and all, of my environments?
  • 6. • Can I exactly reproduce any of my environments, including the version of the operating system, its patch level, the network configuration, the software stack, the applications deployed into it, and their configuration? • Can I easily make an incremental change to any of these individual items and deploy the change to any, and all, of my environments? • Can I easily see each change that occurred to a particular environment and trace it back to see exactly what the change was, who made it, and when they made it?
  • 7. canonical CI/CD pipeline push trigger SCM build/test/lint/... package push deploy apply cloneCI
  • 8. deployments break and it's not clear that a code change was responsible config changes are also hard to track enough of tons of bash! fallacies
  • 9. keep absolutely everything in version control one reason that we use the term version control in preference to source control is that version control isn't just for source code; every single artifact related to the creation of your software should be under version control
  • 11. brings a set of opinionated and prescriptive practices about applying git-based workflows, devops and infrastructure as code in the context of kubernetes git-ops
  • 13. git clone –mirror # HEAD revision git rev-list --max-count 1 heads/{branch} # current revision (flux-sync is a git tag acting # as a pointer) git rev-list --max-count 1 flux-sync -- # retrieve changeset changeset = repo.CommitsBetween(currentRev, headRev) # load all manifests by walking the file system # searching for resources (file content is inspected) manifests = kresource.Load(baseDir) # takes a definition of what should be running in # the cluster and attempts to make the cluster conform clus.Sync(manifests) # retrieve all cluster resources clustRes = c.getAllowedResourcesBySelector() # for each resource, verify it exists into the # cluster and put the change into a stage buffer # (enrich with a couple of annotations (e.g. GC stuff) resBytes = applyMetadata(clustRes) kubectl apply # Move the revision the sync state points to ratchet.Update(currentRev, headRev) git sync
  • 14. git fetch origin refs/notes/flux:refs/notes/flux From https://github.com/naighes/flux-get-started * [new ref] refs/notes/flux -> refs/notes/flux git notes --ref refs/notes/flux 1c060a70c46b7dd2d87451ce493afe2b0be76cd7 293baf09d3acec58492b69c9284879a77dc9d17d ac01f9f47d8d724e33998388ff7153532d971aa2 40f78619092b43c4cf192795f54d87d6c7fb1869 git notes --ref refs/notes/flux show 293baf09d3acec58492b69c9284879a77dc9d17d { "jobID": "f1f49e8f-fb27-0a06-2a72-7ba7685dc641", "spec": { "type": "auto", "spec": { "Changes": [{ "WorkloadID": "demo:deployment/podinfo", "Container": { "Name": "podinfod", "Image": "stefanprodan/podinfo:2.1.0" }, "ImageID": "stefanprodan/podinfo:2.1.3" } ] } }, "result": { "demo:deployment/podinfo": { "Status": "success", "PerContainer": [{ "Container": "podinfod", "Current": "stefanprodan/podinfo:2.1.0", "Target": "stefanprodan/podinfo:2.1.3" } ] } } } git notes as events
  • 15. automatic releases apiVersion: apps/v1 kind: Deployment metadata: annotations: fluxcd.io/automated: "true" fluxcd.io/tag.init: regex:^2.1.* with the fluxcd.io annotations we instruct flux to automate this release when a new tag with the MAJOR=2 and MINOR=1 is pushed to the docker registry, flux will update the image field in the yaml file, will commit and push the change to git and finally will apply the change on the cluster
  • 16. a new tag is pushed
  • 17. ├── charts │ └── podinfo │ ├── Chart.yaml │ ├── README.md │ ├── templates │ └── values.yaml ├── namespaces │ ├── dev.yaml │ └── stg.yaml └── releases ├── dev │ └── podinfo.yaml └── stg └── podinfo.yaml apiVersion: flux.weave.works/v1beta1 kind: HelmRelease metadata: name: podinfo-dev namespace: dev labels: chart: podinfo annotations: flux.weave.works/automated: "true" flux.weave.works/tag.chart-image: glob:dev-* spec: releaseName: podinfo-dev chart: git: [email protected]:stefanprodan/gitops-helm path: charts/podinfo ref: master values: image: stefanprodan/podinfo:dev-kb9lm91e replicaCount: 1 helm operator
  • 18. --sync-state // GitTagStateMode is a mode of state management where Flux // uses a git tag for managing Flux state GitTagStateMode = "git" // NativeStateMode is a mode of state management where Flux use // native Kubernetes resources for managing Flux state NativeStateMode = "secret" Default is GitTagStateMode (and it does not work in --git-readonly mode) In this case a --git-sync-tag acts like a pointer for the revision flux is positioned at state management
  • 19. apply all the manifests in the git repo and give each resource a label marking it as having been synced from this source ask the cluster for all the resources marked as being from this source and delete those that were not applied in previous step be careful when git URL or branch are changed, path is added and path is removed (NOTE: it's "conservative") garbage collection apiVersion: apps/v1 kind: Deployment metadata: annotations: fluxcd.io/automated: "true" fluxcd.io/sync-checksum: f388cbf998956871ac7b070a285dae684c250ca8 fluxcd.io/tag.init: regex:^2.1.* --sync-garbage-collection (default is false)