<p>I am trying to install PGO (Postgres Operator) in k8s. I am following <a href="https://access.crunchydata.com/documentation/postgres-operator/5.3.0/quickstart/" rel="nofollow noreferrer">this</a> documentation.
At the 2nd step when I run following command</p>
<pre><code>kubectl apply --server-side -k kustomize/install/default
</code></pre>
<p>I see error</p>
<blockquote>
<p>master-k8s@masterk8s-virtual-machine:~/postgres-operator-examples-main$ kubectl apply --server-side -k kustomize/install/default<br />
error: containers path is not of type []interface{} but map[string]interface {}</p>
</blockquote>
<p><strong>System Specifications:</strong></p>
<ul>
<li>I have k8s 2 node cluster with one master node.</li>
<li>All running Ubuntu 20.4</li>
</ul>
<p><strong>What I have try:</strong></p>
<ul>
<li><p>I download repository again without clone and directory uploaded on master node</p>
</li>
<li><p>I try to provide full path and this time I received the same error</p>
</li>
<li><p>I checked the default directory there 2 files present</p>
</li>
<li><p>I try to run this command inside the directory.</p>
</li>
</ul>
<p><strong>What Do I need?</strong></p>
<p>I am looking for solution why I am not able to follow the 2nd step of document.
Please help me to find what did I missed or doing it wrong.</p>
<p>I really thankful.</p>
<p><strong>Update Question:</strong></p>
<p>I updated the version of k8s and kustomize and still see the same issue.</p>
<pre><code>master-k8s@masterk8s-virtual-machine:~/test/postgres-operator-examples-main$ kubectl apply --server-side -k kustomize/install/default
error: containers path is not of type []interface{} but map[string]interface {}
</code></pre>
<p><strong>Kustomize version:</strong></p>
<pre><code>{Version:kustomize/v4.5.7 GitCommit:56d82a8xxxxxxxxxxxxx BuildDate:2022-08-02T16:35:54Z GoOs:linux GoArch:amd64}
</code></pre>

tauqeerahmad24
<p><strong>To fix your issue make sure kubectl integration like below :</strong></p>
<p>As <strong>@Ralle</strong> commented, Check versions. <strong>Kustomize v2.1.0 and v3.0.0+, and is included in kubectl 1.21+</strong>, for more information please look at the <a href="https://github.com/kubernetes/kubernetes/issues/107751" rel="nofollow noreferrer">Kustomize doesn't work with CRDs when specifying images</a>.</p>
<p><strong>Update :</strong> The kustomize build flow at v2.0.3 was added to kubectl v1.14. The kustomize flow in kubectl remained frozen at v2.0.3 until kubectl v1.21, which <a href="https://github.com/kubernetes/kubernetes/blob/4d75a6238a6e330337526e0513e67d02b1940b63/CHANGELOG/CHANGELOG-1.21.md#kustomize-updates-in-kubectl" rel="nofollow noreferrer">updated it to v4.0.5</a>. It will be updated on a regular basis going forward, Check your versions &amp; updates in the Kubernetes release notes.
<a href="https://i.stack.imgur.com/kgvkQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kgvkQ.png" alt="enter image description here" /></a></p>
<p>For examples and guides for using the kubectl integration please see the <a href="https://kubernetes.io/docs/tasks/manage-kubernetes-objects/kustomization/" rel="nofollow noreferrer">kubernetes documentation</a>.</p>
<p>Also check <a href="https://kubernetes.io/blog/2021/08/06/server-side-apply-ga/" rel="nofollow noreferrer">Kubernetes 1.22: Server Side Apply moves to GA</a> for more information.</p>
