Tips for Structuring Projects with Kustomize, Helm, and ArgoCD

0
0
Asked By TechWhiz42 On

Hey folks, I'm relatively new to using Helm alongside Kustomize and ArgoCD, and I'm tackling a project with more complex applications. We have a WordPress-based web app that comes in various versions, like brand-a through brand-d. Each version has similar needs, such as: a Percona XtraDB Cluster and a valkey cluster, both hosted in Kubernetes and deployed via Helm and manifests, respectively, plus an SSH server for SFTP uploads. The application itself is also deployed using a Helm Chart from a private repo.

Each site will have its own namespace (e.g., brand-a), and we avoid using prefixes since they're separate clusters. For development, I use kind with both staging and production clusters, each running its own ArgoCD instance.

While I can deploy the app manually without issue, I'm really struggling to set up the project in a declarative way using Kustomize and manage it through ArgoCD effectively. Every component of the application needs to be deployed for each site, which means I have shared settings, cluster-specific values, and site-specific patches.

Ideally, I want to kick things off with Kustomize, then let ArgoCD handle the deployment of the whole stack, minimizing repetition as much as possible. I've made some progress using Kustomize with Helm charts and merging values from base and overlay files, but I haven't figured out how to set a Helm chart at the base level and just change the version in the overlay. How do you all suggest handling setups like this?

1 Answer

Answered By DevGuru99 On

It sounds like you might be hitting the limitations of Kustomize's Helm integration. Kustomize creates a set of YAML manifests from the base, and the overlay only modifies what's produced, so it doesn’t really allow for tweaking Helm chart versions or values directly from your overlays.
But considering ArgoCD, maybe focusing on Helm with ApplicationSet or multi-source Applications could be a solution. It might simplify your deployment pattern!

CodeMaster23 -

You can reference multiple values files in Kustomize. I've done something similar where I have a base values file and overlay files to customize for specific environments. It’s a bit clunky, but here’s how you can do it:

```
helmCharts:
- name: your-app
valuesFile: ../base/values.yml
additionalValuesFiles:
- values-overwrite.yml
```
Just remember to run Kustomize with `--load-restrictor=LoadRestrictionsNone`!

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.