Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/goseind/tf-flux

Using Terraform to Maintain Flux
https://github.com/goseind/tf-flux

cicd flux gitops terraform

Last synced: 14 days ago
JSON representation

Using Terraform to Maintain Flux

Awesome Lists containing this project

README

        

# Using Terraform to Maintain Flux

This repo showcases the usage of the [terraform fluxcd provider](https://registry.terraform.io/providers/fluxcd/flux/latest). **Please see my [blog post](https://gosein.de/terraform-maintain-flux.html) for more details.**

You can use this repo as a template to get started, what you'll need is a K8s cluster (with the `config` saved in the default `.kube` directory), a GitHub repo, and a token with repo access.

## TL;TR

Replace the variable values in the `terraform apply` command below, then copy and paste this into your terminal:

```bash
git clone https://github.com/goseind/tf-flux
cd tf
terraform init
terraform apply -var github_org="" -var github_repository="" -var github_token=""
mkdir ../flux/cluster
cp ../test/test-manifest.yaml ../flux/cluster/test-manifest.yaml
git add test-manifest.yaml
git commit -m 'apply test manifest to cluster'
git push
```

After this, all new files in `flux/cluster` will be synced with Flux, while the Flux installation itself is maintained by Terraform.