Slide 1

Slide 1 text

GitOps on AWS: Codifying Multi-cloud Operations

Slide 2

Slide 2 text

Mahmoud Saada Customer Reliability Engineer @saadazzz @saada

Slide 3

Slide 3 text

● Roles: SE, TL, SRE, CRE ● Startups and Enterprises ● Industries: HR, AI, Fin-tech, Infrastructure ● Companies: TargetCW, ADP, Agolo, Weaveworks ● Meetups: Docker NYC, Uber Tracing NYC ● Open Source: grafana, prometheus, terraform, helm, helm operator, eksctl, elasticsearch, … ● Certified Kubernetes Administrator Background

Slide 4

Slide 4 text

● Gitops ● Operator pattern ● Cluster Management ● Demo ● Q&A Agenda

Slide 5

Slide 5 text

● Gitops ● Operator pattern ● Cluster Management ● Demo ● Q&A Agenda

Slide 6

Slide 6 text

Definition

Slide 7

Slide 7 text

GitOps is the practice of using Git to declaratively define desired state and Continuous Delivery agents (Flux) to automate the reconciliation of current state to desired/intended state; effectively decoupling CI and CD GitOps Definition

Slide 8

Slide 8 text

Weaveworks’s Gitops Tools ● Flux is an async-pull continuous delivery agent that runs as a controller inside its target Kubernetes cluster. Flux pulls git changes and converges them with a Kubernetes state. It was created at Weaveworks. ● Helm Operator is a Kubernetes operator that watches for a CRD called HelmRelease and renders it into k8s resources

Slide 9

Slide 9 text

Weaveworks: The GitOps Company Weaveworks created the GitOps methodology and tooling to solve our own Kubernetes management, scalability, and reliability requirements Weaveworks is a key partner with all the major infrastructure and Kubernetes vendors Weaveworks is deeply committed to the Open Source Community Weaveworks is backed by solid investors

Slide 10

Slide 10 text

1 The entire system is described declaratively 2 The canonical desired system state is versioned (with Git) 3 Approved changes to the desired state are automatically applied to the system 4 Software agents ensure correctness and alert on divergence GitOps Principles 10

Slide 11

Slide 11 text

GitOps – An Operating Model for Cloud Native Deployment (clusters, apps) Monitoring Logging (Observability) Management (operations) Build GIT Test IDE Unifying Deployment, Monitoring and Management. Git as the single source of truth of a system’s desired state ALL intended operations are committed by pull request ALL diffs between intended and observed state with automatic convergence ALL changes are observable, verifiable, and auditable “Immutability Firewall” Kubernetes GitOps Continuous Integration

Slide 12

Slide 12 text

Development Experience -

Slide 13

Slide 13 text

GitOps Patterns

Slide 14

Slide 14 text

One git path/directory per namespace Namespace Strategy /namespaces ./team1 ./team2 ./team3 Team1 namespace Team2 namespace Team3 namespace

Slide 15

Slide 15 text

One git path/directory per environment Directory Path Strategy /env ./develop ./staging ./production Develop cluster staging cluster Production cluster

Slide 16

Slide 16 text

One branch per environment Branching Strategy develop staging production Develop cluster staging cluster Production cluster

Slide 17

Slide 17 text

One git path/directory per environment, one subdirectory per namespace Mixing Strategies together /env ./develop ././team1 ././team2 ./staging ././team1 ././team2 ./production ././team1 ././team2 Develop cluster broken down by namespace Staging cluster broken down by namespace Production cluster broken down by namespace

Slide 18

Slide 18 text

Benefits

Slide 19

Slide 19 text

● Increased productivity ● Enhanced developer experience ● Improved stability ● Higher reliability ● Consistency and standardization ● Stronger security guarantees Benefits of adopting GitOps

Slide 20

Slide 20 text

Common Concerns

Slide 21

Slide 21 text

● Not designed for programmatic updates → feature branches + test environments ● Proliferation of Git repositories → Consolidate gitops repos + GoTK ● Lack of visibility → commit messages, flux logs, GoTK grafana dashboard ● Doesn’t solve centralized secret management → Sealed Secrets, Hashicorp Vault, AWS SecretsManager ● Auditing isn’t as great as it sounds like → commit messages, flux logs, GoTK grafana dashboard ● Lack of input validation → CI linting Common Concerns

Slide 22

Slide 22 text

● Gitops ● Operator pattern ● Cluster Management ● Demo ● Q&A Agenda

Slide 23

Slide 23 text

The Operator Pattern Current State Watch Desired State Reconcile Controller

Slide 24

Slide 24 text

Current State Watch Desired State Reconcile Controller Current State (etcd) Watch Desired State (etcd) Reconcile K8S Current State (git) Watch Desired State (etcd) Reconcile GitOps Controllers Everywhere

Slide 25

Slide 25 text

Reconciliation Loops Current State Desired State

Slide 26

Slide 26 text

● Gitops ● Operator pattern ● Cluster Management ● Demo ● Q&A Agenda

Slide 27

Slide 27 text

Helm Operator Custom Operator WKP / ClusterAPI state

Slide 28

Slide 28 text

➔ Kubernetes application platform ➔ Management of cluster and applications ➔ Builds on GitOps and adds enterprise features ➔ Define clusters and components using a model based system ➔ Deploy new clusters using those definitions: multiple back-ends ➔ Alerting and operations built-in Weave Kubernetes Platform

Slide 29

Slide 29 text

● Gitops ● Operator pattern ● Cluster Management ● Demo ● Q&A Agenda

Slide 30

Slide 30 text

eksctl create cluster

Slide 31

Slide 31 text

kind create cluster

Slide 32

Slide 32 text

Let’s see it in action EC2 (CAPI Managed) EC2 (CAPI Managed) Kind (on-prem Unmanaged) EKS (management cluster)

Slide 33

Slide 33 text

Demo

Slide 34

Slide 34 text

Gitops Workshops (Module 7) https://weaveworks-gitops.awsworkshop.io/ Do try this at home!

Slide 35

Slide 35 text

Future

Slide 36

Slide 36 text

Future ● Gitops Toolkit ○ FluxV2, Helm Controller, Kustomize Controller, Notifications, Prometheus metrics, Grafana dashboard, ... ○ Major release expected later this year ○ You can find documentation and quickstart examples here: https://toolkit.fluxcd.io ○ Helm Controller will be the successor for Helm Operator ○ Community-driven. If interested in getting involved, go to https://github.com/fluxcd/toolkit/discussions

Slide 37

Slide 37 text

● Gitops ● Operator pattern ● Cluster Management ● Demo ● Q&A Agenda

Slide 38

Slide 38 text

Questions?

Slide 39

Slide 39 text

Thank you! Demo repo: https://github.com/saada/gitops-cluster-management/ Workshop (Module 7): https://weaveworks-gitops.awsworkshop.io/ EKS Control: https://eksctl.io Flux: https://docs.fluxcd.io/ Helm Operator: https://docs.fluxcd.io/projects/helm-operator/ The Art of Modern Ops (podcast): https://bit.ly/weave-podcast FluxV2 (coming soon): https://toolkit.fluxcd.io/ Mahmoud Saada @saada @saadazzz weave-community.slack.com