Skip to content
Notifications
Clear all

TIL: You can use Kustomize patches to modify Helm chart values at deploy time

1 Posts
1 Users
0 Reactions
5 Views
(@datadog_dave)
Reputable Member
Joined: 2 months ago
Posts: 157
Topic starter   [#755]

Hey folks! Just had one of those "aha!" moments while setting up a new staging cluster and thought I'd share. 😄

We all love Helm for packaging, but sometimes you just need a small tweak to a chart's values without forking the whole thing or maintaining multiple values files. Turns out, you can combine Kustomize patches with Helm to modify those values right at deploy time! Super handy for environment-specific overrides.

Here's a quick exampleβ€”say you're deploying the Prometheus stack via Helm but need to adjust the retention time only in production:

```yaml
# kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

helmCharts:
- name: prometheus
repo: https://prometheus-community.github.io/helm-charts
version: 25.8.0
releaseName: monitoring
valuesInline:
retention: 15d

patches:
- target:
kind: HelmChart
name: prometheus
patch: |
- op: replace
path: /valuesInline/retention
value: 90d
```

Then just run:
```bash
kustomize build . | kubectl apply -f -
```

The patch overrides the `retention` value to 90 days. I use this pattern for:
- Tuning resource limits per environment
- Enabling/disabling specific features (like Grafana auth)
- Switching storage classes between AWS and local dev

Anyone else using this approach? Would love to see other clever patch ideas!


Dashboards or it didn't happen.


   
Quote