diff --git a/config/terraform/main.tf b/config/terraform/main.tf index db950d2..12e8509 100644 --- a/config/terraform/main.tf +++ b/config/terraform/main.tf @@ -27,7 +27,7 @@ resource "kubernetes_namespace" "flux_system" { // Create a Kubernetes secret with the Git credentials // if a Git token is provided. resource "kubernetes_secret" "git_auth" { - count = var.git_token != "" ? 1 : 0 + count = var.git_token != "" ? 1 : 0 depends_on = [kubernetes_namespace.flux_system] metadata { @@ -63,7 +63,7 @@ resource "helm_release" "flux_instance" { repository = "oci://ghcr.io/controlplaneio-fluxcd/charts" chart = "flux-instance" - // Configure the Flux components and automated upgrades. + // Configure the Flux distribution. set { name = "instance.distribution.version" value = var.flux_version @@ -72,6 +72,8 @@ resource "helm_release" "flux_instance" { name = "instance.distribution.registry" value = var.flux_registry } + + // Configure the Flux components. set_list { name = "instance.components" value = [ @@ -84,6 +86,11 @@ resource "helm_release" "flux_instance" { ] } + // Customise the Flux components. + values = [ + file("resources/kustomize-patches.yaml") + ] + // Configure Flux Git sync. set { name = "instance.sync.kind" @@ -106,4 +113,3 @@ resource "helm_release" "flux_instance" { value = var.git_token != "" ? "flux-system" : "" } } - diff --git a/config/terraform/resources/kustomize-patches.yaml b/config/terraform/resources/kustomize-patches.yaml new file mode 100644 index 0000000..fb761a3 --- /dev/null +++ b/config/terraform/resources/kustomize-patches.yaml @@ -0,0 +1,13 @@ +instance: + kustomize: + patches: + - target: + kind: Deployment + name: "(kustomize-controller|helm-controller)" + patch: | + - op: add + path: /spec/template/spec/containers/0/args/- + value: --concurrent=10 + - op: add + path: /spec/template/spec/containers/0/args/- + value: --requeue-dependency=10s