devspace icon indicating copy to clipboard operation
devspace copied to clipboard

Kustomize deployment gives error while kubectl apply -k works.

Open fg91 opened this issue 4 years ago • 4 comments

What happened?

I tried to convert the command kubectl apply -k https://github.com/minio/operator (which works) into the following deployment:

version: v1beta11
deployments:
  - name: minio-operator
    kubectl:
      kustomize: true
      manifests:
        - https://github.com/minio/operator

Deploying it with devspace deploy --deployments=minio-operator gives the following error:

[fatal]  error deploying minio-operator: Error: unable to find one of 'kustomization.yaml', 'kustomization.yml' or 'Kustomization' in directory '/private/var/folders/ks/1ljb2tqn2dg4tt1ztjyt4nnw0000gn/T/kustomize-115242452/repo'

Please make sure `kubectl apply` does work locally with manifest `https://github.com/minio/operator`

What did you expect to happen instead? I would have expected the deployment to work the same way kubectl apply -k https://github.com/minio/operator does.

How can we reproduce the bug? (as minimally and precisely as possible)

Local Environment:

  • DevSpace Version: devspace version 5.16.2
  • Operating System: mac
  • Deployment method: kubectl apply

Kubernetes Cluster:

  • Cloud Provider: other
  • Kubernetes Version:

Client Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.7", GitCommit:"1dd5338295409edcfff11505e7bb246f0d325d15", GitTreeState:"clean", BuildDate:"2021-01-13T13:23:52Z", GoVersion:"go1.15.5", Compiler:"gc", Platform:"darwin/amd64"} Server Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.7", GitCommit:"1dd5338295409edcfff11505e7bb246f0d325d15", GitTreeState:"clean", BuildDate:"2021-01-13T13:15:20Z", GoVersion:"go1.15.5", Compiler:"gc", Platform:"linux/amd64"}

Anything else we need to know?

/kind bug

fg91 avatar Nov 04 '21 22:11 fg91

@fg91 thanks for reporting this! Does removing kustomize from your path work? DevSpace will prefer the kustomize binary over kubectl if it could be found in the path.

FabianKramm avatar Nov 05 '21 07:11 FabianKramm

@fg91 thanks for reporting this! Does removing kustomize from your path work? DevSpace will prefer the kustomize binary over kubectl if it could be found in the path.

Yes, then it works. Is your recommendation to not use kustomize itself?

fg91 avatar Nov 05 '21 09:11 fg91

Usually our recommendation is to use kustomize over kubectl -k as that is usually several versions behind, but I was not aware of the extra features kubectl has over kustomize. We might want to add an option to force devspace to use kubectl instead of kustomize then.

FabianKramm avatar Nov 08 '21 08:11 FabianKramm

Usually our recommendation is to use kustomize over kubectl -k as that is usually several versions behind, but I was not aware of the extra features kubectl has over kustomize. We might want to add an option to force devspace to use kubectl instead of kustomize then.

Makes sense 👍

fg91 avatar Nov 08 '21 09:11 fg91