<p>I have a resource yaml file in a folder structure given below</p>
<blockquote>
<p>base</p>
<p>---- first.yaml</p>
<p>main</p>
<p>---- kustomization.yaml</p>
</blockquote>
<p>In kustomization.yaml I am referring the first.yaml as</p>
<blockquote>
<p>resources:</p>
<ul>
<li>../base/first.yaml</li>
</ul>
</blockquote>
<p>But I am getting an error when i do apply of kubectl apply -f kustomizatio.yaml</p>
<pre><code>accumulating resources: accumulating resources from '../base/first.yaml': security; file '../base/first.yaml' is not in or below '../base'
</code></pre>
<p>How can i call the first.yaml resource from the folder base to the kustomization in main folder?</p>

Kabilan R
<p>Kustomize cannot refer to individual resources in parent directories, it can only refer to resources in current or child directories, but it can refer to other Kustomize directories.</p>
<p>The following would be a valid configuration for what you have:</p>
<pre><code>.
├── base
│   ├── main
│   │   ├── kustomization.yaml
│   │   └── resource.yaml
│   └── stuff
│       ├── first.yaml
│       └── kustomization.yaml
└── cluster
    └── kustomization.yaml
</code></pre>
<p>Contents of <code>base/main/kustomization.yaml</code>:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
  - resource.yaml
</code></pre>
<p>Contents of <code>base/stuff/kustomization.yaml</code>:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
  - first.yaml
</code></pre>
<p>Contents of <code>cluster/kustomization.yaml</code>:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
 - ../base/main
 - ../base/stuff
</code></pre>
