DEV Community

Jeffrey Hicks
Jeffrey Hicks

Posted on • Edited on

GitOps Research

Kubernetes Deployments

Image description

GitOps vs DevOps

Image description

Flux Overview

  • Extends K8s with Custom Resources known as Controllers that watch Source Repositories and Auto-Reconcile

  • Provides GitOps for both Apps and Infra

  • Has CLI to:

    • Bootstrap cluster & repository
    • Add Git Sources
    • Configure Build and Apply
  • As K8's custom resource, it's fully declaratively configured using YAML encoded manifests, most of which are generated with the CLI.

Bootstrap a Cluster

brew install fluxcd/tap/flux
flux check --pre
export GITHUB_TOKEN=
export GITHUB_USER=
flux bootstrap github \
  --owner=$GITHUB_USER \
  --repository=my-infra \
  --branch=main \
  --path=app-cluster \
  --personal
Enter fullscreen mode Exit fullscreen mode

Add Source

  • Generates GitRepository Manifiest that you commit and push to the infrastructure repo created during bootstrap.

  • Use CLI to add GitRepository - Generates Manifest which you commit

Configure Build and Apply

Run Migrations with Pre-Deployment Jobs

Kustomization Manifests which are reconciled by Flux can be configured to depend on each other. This makes running pre-deployment jobs like a migration possible.

Connect to CI

  • Image Automation Controller

  • Image Reflector Controller

Image description

GitOps for Infrastructure outside K8s

  • Terraform Controller

Image description

  • Free and Open Source

Videos

Resources

Top comments (0)