Skip to content

Test environment for running flux on a local k3d Kubernetes cluster

License

Notifications You must be signed in to change notification settings

brooke-hamilton/flux-k3d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flux-k3d test environment

This repo contains a dev container configured to run Flux on a local k3d Kubernetes cluster.

Prerequisites

  • A personal GitHub account where you can create repos.
  • A host machine that can run a dev container.
  • The host machine has git and the GitHub CLI installed.

Contents of the dev container

  • Flux
  • k3d
  • Radius
  • Dapr
  • GitHub CLI (The host machine configuration GH CLI configuration is mounted in the container.)

Step-by-step

  1. From the host machine, verify the prerequisites and launch the dev container. The rest of the steps are done within the dev container.
  2. From a terminal window in the dev container, run bootstrap.sh.

Details

bootstrap.sh will run this set of scripts below for you. They can be run independently as well. bootstrap.sh can be run over and over to reset and recreate the environment.

  1. ./scripts/reset_flux.sh: Deletes any k3d clusters currently running in the dev container.
  2. ./scripts/create_gh_repos.sh: Creates two GitHub repos in your personal GitHub account unless they already exist
  3. ./scripts/new_flux_cluster.sh: Creates a new k3d cluster with Flux installed.
  4. ./scripts/bootstrap_flux_cluster.sh: Bootstraps a Flux configuration on the platform admin GitHub repo and configures it to pull from the tenant repo.

The script finishes by running the flux get kustomizations -w command, which will interactively display the output of the Flux operations. This command can be cancelled without affecting the Flux deployment. While this command is running, you can open another terminal window in the dev container to watch the pods being created: kubectl get pods -A -w.

Run .\scripts\reset_flux.sh to delete the local k3d Kubernetes cluster and remove the Flux configuration files from the remote repo. (This script will is also run by bootstrap.sh.)

Note: The .gitignore file in this repo excludes the repos folder because that is where the scripts will perform local git operations on remote GitHub repos.

About

Test environment for running flux on a local k3d Kubernetes cluster

Topics

Resources

License

Stars

Watchers

Forks

Languages