Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stuttgart-things/flux2-cluster-bootstrap
terraform module for bootstrapping kubernetes clusters w/ flux2
https://github.com/stuttgart-things/flux2-cluster-bootstrap
flux gitops k8s kubernetes
Last synced: 1 day ago
JSON representation
terraform module for bootstrapping kubernetes clusters w/ flux2
- Host: GitHub
- URL: https://github.com/stuttgart-things/flux2-cluster-bootstrap
- Owner: stuttgart-things
- License: apache-2.0
- Created: 2024-01-01T18:00:41.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-11-21T00:48:30.000Z (about 1 month ago)
- Last Synced: 2024-11-21T01:30:31.876Z (about 1 month ago)
- Topics: flux, gitops, k8s, kubernetes
- Language: HCL
- Homepage:
- Size: 61.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# flux2-cluster-bootstrap
terraform module for bootstrapping kubernetes clusters w/ flux2## BOOTSTRAP CLUSTER W/ GITHUB
FLUX BOOSTRAP
```hcl
module "bootstrap-app1" {
source = "github.com/stuttgart-things/flux2-cluster-bootstrap"
kubeconfig_path = "/home/sthings/.kube/app1"
github_token = var.github_token
github_repository = "stuttgart-things"
github_org = "stuttgart-things"
target_path = "clusters/labul/pve/app1"
}variable "github_token" { type= string }
```FLUX BOOSTRAP + SECRET
```hcl
module "bootstrap-app1" {
source = "github.com/stuttgart-things/flux2-cluster-bootstrap"
kubeconfig_path = "/home/sthings/.kube/app1"
github_token = var.github_token
github_repository = "stuttgart-things"
github_org = "stuttgart-things"
target_path = "clusters/labul/pve/app1"
secrets = [
{
name = "sops-age"
namespace = "flux-system"
kvs = {
"age.agekey" = "AGE-SECRET-KEY"
}
},
]
}variable "github_token" { type= string }
```FLUX BOOSTRAP + ADDITIONAL MANIFESTS & KUSTOMIZATION PATCH
```hcl
module "bootstrap-app1" {
source = "github.com/stuttgart-things/flux2-cluster-bootstrap"
kubeconfig_path = "/home/sthings/.kube/app1"
github_token = var.github_token
github_repository = "stuttgart-things"
github_org = "stuttgart-things"
target_path = "clusters/labul/pve/app1"
additional_manifests = [
{
content = <<-EOT
---
apiVersion: v1
kind: ConfigMap
metadata:
name: ca-pemstore
namespace: flux-system
data:
labul-pve.crt: |-
-----BEGIN CERTIFICATE-----
EOT
},
]kustomization_patches = <<-EOT
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- gotk-components.yaml
- gotk-sync.yaml
patches:
- patch: |
- op: add
path: /spec/decryption
value:
provider: sops
secretRef:
name: sops-age
target:
kind: Kustomization
name: flux-system
- patch: |
- op: add
path: /spec/template/spec/volumes/-
value:
name: ca-pemstore
configMap:
name: ca-pemstore
target:
kind: Deployment
name: source-controller
EOT
}variable "github_token" { type= string }
```## EXECUTION
```bash
export TF_VAR_github_token=$GITHUB_TOKEN
terraform init
terraform plan
terraform apply
```## LICENSE
APACHE 2.0
Copyright 2023 patrick hermann.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.Author Information
------------------
Patrick Hermann, stuttgart-things 01/2024