1

I'm trying to manage Argo CD projects with helm definitions using kustomize.

Unfortunately Argo manages helm values with string literals, which gives me headaches in conjunction with kustomize configuration.

I have this base/application.yml

apiVersion: argoproj.io/v1alpha1
kind: Application
  source:
    chart: something
    helm:
      values: |
        storageClass: cinder-csi
        ... many more lines identical to every stage

and I'd like to create variants using kustomize overlays, where I'd like to add a single line solely important for the dev stage to the base values.

This is NOT working, it simply replaces the existing base definiton.

overlay/dev/kustomize.yml

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

patchesJson6902:
- target:
    kind: Application
  patch: |-
    - op: add
      path: /source/helm/value
      value: "storageSize: 1Gi"

To me it seems kustomize can not append values to string literals. My current solution requires to repeat the whole values string literal in every stage variant, with just a few lines of difference, which heavily violates DRY principles.

Any help is appreciated.

schrom
  • 1,372
  • 1
  • 22
  • 36

2 Answers2

0

There's an open PR to add support for arbitrary YAML in the values field. If merged, I would expect it to be available in 2.4. Reviews/testing are appreciated if you have time!

One workaround is to use the parameters field and set parameters individually. It's not ideal, but maybe could help until 2.4 is released.

crenshaw-dev
  • 7,504
  • 3
  • 45
  • 81
  • That PR was closed, worked moved to another PR, which closed and moved to https://github.com/argoproj/argo-cd/pull/11538, which is still not merged and was just recently *removed* from argo 2.7 milestone. – Jon L. Mar 15 '23 at 15:08
  • @JonL. yep. It will happen, just a matter of review resources right now. – crenshaw-dev Mar 15 '23 at 20:34
0

For future reference, 3 days ago a PR was finally merged: https://github.com/argoproj/argo-cd/pull/11538

as of writing this, no release yet, but it's on master branch

Asaf Levy
  • 11
  • 2