Search code examples
argocdkustomize

Kustomize configMapGenerator, render Helm chart, ArgoCd


Is it possible to implement this behavior in ArgoCd?

I have a configMapGenerator:

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
generators:
- helmgenerator.yaml

configurations:
- rollout-transform.yaml

configMapGenerator:
- name: dev-tw-info-app-props
  behavior: create
  files:
  - application.yaml=manifests/application.yaml
  - log4j2.properties=manifests/log4j2.properties

I would like to use helm functions in application.yaml for example, but Kustomization treats them as String. Is it possible to somehow make configMapGenerator friendly with helm functions?

The option of generating charts with HelmChartInflationGenerator doesn't work for me.


Solution

  • Is it possible to somehow make configMapGenerator friendly with helm functions?

    It is not. Kustomize is not a template processor and does not support things like variables, functions, etc. Kustomize operates by applying patches and other transformations to your manifests; possibly your desired configuration can be described using these facilities.

    Kustomize does have support for expanding Helm charts. You can use Helm for templating your manifests and then use Kustomize transformations for changes that can't easily be described by your Helm templates.

    In general, it's better to pick either Helm or Kustomize and stick with it.