Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Overview

Image Added

Install Flux

See https://fluxcd.io/docs/installation/#install-the-flux-cli

...

Code Block
$ curl -s https://fluxcd.io/install.sh | sudo bash
or 
$ curl -s https://fluxcd.io/install.sh | bash


Generate a User Token in GitHub

...

Code Block
languagebash
$ flux bootstrap github --owner=$GITHUB_USER --repository=<REPO_NAME> --branch=main --path=<CLUSTER_NAME> --personal

# example
$ flux bootstrap github --owner=$GITHUB_USER --repository=ft --branch=main --path=local --personal


With Gitlab 

Code Block
$ flux bootstrap gitlab --owner=<GROUP> --repository=<REPO_NAME> --path=<PATH> --token-auth --hostname=<HOST> --branch=<BRANCH>

#example
$ flux bootstrap gitlab --owner=MyGroup --repository=deploy_repo --path=cluster/lab --token-auth --hostname=gitlab1.company.com --branch=master



Git Clone New Repo

Code Block
languagebash
$ git clone git@github.com:johnmehan/ft.git
$ cd ft
$ cd local 

...

Code Block
flux reconcile ks flux-system --with-source


Helpfull Commands


CommandDescription
flux uninstallRemove flux installation

flux get helmreleases

flux get hr

List the helmreleases
flux reconcile ks flux-system --with-sourceForce a reconcile
flux get sources helmView Helm Sources




kubectl describe helmrelease <HR_NAME> -n flux-systemGet details of a helm release. 
kubectl logs -f -n flux-system deployment/source-controllerSee logs for source-controller


Debugging a Failed Helm Release

...

Code Block
languagebash
# get list of helmreleases
$ flux get hr -A

# get details about the helmrelease
$ kubectl describe helmrelease <HR_NAME> -n flux-system

# See logs in source controller
$ kubectl logs -f -n flux-system deployment/source-controller


Force a reconcile

Code Block
flux reconcile ks flux-system --with-source


Delete a helm release and reconcile

Code Block
kubectl -n fluxsystem delete hr <HR_NAME>
flux reconcile ks flux-system --with-source



References

ReferencesURL
Flux2 Docshttps://fluxcd.io/docs/
Supercharge your Kubernetes deployments with Flux v2 and GitHub - Introductionhttps://www.youtube.com/watch?v=N6UCKF7JD7k
Get Started with Fluxhttps://fluxcd.io/docs/get-started/
Install the Flux CLIhttps://fluxcd.io/docs/installation/#install-the-flux-cli
flux2-kustomize-helm-examplehttps://github.com/fluxcd/flux2-kustomize-helm-example