-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
require apiVersion/kind in Kustomization.yaml? #738
Comments
not sure I understand that option... that sounds like a file that does not declare its version is treated as v1beta1 and v1 depending on which version of kustomize processes it, which doesn't seem good |
if there's a significant number of existing files that would be affected by making it required, loudly complaining/warning (as we do now), indicating what version (v1beta1) the file is being treated as, and indicating it will be made required in the next version of kustomize seems ok out of curiosity, in what version did this warning show up (and what specific "next version" of kustomize was this anticipated to be made required in?) |
Maybe I shouldn't say which version it defaults to. Later when we have a
So far, we have releases until 1.0.11. We added this warning recently after 1.0.11 release. We plan to release 2.0.0 soon since there is some other backward incompatible changes. Then the kustomize kubectl integration will vendor kustomize 2.0.0. If we keep this warning, we will keep it for the whole cycle of version 2. Then in version 3.0.0, we can make those fields required. |
Considering 2.0.0 the "next version" that makes it required would be my preference, especially so kubectl doesn't start life with this command with deprecated warnings. That said, my perspective is definitely that of a newcomer on this command, so I'd be glad to hear others' thoughts. |
requiring a Group/Version Kind Upside 👍
Downside 👎
to
See also the noise added to the examples in #735 At the point where we say let's make this an API object we can decide that any Kustomization missing the fields (but otherwise parsing OK) is grandfathered in with the proper GVK, and we already offer a tool to add the fields to Kustomization files ( Does a door close if we don't require it immediately? |
The group in apiVersion is not necessary. A similar case is kubectl configuration files where the apiVersion is
Agreed. |
For server types unspecified implies |
For prior art - the kubeconfig file has a Kind |
Can we make the kind / version required in the kubectl version but defer it as required in kustomize so we don't break folks? |
fyi, that predated the existence of API groups as a concept. today, new config types are being placed in a |
@liggitt Who defines what the component is? Is that sig-arch? The sig owning the piece? |
We can do this, but that will be an inconsistency between |
How big of a problem is that? |
|
@Liujingfang1 - good point re remote bases. we shouldn't worry about it because
If we're worried about the ResourceBuilder in So i'm for passively allowing the fields
erroring on any other values (if the fields are present), and not requiring the fields until we have a use case for the Kustomization as an API object, e.g. server-side apply uses them (a wild new use case). |
Does this solution sound good to you @liggitt @pwittrock ? |
We could mention this issue at the sig-cli meeting and see if anyone else has thoughts. We're eager to put a new release out. We already have to go to v2 because of other changes. But if we push v2 right now, and then later decide these fields should be required, we'd be faced with v3 :) |
+1. Sending out an email to sig-cli saying it will be discussed at the next sig meeting and we plan to make a decision if we have lazy consensus at that time. |
it has typically is a form of the consuming binary name. config groups we have are:
As an approach, yes. As a specific group name, |
👍 from me for |
Fine with Still haven't heard a user or developer benefit to requiring these API fields in a non API object. In favor of allowing them to be present, and demanding that if present they have particular values, and that those particular values are the assumed values if the fields are missing. Everyone wins :) |
documented the versioning policy here |
Kustomize newbie here, had to do a fair bit of searching to understand why i can't use kubctl with kustomization.yaml. Saw quite a lot of articles of why kustomize is so much better than helm so it was even merged in kubectl. RIght now I'm getting:
with
in my kustomization.yaml file. Is it still ok? Thanks in advance! |
@yellowmegaman Starting from 1.14, you can use
|
Thanks a bunch @Liujingfang1, awesome! |
Really baffled about getting
to work here, and am hoping you could give me a hand. We are running v1.15.0:
Adding the following
to
and removing the above returns
In addition, when creating a cluster role binding, it errs out with
My understanding is that we don't need to specify the namespace for a Nevertheless, it works with
|
@mapshen use |
Argh...everything worked like a charm with |
- Added missing `kubectl` to command - Changed from `-f` to `-k` when using kustomize to avoid errors on missing apiVersion and kind, c.f. kubernetes-sigs/kustomize#738
@Liujingfang1 I am unable to access the link to versioning policy (404). Can you please provide the link to latest standard so that we can follow it in our projects. |
The link you're seeking was moved to faq/versioningPolicy.md it this repo then ultimately deleted when moved to the SIG SCI website at https://kubectl.docs.kubernetes.io/faq/kustomize/versioningpolicy/ ^ (the source for which can be found at this permalink at time of writing) |
apiVersion
andkind
are currently optional in a kustomization.yaml file. Whenkustomize build
executes on a kustomizaiton.yaml file without those fields, it prints some warning messages.When integrating kustomize into kubectl, the warning messages don't make sense since
kustomize edit fix
is not available throughkubectl
.It is a good time to think about how to handle apiVersion/kind. Should they be required or optional? I try my best to list the trade-offs.
v1beta1
; kind isKustomization
Kustomize build
exits when doesn't see apiVersion and kindv1beta1
.In the future, when we move the version to
v1
, we can default it tov1
.@monopole @pwittrock @liggitt Any thoughts about this?
The text was updated successfully, but these errors were encountered: