Difference between revisions of "Kubernetes/Progressive Delivery Flux and Flagger"

From Ever changing code
Jump to navigation Jump to search
Line 52: Line 52:
*[https://github.com/pio2pio/gitops-istio gitops-istio] Tutorial
*[https://github.com/pio2pio/gitops-istio gitops-istio] Tutorial
*[https://www.youtube.com/watch?v=nGLpUCPX8JE Flux v2 Everything that you wanted to know but were afraid to ask (Stefan Prodan)] December 2020
*[https://www.youtube.com/watch?v=nGLpUCPX8JE Flux v2 Everything that you wanted to know but were afraid to ask (Stefan Prodan)] December 2020


Bundle
Bundle
*[https://blog.sldk.de/2021/02/introduction-to-gitops-on-kubernetes-with-flux-v2/ Introduction to GitOps on Kubernetes with Flux v2]
*[https://blog.sldk.de/2021/02/introduction-to-gitops-on-kubernetes-with-flux-v2/ Introduction to GitOps on Kubernetes with Flux v2]
*[https://blog.sldk.de/2021/03/handling-secrets-in-flux-v2-repositories-with-sops/ Handling secrets in Flux v2 repositories with SOPS]
*[https://blog.sldk.de/2021/03/handling-secrets-in-flux-v2-repositories-with-sops/ Handling secrets in Flux v2 repositories with SOPS]

Revision as of 23:06, 16 January 2022

Flux v2

Flux v2 architecture

ClipCapIt-210524-232835.PNG

Flux v2 - Webhooks and notifications

ClipCapIt-210524-233028.PNG


Docs:

Install Flux v2 flux command line


Note: fluxctl is a previous version Flux v1 command line tool.

curl -s https://fluxcd.io/install.sh | sudo bash

# enable completions in ~/.bash_profile
. <(flux completion bash)

# TODO: Via release binaries
# https://github.com/fluxcd/flux/releases

# Pre check
flux check --pre
► checking prerequisites
✗ flux 0.25.1 <0.25.2 (new version is available, please upgrade)
✔ Kubernetes 1.21.5-gke.1302 >=1.19.0-0
✔ prerequisites checks passed

# Docker images
docker pull fluxcd/fluxctl:1.24.3
docker pull ghcr.io/fluxcd/flux-cli:1.24.3 # does not work

Cluster bootstrap

FLUX_GIT_USERNAME=my-git-username
FLUX_GIT_EMAIL=my-git-email@example.com
flux bootstrap git \
  --author-email=$FLUX_GIT_EMAIL \
  --url=ssh://git@github.com/$FLUX_GIT_USERNAME/gitops-istio \
  --branch=main \
  --path=clusters/my-cluster

At bootstrap, Flux generates an SSH key and prints the public key. In order to sync your cluster state with git you need to copy the public key and create a deploy key with write access on your GitHub repository. On GitHub go to Settings > Deploy keys click on Add deploy key, check Allow write access, paste the Flux public key and click Add key.

References


Bundle