The example demonstrates how to create Preview Environments based on Pull Request event with Flux Operator and Ephemeral Environments.
Note: The GitHub repository* is created and auto initialised ready for Flux stack, Flux Operator and Discord notifications to use.
*Creating a fine-gained PAT and dedicated Flux user recommend, for more information see here
bash ./codespace.sh ### Before run it, check which terminal you are using and review comment inside of file (part: install K9S) to avoid errors
kubectl apply -f gatewayapi
kubectl apply -f preview
flux -n app-preview create secret git github-auth \
--url=https://github.com/org/app \
--username=flux \
--password=${GITHUB_TOKEN}
cd bootstrap
tofu destroy
Name | Version |
---|---|
terraform | >= 1.7.0 |
flux | >= 1.2 |
github | >= 6.1 |
kind | >= 0.4 |
Name | Version |
---|---|
flux | >= 1.2 |
github | >= 6.1 |
kind | >= 0.4 |
Name | Type |
---|---|
flux_bootstrap_git.this | resource |
github_repository.this | resource |
kind_cluster.this | resource |
Name | Description | Type | Default | Required |
---|---|---|---|---|
github_org | GitHub organization | string |
"" |
no |
github_repository | GitHub repository | string |
"" |
no |
github_token | GitHub token | string |
"" |
no |