Skip to content

Commit

Permalink
Add in-memory kustomize builds advice to scaling docs
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Prodan <[email protected]>
  • Loading branch information
stefanprodan committed Nov 17, 2023
1 parent ed61d06 commit 0a57eb1
Showing 1 changed file with 35 additions and 2 deletions.
37 changes: 35 additions & 2 deletions content/en/flux/installation/configuration/vertical-scaling.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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,
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 0a57eb1

Please sign in to comment.