Kustomize: Error: Unable to find one of 'kustomization.yaml'

Created on 18 Jun 2020  路  17Comments  路  Source: kubernetes-sigs/kustomize

Hello all,

I am a newbie, and i am testing kubernetes cluster on my laptop. I have installed k8s through kubeadm. The cluster is running good with working node. I was on kubernetes.io site and discovered about kustomize. I have installed kustomize on my master node and this is the version that shows up.
{Version:kustomize/v3.6.1 GitCommit:c97fa946d576eb6ed559f17f2ac43b3b5a8d5dbd BuildDate:2020-05-27T20:47:35Z GoOs:linux GoArch:amd64}

Following online blogs, https://blog.stack-labs.com/code/kustomize-101/ i am trying to create the sample kustomize file but i keep getting the error. Error: unable to find one of 'kustomization.yaml', 'kustomization.yml' or 'Kustomization' in directory '/home/irfan/hello/BASE/BASE'
I would appreciate if someone can let me know what am doing wrong and how can get this working. Thanks in advance
Irfan

OS: Ubuntu 20.04 LTS
Kubeadm: kubeadm version: &version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.3", GitCommit:"2e7996e3e2712684bc73f0dec0200d64eec7fe40", GitTreeState:"clean", BuildDate:"2020-05-20T12:49:29Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}

Most helpful comment

@lvargas0584 you don't have "to build the binary from git", this should work:

snap remove kustomize
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"  | bash
sudo mv kustomize /usr/local/bin/

All 17 comments

i created a directory with deployment.yaml, service.yaml, and kustomization.yaml and when i give the command "kustomize build ." from the same working directory i get the error message "Error: unable to find one of 'kustomization.yaml', 'kustomization.yml' or 'Kustomization' in directory '/home/irfan/hello/base'"

i hope someone can help me out and point to me right direction.

Thanks in advance
irfan

What does your kustomization.yaml look like?

hi @pwittrock
The yaml looks like this from the example from this link https://blog.stack-labs.com/code/kustomize-101/

"apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:

  • service.yaml
  • deployment.yaml"

I'm seeing the same thing with the 3.6.1 Kustomize release installed through snap on Xubuntu 20.04. Our setup stopped working with that version. After building the binary from git, and using that one, everything worked again.

snap REEE :rage:

I got the same error with version:
{Version:kustomize/v3.8.1 GitCommit:0b359d0ef0272e6545eda0e99aacd63aef99c4d0 BuildDate:2020-07-16T00:58:46Z GoOs:linux GoArch:amd64}

And not using any kustomization file just this command:

kustomize build https://github.com/coreos/kube-prometheus.git?ref=v0.4.0
Error: unable to find one of 'kustomization.yaml', 'kustomization.yml' or 'Kustomization' in directory '/tmp/kustomize-747901657/repo'

I'm trying to debug deeply but hasn't been easy, the only think that I know for sure it's that directory /tmp/kustomize-747901657 didn't got any content.

There's any "verbose debug option" I can use to try to figure out what's the issue? currently I'm running out of ideas

Thank you!!!

I'm running into this also against a GitLab URL:

$ kustomize version
{Version:3.8.1 GitCommit:0b359d0ef0272e6545eda0e99aacd63aef99c4d0 BuildDate:2020-07-16T05:11:04+01:00 GoOs:darwin GoArch:amd64}

$ git clone https://gitlab.corp.pingidentity.com/ping-cloud-private-tenant/ping-cloud-base
Cloning into 'ping-cloud-base'...
warning: redirecting to https://gitlab.corp.pingidentity.com/ping-cloud-private-tenant/ping-cloud-base.git/
remote: Enumerating objects: 4066, done.
remote: Counting objects: 100% (4066/4066), done.
remote: Compressing objects: 100% (1226/1226), done.
remote: Total 18511 (delta 3630), reused 2998 (delta 2836), pack-reused 14445
Receiving objects: 100% (18511/18511), 3.09 MiB | 736.00 KiB/s, done.
Resolving deltas: 100% (11250/11250), done.

$ ls ping-cloud-base/kustomization.yaml
ping-cloud-base/kustomization.yaml

$ (cd ping-cloud-base; git branch)
* master

$ kustomize build https://gitlab.corp.pingidentity.com/ping-cloud-private-tenant/ping-cloud-base?ref=master
Error: unable to find one of 'kustomization.yaml', 'kustomization.yml' or 'Kustomization' in directory '/private/var/folders/wq/qgzclr6n2ksd9_x_0fkk_mgm0000gn/T/kustomize-461012522/repo'

$ (cd ping-cloud-base; kustomize build)

^^^ works

What am I missing?

I'm seeing the same thing with the 3.6.1 Kustomize release installed through snap on Xubuntu 20.04. Our setup stopped working with that version. After building the binary from git, and using that one, everything worked again.

i have the same issue, plase, can you tell me how to solve it.

@lvargas0584 you don't have "to build the binary from git", this should work:

snap remove kustomize
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"  | bash
sudo mv kustomize /usr/local/bin/

So is this a bug in kustomize? And is it targeted to be fixed in the next release?

/assign

@savitha-ping This is a bug in the kustomize dependency go-getter. Try to remove the https:// in the url. go-getter will try to use HTTP protocol to download the file instead of using git if there is https://.

Ahh ok. When will the go-getter dependency with the fix be picked by kustomize? Thanks!

The workaround/hack from @lvargas0584 works for me.

Yes kustomize will update the go-getter if they fix the issue.

/close

@Shell32-Natsu: Closing this issue.

In response to this:

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@lvargas0584 you don't have "to build the binary from git", this should work:

snap remove kustomize
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"  | bash
sudo mv kustomize /usr/local/bin/

Thanks. It worked for me on Ubuntu 20.04

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pst picture pst  路  4Comments

davidknezic picture davidknezic  路  3Comments

bugbuilder picture bugbuilder  路  3Comments

monopole picture monopole  路  3Comments

laupow picture laupow  路  4Comments