diff --git a/content/en/flux/installation/configuration/vertical-scaling.md b/content/en/flux/installation/configuration/vertical-scaling.md index 868bdc01f..f8fa48849 100644 --- a/content/en/flux/installation/configuration/vertical-scaling.md +++ b/content/en/flux/installation/configuration/vertical-scaling.md @@ -9,6 +9,7 @@ When Flux is managing hundreds of applications that are deployed multiple times can fine tune the Flux controller at [bootstrap time](boostrap-customization.md) to run at scale by: - [Increasing the number of workers and resource limits](#increase-the-number-of-workers-and-limits) +- [Enabling in-memory kustomize builds](#enable-in-memory-kustomize-builds) - [Enabling Helm repository caching to reduce memory usage](#enable-helm-repositories-caching) - [Enabling persistent storage for internal artifacts](#persistent-storage-for-flux-internal-artifacts) - [Running the Flux controllers on dedicated nodes](#node-affinity-and-tolerations) @@ -33,7 +34,7 @@ patches: - patch: | - op: add path: /spec/template/spec/containers/0/args/- - value: --concurrent=20 + value: --concurrent=10 - op: add path: /spec/template/spec/containers/0/args/- value: --requeue-dependency=5s @@ -59,6 +60,39 @@ patches: name: "(kustomize-controller|helm-controller|source-controller)" ``` +## Enable in-memory kustomize builds + +To speed up the Flux kustomize build operations, it is advised to use tmpfs for the `/tmp` filesystem: + +```yaml +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - gotk-components.yaml + - gotk-sync.yaml +patches: + - patch: | + - op: add + path: /spec/template/spec/containers/0/args/- + value: --concurrent=20 + - op: replace + path: /spec/template/spec/volumes/0 + value: + name: temp + emptyDir: + medium: Memory + target: + kind: Deployment + name: kustomize-controller +``` + +{{% alert color="info" title="“I/O Device Contention" %}} +Note that increase the number of reconciliations for kustomize-controller, without using a +RAM-backed filesystem, may not have the desired effect due to IO contention +on the Kubernetes node disk. +{{% /alert %}} + + ## Enable Helm repositories caching If Flux connects to Helm repositories hosting hundreds of Helm charts, @@ -90,7 +124,6 @@ When `helm-cache-max-size` is reached, an error is logged and the index is inste read from file. Cache hits are exposed via the `gotk_cache_events_total` Prometheus metrics. Use this data to fine-tune the configuration flags. - ## Persistent storage for Flux internal artifacts Flux maintains a local cache of artifacts acquired from external sources.