<p>I have a pipeline I am trying to implement the Kubernetes Manifest bake action using a Kustomize render. However when I run this I get the following error:</p>
<pre><code>##[error]Error: got file 'kustomization.yaml', but '/home/administrator/BA-L01/_work/80/s/Infrastructure/STARS.API.Web/overlays/devtest/kustomization.yaml' must be a directory to be a root
</code></pre>
<p><strong>pipeline.yaml:</strong></p>
<pre class="lang-yaml prettyprint-override"><code>- task: KubernetesManifest@0
  displayName: Create Manifest Files
  name: bake
  inputs:
    action: 'bake'
    namespace: ''
    renderType: 'kustomize'
    kustomizationPath: 'Infrastructure/STARS.API.Web/overlays/devtest/kustomization.yaml'
</code></pre>
<p><strong>Folder Structure:</strong></p>
<pre><code>STARS.API.Web
└── base
│   │   kustomization.yaml
│   │   service.yaml
│   │   deployment.yaml
│   
└── overlays
    └── devtest
        │   kustomization.yaml
        │   devtest-custom-values.yaml
</code></pre>
<p><strong>../base/kustomization.yaml</strong></p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- service.yaml
- deployment.yaml
</code></pre>
<p><strong>../devtest/kustomization.yaml</strong></p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
  - ../../base

patchesStrategicMerge:
  - devtest-custom-values.yaml
</code></pre>

Ross
<p>As the error message says, your <code>kustomizationPath</code> must point to the directory where your <code>kustomization.yaml</code> is located - not to the <code>kustomization.yaml</code> file.</p>
<p>So your <strong>pipeline.yaml</strong> has to be:</p>
<pre><code>- task: KubernetesManifest@0
  displayName: Create Manifest Files
  name: bake
  inputs:
    action: 'bake'
    namespace: ''
    renderType: 'kustomize'
    kustomizationPath: 'Infrastructure/STARS.API.Web/overlays/devtest/'
</code></pre>
