<p>I have an overlay <code>kustomization.yaml</code> as following:</p>
<pre><code>apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

bases:
    - ../../base/

patches:
    - patch.yaml

secretGenerator:
    - name: my-secrets
      env: password.env
</code></pre>
<p>When applying it with embedded <code>kustomize</code> on <code>kubectl</code> like <code>kubectl -k</code> it works fine, but now I need to generate the final yaml before applying it so when I attempt to use itself through <code>kustomize build devops/kustomize/my-cluster/overlay/local &gt; local.yaml</code> I'm getting this error:</p>
<pre><code>Error: json: unknown field &quot;env&quot;
</code></pre>
<p><code>secretGenerator</code> spec has <code>env</code> parameter so I'm not sure what am I doing wrong.</p>

<p>Turns out that newer versions of kustomize use <code>envs</code> parameter instead of <code>env</code></p>
