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

kustomize fallback can cause version mismatch problems #2743

Open
nicks opened this issue Jan 8, 2020 · 4 comments
Open

kustomize fallback can cause version mismatch problems #2743

nicks opened this issue Jan 8, 2020 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@nicks
Copy link
Member

nicks commented Jan 8, 2020

From the Tilt channel:

I did not have a kustomize binary, and tilt appears to fall back on kubectl kustomize. This call failed, because kubectl (v1.17) uses kustomize v2 and is incompatible with CAPI's kustomizations, which need kustomize v3.

Currently Tilt prints:

Successfully loaded Tiltfile (6.567930778s)
Traceback (most recent call last):
  /home/dlipovetsky/projects/cluster-api/Tiltfile:217:17: in <toplevel>
  /home/dlipovetsky/projects/cluster-api/Tiltfile:205:24: in enable_providers
  /home/dlipovetsky/projects/cluster-api/Tiltfile:170:25: in enable_provider
  <builtin>: in kustomize
Error: command ["kubectl" "kustomize" "/home/dlipovetsky/projects/cluster-api/config/default"] failed.
error: exit status 1
stdout: ""
stderr: "Error: AccumulateTarget: couldn't find target apps_v1_Deployment|system|~P|controller-manager|~S for json patch\n\n\n\nExamples:\n  # Use the current working directory\n  kubectl kustomize .\n  \n  # Use some shared configuration directory\n  kubectl kustomize /home/configuration/production\n  \n  # Use a URL\n  kubectl kustomize github.com/kubernetes-sigs/kustomize.git/examples/helloWorld?ref=v1.0.6\n\nUsage:\n  kubectl kustomize <dir> [flags] [options]\n\nUse \"kubectl options\" for a list of global command-line options (applies to all commands).\n\nAccumulateTarget: couldn't find target apps_v1_Deployment|system|~P|controller-manager|~S for json patch\n\n"

And there's probably an opportunity here for better hints what's wrong. They might include:

  • more explicitly pointing out that we're falling back to the kubectl kustomize
  • adding min_version parameters to the built-in customize
@dlipovetsky
Copy link

  • adding min_version parameters to the built-in customize

It is awkward to determine the version of kustomize used by kubectl kustomize. There is no way to get the version, i.e. kubectl kustomize version is not available. So tilt would need to map kubectl to kustomize versions.

Makes we wonder if kubectl kustomize version would be generally useful...

@nicks
Copy link
Member Author

nicks commented Jan 8, 2020

ya, i think that's a great idea, i filed kubernetes/kubectl#797 upstream

@dlipovetsky
Copy link

Thanks for filing that issue. Someone tagged it in another issue (kubernetes/kubernetes#85146), and my reading of that one is that the future of kubectl kustomize is unclear.

What do you think of removing the fallback from tilt?

@jazzdan
Copy link
Contributor

jazzdan commented Jan 15, 2020

Thanks for the pointer @dlipovetsky, I think we should make it more clear when the fallback is happening but wait until a decision is made upstream before removing the fallback altogether. If it continues to be confusing after such a change is made, we can revisit.

Regardless, I think the kustomize v2 vs v3 issue is going to bite people regardless what we do with 'kubectl kustomize', so we may need a versioning primitive either way. (This may also come up with our helm primitive)

@jazzdan jazzdan self-assigned this Jan 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants