Home > Software design >  Is there any documentation on how to use vars in kustomize?
Is there any documentation on how to use vars in kustomize?

Time:10-09

I want to use vars without ConfigMaps or Secrets. Declaring a value would be sufficient for me. But I couldn't see any documentation regarding vars attributes or how I can use. Do you know any docs about this? Thanks!

vars:
  - name: ROUTE_HOST
    objref:
      kind: ConfigMap
      name: template-vars
      apiVersion: v1
    fieldref:
      fieldpath: data.ROUTE_HOST

CodePudding user response:

Summarizing Jonas's comments:

WARNING: There are plans to deprecate vars. For existing users of vars, we recommend migration to replacements as early as possible. There is a guide for convering vars to replacements at the bottom of this page under “convert vars to replacements”. For new users, we recommend never using vars, and starting with replacements to avoid migration in the future.

Please find more information in the official documentation.

Try to use replacements as it's suggested above.

  • Related