Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore kustomization.yaml when using kubectl deployer #2432

Closed
poikilotherm opened this issue Jul 8, 2019 · 6 comments
Closed

Ignore kustomization.yaml when using kubectl deployer #2432

poikilotherm opened this issue Jul 8, 2019 · 6 comments
Labels
area/deploy deploy/kubectl deploy/kustomize good first issue Good for newcomers help wanted We would love to have this done, but don't have the bandwidth, need help from contributors kind/feature-request priority/p2 May take a couple of releases

Comments

@poikilotherm
Copy link

Expected behavior

When using a kubectl deployer with

deploy:
  kubectl:
    manifests: ["k8s/*.yaml"]

or similar, deploymens should succeed, as kustomization.yaml files are filtered from the glob match.

Actual behavior

When a kustomization.yaml is present in the manifests, validation will fail due to kubernetes-sigs/kustomize#738. This will fail deployment, too, while kubectl is otherwise only printing warnings, but deploying everything else.

Information

  • Skaffold version: 0.33.0
  • Operating system: Linux
  • Contents of skaffold.yaml: see above

Steps to reproduce the behavior

  1. Create a Kubernetes object and add a kustomization.yaml file
  2. Create a small Skaffold config using the kubectl deployer as described above
  3. Watch skaffold run fail, as validation fails for kustomization.yaml
@priyawadhwa priyawadhwa added kind/feature-request deploy/kustomize kind/bug Something isn't working deploy/kubectl good first issue Good for newcomers help wanted We would love to have this done, but don't have the bandwidth, need help from contributors and removed kind/feature-request labels Jul 8, 2019
@dgageot dgageot self-assigned this Jul 11, 2019
@dgageot dgageot removed their assignment Jul 12, 2019
@balopat balopat added kind/feature-request and removed kind/bug Something isn't working labels Jul 16, 2019
@balopat
Copy link
Contributor

balopat commented Jul 16, 2019

Hi @poikilotherm, thanks for opening this!

1.) I'm not sure that hard coding excluding kustomize yamls is the direction we'd like to go - however if we'd support an exclude: kustom*.yaml would solve your problem.
2.) if you are using kustomize did you try using our kustomize deployer?

@poikilotherm
Copy link
Author

poikilotherm commented Jul 17, 2019

Hi @balopat thanks for coming back to me.

Ad 1) an exclude option sounds great, might be beneficial for others, too. Supporting arrays of globs would be a great enhancement.

Ad 2) I would like to keep things not depending on kustomize and I dislike the hard dependency to install it, as I wrote in #2431 which is a dup of #1781. So, no, I did not yet use the kustomize deployer... 😉

@corneliusweig
Copy link
Contributor

Another approach would be to follow the semantics of dockerignore files, where a ! prefix inverts the match. So for example:

manifests:
- k8s/*.yaml        # includes all yamls
- '!**/kustomize*'  # excludes kustomize

Or is that too magic?

@tejal29 tejal29 added the priority/p2 May take a couple of releases label Sep 19, 2019
@tstromberg
Copy link
Contributor

Thank you for the idea!

I'm closing this issue as it's been open a while, and it is not clear if it's still an open issue. No one has recently stated an interest in addressing this, but if you feel strongly about it, please feel free to add a comment.

@Schachte
Copy link

Schachte commented Oct 4, 2020

I'm also interested in this feature. Any thoughts on reconsidering?

@nkubala
Copy link
Contributor

nkubala commented Oct 14, 2020

@Schachte we recently added functionality to use kubectl's built-in kustomize when the standalone binary isn't present on the host, which might enable you to use our kustomize deployer without having a hard dependency on kustomize itself. have you given this a shot?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/deploy deploy/kubectl deploy/kustomize good first issue Good for newcomers help wanted We would love to have this done, but don't have the bandwidth, need help from contributors kind/feature-request priority/p2 May take a couple of releases
Projects
None yet
Development

No branches or pull requests

9 participants