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

v1beta3: make kubeadm types better support CRDs #1727

Closed
neolit123 opened this issue Aug 15, 2019 · 14 comments · Fixed by kubernetes/kubernetes#101925
Closed

v1beta3: make kubeadm types better support CRDs #1727

neolit123 opened this issue Aug 15, 2019 · 14 comments · Fixed by kubernetes/kubernetes#101925
Assignees
Labels
kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/design Categorizes issue or PR as related to design. kind/feature Categorizes issue or PR as related to a new feature. lifecycle/active Indicates that an issue or PR is actively being worked on by a contributor. priority/backlog Higher priority than priority/awaiting-more-evidence.

Comments

@neolit123
Copy link
Member

neolit123 commented Aug 15, 2019

EDIT: neolit123

issue repurposed to track the addition of +optional tags.
ObjectMeta is now out of scope for the time being.

PR:
kubernetes/kubernetes#101925


users such as kind or those that apply kustomize patches over the kubeadm config types need to manually add:

metadata:
  name: config

to your types in serialized form as kustomize requires them.

however this later results in strict unmarshal errors (warnings) when the same types are fed into kubeadm because "metadata" is not a known field.

this can be resolved if we start embedding ObjectMeta in the types.

this seems to be a quirk of the ecosystem (kustomize) and while our types are not really "API" types (more of a component-config), it seems reasonable to make the change.

also i think @fabriziopandini already said that this seems OK to him.
(please correct me if needed)

alternatively a subset of ObjectMeta via a custom type can work too, but i will prefer the full type even if we don't need most of the fields.


ComponentConfig ObjectMeta KEP:
kubernetes/enhancements#1816

@neolit123 neolit123 added kind/feature Categorizes issue or PR as related to a new feature. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/design Categorizes issue or PR as related to design. labels Aug 15, 2019
@neolit123 neolit123 added this to the v1.17 milestone Aug 15, 2019
@neolit123 neolit123 changed the title v1beta3: add ObjectMeta to our types v1beta3: add ObjectMeta to the kubeadm types Aug 15, 2019
@neolit123 neolit123 added the priority/backlog Higher priority than priority/awaiting-more-evidence. label Aug 15, 2019
@rosti
Copy link

rosti commented Aug 16, 2019

The only field we can make use of is the name field. Everything else is targeted into, either supporting the object type by the API server, or supporting multiple instances of that object.
In particular, the name field is meant to distinguish multiple instances of the object type (described in TypeMeta).
For some of the types (notably, InitConfiguration and JoinConfiguration) it may be appropriate to distinguish multiple different objects, based not on metadata.name, but on nodeRegistration.name (after all, that value will be used for the Node object's metadata.name value).
ClusterConfiguration is a completely different thing. You don't expect more than one of these in a cluster. Hence, it's a "singleton" and having a separate metadata.name field is a bit senseless.

If the only user of metadata.name is kustomize, then I do believe, that there is a workaround to that. Kustomize supports redirecting that field to something else, hence users can redirect it to nodeRegistration.name for InitConfiguration and JoinConfiguration, and to kind for ClusterConfiguration.

Hence, I don't like the idea of adding a full blown ObjectMeta to types, that are opaque to the API server and usually stored in files and config maps.

@neolit123
Copy link
Member Author

Hence, I don't like the idea of adding a full blown ObjectMeta to types, that are opaque to the API server and usually stored in files and config maps.

CAPI did something similar because of bugs in unmarshaling related to kubebuilder.
they created a custom ObjectMeta with only the fields they need.

no strong opinions on my side, so i think a custom ObjectMeta is fine.

ClusterConfiguration is a completely different thing. You don't expect more than one of these in a cluster. Hence, it's a "singleton" and having a separate metadata.name field is a bit senseless.

unless someone creates multi-cluster topologies using kubeadm?

@rosti
Copy link

rosti commented Aug 16, 2019

ClusterConfiguration is a completely different thing. You don't expect more than one of these in a cluster. Hence, it's a "singleton" and having a separate metadata.name field is a bit senseless.

unless someone creates multi-cluster topologies using kubeadm?

Yep, I forgot about that. In that case clusterName is the field to be used in place of metadata.name.

@neolit123
Copy link
Member Author

it really seems that metada.name for our types is to only satisfy kustomize.

@neolit123
Copy link
Member Author

it seems patches can use a few more fields like namespace and annotations:
https://github.com/kubernetes/kubeadm/pull/1724/files#diff-d937f45ffd1a04bea321ca4d15977b0cR65

@fabriziopandini
Copy link
Member

I'm +1 making our config API objects more similar to other K8s objects, with this regard, I expect support at least for name, labels, and annotations

@neolit123 neolit123 modified the milestones: v1.17, Next, v1.18 Nov 13, 2019
@fejta-bot
Copy link

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

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 11, 2020
@neolit123
Copy link
Member Author

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 11, 2020
@neolit123 neolit123 modified the milestones: v1.18, v1.19 Mar 8, 2020
@neolit123 neolit123 modified the milestones: v1.19, v1.20 Jun 2, 2020
@fejta-bot
Copy link

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

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 31, 2020
@neolit123
Copy link
Member Author

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 31, 2020
@fejta-bot
Copy link

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

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 29, 2020
@fabriziopandini
Copy link
Member

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 30, 2020
@neolit123 neolit123 modified the milestones: v1.20, v1.21 Dec 2, 2020
@neolit123 neolit123 modified the milestones: v1.21, v1.22 Feb 8, 2021
@neolit123 neolit123 mentioned this issue Apr 14, 2021
16 tasks
@neolit123 neolit123 self-assigned this May 11, 2021
@neolit123
Copy link
Member Author

/lifecycle active

@k8s-ci-robot k8s-ci-robot added the lifecycle/active Indicates that an issue or PR is actively being worked on by a contributor. label May 11, 2021
@neolit123 neolit123 changed the title v1beta3: add ObjectMeta to the kubeadm types v1beta3: make kubeadm types better support CRDs May 25, 2021
@neolit123
Copy link
Member Author

neolit123 commented May 25, 2021

note, we decided to not add ObjectMeta in kubeadm types for the time being (in v1beta3)
we are only adding +optional to omitempty fields.

the open PR will close this issue as it is now reporposed:
kubernetes/kubernetes#101925

in the future we can revisit the topic, but currently there is no evidence of demand outside of kustomize.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/design Categorizes issue or PR as related to design. kind/feature Categorizes issue or PR as related to a new feature. lifecycle/active Indicates that an issue or PR is actively being worked on by a contributor. priority/backlog Higher priority than priority/awaiting-more-evidence.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants