3

I have an overlay kustomization.yaml as following:

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

bases:
    - ../../base/

patches:
    - patch.yaml

secretGenerator:
    - name: my-secrets
      env: password.env

When applying it with embedded kustomize on kubectl like kubectl -k it works fine, but now I need to generate the final yaml before applying it so when I attempt to use itself through kustomize build devops/kustomize/my-cluster/overlay/local > local.yaml I'm getting this error:

Error: json: unknown field "env"

secretGenerator spec has env parameter so I'm not sure what am I doing wrong.

Andrey
  • 20,487
  • 26
  • 108
  • 176
  • 1
    Maybe you are using old version of kustomize. Also you could try running `kubectl -k` with `-oyaml --dry-run >> local.yaml` – Matt Jun 10 '20 at 11:22
  • kubectl is using an old version of kustomize; since then `env` parameter was changed to `envs` – Andrey Jun 10 '20 at 13:49

1 Answers1

5

Turns out that newer versions of kustomize use envs parameter instead of env

Andrey
  • 20,487
  • 26
  • 108
  • 176