Feature Request: Add `kustomize --version` and `kubectl kustomize --version`
SleepyBrett opened this issue ยท 33 comments
I just spent way to long trying to figure out why the examples in your repo don't work with kubectl kustomize
. After finding a rejected MR trying to fix an example I determined that the resources:
feature works the way that the examples show only in some versions of kustomize
but it took me a while to find in the readme what version of kustomize is included in kubectl.
Alternatively if the flag is hard for whatever reason (I imagine the embedding in kubectl may cause some complication) perhaps the kustomize help screen could include the version number.
Add
kustomize --version
For the independent kustomize tool version information is exposed via kustomize version
in a format similar to kubectl version
For example:
$ kustomize version
Version: {KustomizeVersion:3.1.0 GitCommit:95f3303493fdea243ae83b767978092396169baf BuildDate:2019-07-26T18:11:16Z GoOs:darwin GoArch:amd64}
and
kubectl kustomize --version
This would be a change in the kustomize
sub-command in kubectl and so needs to be tracked in kubernetes/kubectl. Having this has come up on slack a few times and you're not the first to open a related issue (#1267) so a feature request there would be welcome.
I just spent way to long trying to figure out why the examples in your repo don't work with kubectl kustomize.
Having more a prominent call out in the README for information relating to the kubectl integration and where to go for examples/docs specific to that would definitely help prevent others running into this as well.
For example these references:
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close
.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale
/remove-lifecycle stale
Currently, the kustomize version bundled with kubectl is 2.0.3.
For better or worse, this is the second hit for me on google when I search for kubectl kustomize version
. So, I'm trying to be helpful for future visitors.
I'm not sure if its possible to check on the command line, but there is currently a note on the README page in this repo that says which versions are included in kubectl:
https://github.com/kubernetes-sigs/kustomize#kubectl-integration
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close
.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale
/remove-lifecycle stale
And now the table in the kustomize README is out of date: kubectl 1.18.x has been out for about a month. I have no idea if it's still stuck at kustomize 2.0.3. That's probably the safest guess.
Probably I had problem when using patch command...
Hello
What version of kustomize is included in kubectl 1.18.2 ?
+1
I was searching also for the current version of kustomize.
It is still
{
"ImportPath": "sigs.k8s.io/kustomize",
"Rev": "v2.0.3"
},
You can find this on https://github.com/kubernetes/kubectl/blob/v0.18.3/Godeps/Godeps.json
As a new kustomize user this was definitely confusing. The jump from 2.x to 3.x is important to be aware of.
Is the integration with kubectl no longer maintained? It seems unclear what the status of that is based on the version drift that is occurring.
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close
.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale
/remove-lifecycle stale
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close
.
Send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
/remove-lifecycle stale
/cc
Now that we've also updated to Go 1.16, I think embed
could be used as part of the solution here.
apparently, kubectl v1.21 is out now.. has anything changed?
The kustomize FAQ page says that the version should be updated in ~v1.20 https://kubectl.docs.kubernetes.io/faq/kustomize/
If it has changed, it'd be great if the readme.md was updated accordingly.
Yes, it was updated in 1.21: https://github.com/kubernetes/kubernetes/blob/4d75a6238a6e330337526e0513e67d02b1940b63/CHANGELOG/CHANGELOG-1.21.md#kustomize-updates-in-kubectl
Yes, both the readme and docs need to be updated
If anyone is wondering about their ubuntu package version I think the ubuntu package might be a bit broken...
~) $ kubectl version
Client Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.2", GitCommit:"092fbfbf53427de67cac1e9fa54aaa09a28371d7", GitTreeState:"clean", BuildDate:"2021-06-16T12:59:11Z", GoVersion:"go1.16.5", Compiler:"gc", Platform:"linux/amd64"}
~) $ kubectl kustomize version
Error: evalsymlink failure on 'version' : lstat /home/myself/version: no such file or directory
^ I don't think that is correct ...
~) $ kubectl kustomize --version
Error: unknown flag: --version
See 'kubectl kustomize --help' for usage.
~) $ dpkg -l | grep kubectl
ii kubectl 1.21.2-00 amd64 Kubernetes Command Line Tool
kubectl | 1.21.2-00 | http://apt.kubernetes.io kubernetes-xenial/main amd64 Packages
@diclophis that's because no such version command exists, neither as a subcommand nor a flag. That's what this issue is tracking. In kubectl kustomize version
, "version" is being interpreted as a path.
/assign @jeremyrickard
Workaround? How can we check what version of kustomize kubectl is using?
For now you'll have to check the Kustomize readme:
https://github.com/kubernetes-sigs/kustomize#kubectl-integration
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/stale
is applied - After 30d of inactivity since
lifecycle/stale
was applied,lifecycle/rotten
is applied - After 30d of inactivity since
lifecycle/rotten
was applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle stale
- Mark this issue or PR as rotten with
/lifecycle rotten
- Close this issue or PR with
/close
- Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
@jeremyrickard any news?
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/stale
is applied - After 30d of inactivity since
lifecycle/stale
was applied,lifecycle/rotten
is applied - After 30d of inactivity since
lifecycle/rotten
was applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle stale
- Mark this issue or PR as rotten with
/lifecycle rotten
- Close this issue or PR with
/close
- Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
@jeremyrickard could you please take a look?
Strange, also have this problem on Ubuntu, that Kustomize version is old even though I have kubectl 1.23:
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.2", GitCommit:"9d142434e3af351a628bffee3939e64c681afa4d", GitTreeState:"clean", BuildDate:"2022-01-21T02:20:54Z", GoVersion:"go1.17.6", Compiler:"gc", Platform:"linux/amd64"}
$ kubectl kustomize edit set image foo=bar:0.0.1
error: specify one path to kustomization.yaml
This command should be working in newer kustomize. Another thing, I also think it's rather strange that such basic functionality as being able to check the version of component is unavailable for such long time.