Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/goseind/tf-flux
- Owner: goseind
- Created: 2023-03-21T11:30:07.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-03-21T15:57:52.000Z (almost 2 years ago)
- Last Synced: 2024-04-13T15:33:18.347Z (9 months ago)
- Topics: cicd, flux, gitops, terraform
- Language: HCL
- Homepage: https://gosein.de/terraform-maintain-flux.html
- Size: 41 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.