Why my files are not readable in Linux and get the Path error?

390 views Asked by At

I am trying to install PGO (Postgres Operator) in k8s. I am following this documentation. At the 2nd step when I run following command

kubectl apply --server-side -k kustomize/install/default

I see error

master-k8s@masterk8s-virtual-machine:~/postgres-operator-examples-main$ kubectl apply --server-side -k kustomize/install/default
error: containers path is not of type []interface{} but map[string]interface {}

System Specifications:

  • I have k8s 2 node cluster with one master node.
  • All running Ubuntu 20.4

What I have try:

  • I download repository again without clone and directory uploaded on master node

  • I try to provide full path and this time I received the same error

  • I checked the default directory there 2 files present

  • I try to run this command inside the directory.

What Do I need?

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.

I really thankful.

Update Question:

I updated the version of k8s and kustomize and still see the same issue.

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 {}

Kustomize version:

{Version:kustomize/v4.5.7 GitCommit:56d82a8xxxxxxxxxxxxx BuildDate:2022-08-02T16:35:54Z GoOs:linux GoArch:amd64}
1

There are 1 answers

3
Veera Nagireddy On BEST ANSWER

To fix your issue make sure kubectl integration like below :

As @Ralle commented, Check versions. Kustomize v2.1.0 and v3.0.0+, and is included in kubectl 1.21+, for more information please look at the Kustomize doesn't work with CRDs when specifying images.

Update : 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 updated it to v4.0.5. It will be updated on a regular basis going forward, Check your versions & updates in the Kubernetes release notes. enter image description here

For examples and guides for using the kubectl integration please see the kubernetes documentation.

Also check Kubernetes 1.22: Server Side Apply moves to GA for more information.