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

WIP Introduce v1beta1 API #9178

Closed
wants to merge 3 commits into from
Closed

Conversation

johngmyers
Copy link
Member

Introduce the v1beta1 API as a copy of v1alpha2. Subsequent PRs during the kops 1.19 development period are expected to change it.

/milestone v1.19

@k8s-ci-robot
Copy link
Contributor

@johngmyers: You must be a member of the kubernetes/kops-maintainers GitHub team to set the milestone. If you believe you should be able to issue the /milestone command, please contact your Kops Maintainers and have them propose you as an additional delegate for this responsibility.

In response to this:

Introduce the v1beta1 API as a copy of v1alpha2. Subsequent PRs during the kops 1.19 development period are expected to change it.

/milestone v1.19

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels May 26, 2020
@rifelpet rifelpet added this to the v1.19 milestone May 26, 2020
@rifelpet
Copy link
Member

Great idea! I wonder if its worth having an umbrella issue to track and discuss desired changes from a high level? before the work is done to implement the changes into a PR. I know I have a few in the back of my head too.

@olemarkus
Copy link
Member

I guess this new API version will be implemented over a number of PRs based on the various changes we'd like to put into them. I suppose some will be more global and requires broader agreement, while some are more local (such as removing all the unused fields in Cilium).

Starting with an issue on what we'd like to achieve with this API version would be good.

How large are the changes we see here? Is beta the next step or will we change some parts of the spec so much that v1alpha3 makes more sense?

Regardless, I certainly welcome a new API version and I think 1.19 is a good time to add this.

@rifelpet
Copy link
Member

rifelpet commented May 26, 2020

Heres some from my list, feel free to paste into an issue. Most are around consistency and some could be done without bumping api versions but I never got around to it.

[x] KubeAPIServerConfig and KubeProxyConfig both have CPU and Memory resource fields of type string rather than *resource.Quantity
[ ] AccessSpec.DNS is unused (jgmyers: it's used now)
[ ] LoadBalancerAccessSpec.UseForInternalAPI could have a better name
[x] Any field that represents a docker image should have a consistent name. We currently have a mix of Image and ImageName
[ ] Rename KubeDNSSpec given that it is also used by CoreDNS
[x] BastionSpec.BastionPublicName -> BastionSpec.PublicName
[ ] Any fields related to security groups should be made more consistent or consolidated. Perhaps have a single type that represents SecurityGroup settings to be applied to an instance or load balancer, and use that in each of the specs below:
[ ] BastionLoadBalancerSpec.AdditionalSecurityGroups
[ ] CloudConfiguration.ElbSecurityGroup
[ ] InstanceGroupSpec.AdditionalSecurityGroups
[ ] InstanceGroupSpec.SecurityGroupOverride
[ ] LoadBalancerAccessSpec.AdditionalSecurityGroups
[ ] LoadBalancerAccessSpec.SecurityGroupOverride
[x] type LoadBalancer could use a more specific name
[ ] In general we could look at each field with additional or override in the name and figure out if we can merge it with the "original" data, making it a list. NetworkCIDR and AdditionalNetworkCIDRs for example.
[ ] evaluate every field marked deprecated and consider removing it
[x] ClusterSubnetSpec.ProviderID could have a better name

I believe there was discussion around cloud-specific fields and if we could colocate them under a cloud-specific type, too.

@olemarkus
Copy link
Member

  • Cilium
    • remove all unused fields.
    • Some fields should also be renamed to be similar to upstream, e.g IPTablesRulesNoinstall -> InstallIptablesRules
  • Consistency way of
  • repository/image:version is specify
  • enable prometheus for addons

How easy would it be to change the structs? Some of those we have today is overly flat and use prefixes, where their helm counterpart is fairly nested. Nesting could make things more user-friendly and easier to reason about.

@rifelpet
Copy link
Member

rifelpet commented May 26, 2020

InstanceGroupSpec's RootVolume* fields would be another good candidate for a nested struct.

When this lands we should decide on a formal policy for making changes to the older api versions - we should either require it (if applicable) or not allow it. the later of which i believe we could enforce with prow.

@johngmyers
Copy link
Member Author

It is an apimachinery requirement that new fields be added to the old apiversions. This is so they round-trip.

I have not found apimachinery rules on removing unsupported fields. I believe fields that are checked by api validation should remain in the unversioned API with a TODO: remove with v1alpha2 comment. Fields that are simply ignored I suspect we can remove from the unversioned API.

The v1alpha2 API has been around so long I believe we should treat it as requiring at least the beta deprecation period of 3 releases/9 months. We might even treat it as stable and give it 12 months before removing. I don't think the new API should have less than a beta deprecation period either.

@olemarkus
Copy link
Member

So if I understand this correctly, we can either offer a v1alpha3 where we can break whatever, but create script/subcommand that converts the compatible parts from v1alpha2 to v1alpha3, or we can introduce v1beta1, but then have to keep v1alpha2 in sync. Most of the stuff in @rifelpet's first post can be done because it is just renaming the json keys, while the structs can remain as they are today.

@johngmyers
Copy link
Member Author

johngmyers commented May 26, 2020

@olemarkus I don't think you understand correctly. The only difference between alpha and beta is the minimum length of the deprecation period before we remove the API. For beta it is 3 releases or 9 months, whichever is longer. For alpha it is 0 releases. I don't think either the old or new APIs should be removed immediately.

For APIs that still exist we need to maintain round-trip semantics, so new fields have to be added to old api versions and moved fields have to have conversion code for old apis. This is independent on whether they are alpha or beta.

@rifelpet
Copy link
Member

hm, didn't we determine that v1alpha1 was missing some fields before we removed it? was that because the prow jobs weren't enforcing round-trip semantics?

@olemarkus
Copy link
Member

@johngmyers I am not sure we disagree here. I am suggesting some changes that breaks round-trip. But if we can avoid this, we definitely should. I don't want to be in a situation where those fields are with us forever though.

But if we remove e.g the deprecated cilium fields from v1beta1, can we have conversion logic that sets the unversioned api values to blank? Or is it possible to remove the deprecated fields from the unversioned API and leave them only in v1alpha1, then have conversion logic that sets these values to blank in v1alpha1?

@johngmyers
Copy link
Member Author

I'm not entirely sure what the exact rules are for removing fields: the apimachinery documentation is extremely hard to find and the few times I did find it I didn't have time left to read it.

As I said before, I think we can simply remove unused, unvalidated fields from the unversioned API. That would allow them to be specified, but they'd be immediately dropped.

@olemarkus
Copy link
Member

Doesn't seem too hard. When one make incompatible changes one have to implement manual conversion, as expected. apimachinery makes some boilerplate functions to make life easier (everything that is still mapped 1:1). See johngmyers/kops@v1beta1...olemarkus:api-v1beta1-cilium for my attempt at doing various changes to the API.

@olemarkus
Copy link
Member

hm, didn't we determine that v1alpha1 was missing some fields before we removed it? was that because the prow jobs weren't enforcing round-trip semantics?

@rifelpet think this happen a while ago before we had make verify-staticcheck or something. Have some faint memories of that.

@johngmyers
Copy link
Member Author

One wrinkle is that kops writes the unversioned API to "cluster.spec" in the state store. We won't be able to make any incompatible changes to the unversioned API.

I'm working on a PR to start migrating to a versioned form of the full cluster spec, also writing the unversioned API to "cluster.spec" but not reading it. Perhaps we do that migration in 1.19 and introduce v1beta1 in 1.20.

@olemarkus
Copy link
Member

I don't know if we should do truly incompatible changes. The ones I did will mean some values will get lost, but only those that were ignored already. So while conversion isn't entirely 1:1, the effect on the cluster is the same.

It may be a bit confusing to the users though.

Another question: Do we want to change some defaults when we create new api version? E.g flip some of the flags we already tell the user to do because of security.

@rifelpet
Copy link
Member

rifelpet commented May 31, 2020

It would be nice to have roundtrip tests: given a v1alpha2 manifest, convert it to v1beta1 and back and ensure its equal. Also do the same for v1beta to v1alpha2 and back. It seems like this would be a good place for that:

https://github.com/kubernetes/kops/tree/master/tests/integration/conversion

and we should make sure the manifests include any fields that we're modifying in the new apiVersion. This could be in a followup PR though.

@johngmyers
Copy link
Member Author

We're going to need a whole kops minor version with the #9229 fix or we're going to be significantly constrained in how we can change the unversioned API. So I think this project will have to wait until kops 1.20.
/milestone v1.20

@k8s-ci-robot
Copy link
Contributor

@johngmyers: You must be a member of the kubernetes/kops-maintainers GitHub team to set the milestone. If you believe you should be able to issue the /milestone command, please contact your Kops Maintainers and have them propose you as an additional delegate for this responsibility.

In response to this:

We're going to need a whole kops minor version with the #9229 fix or we're going to be significantly constrained in how we can change the unversioned API. So I think this project will have to wait until kops 1.20.
/milestone v1.20

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@rifelpet rifelpet removed this from the v1.19 milestone Jun 1, 2020
@olemarkus
Copy link
Member

Just out of curiosity, what is an incompatible change? Would any of the changes in my branch be incompatible (the round-trip is not entirely complete for some as the deprecated values will be nulled even if the user set a value. The effect on the cluster is identical though)

@k8s-ci-robot k8s-ci-robot added the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label May 11, 2021
@johngmyers
Copy link
Member Author

/remove-lifecycle rotten

@k8s-ci-robot k8s-ci-robot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label May 11, 2021
@johngmyers johngmyers added this to the v1.23 milestone Jun 25, 2021
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 2, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please ask for approval from johngmyers after the PR has been reviewed.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot
Copy link
Contributor

@johngmyers: PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 2, 2021
@hakman
Copy link
Member

hakman commented Oct 31, 2021

@johngmyers Can this be closed now that #12406 was merged?

@johngmyers
Copy link
Member Author

This has lists of things to change in the API, so I'm keeping it open for that.

@k8s-triage-robot
Copy link

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

@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 26, 2022
@olemarkus olemarkus modified the milestones: v1.23, v1.24 Mar 6, 2022
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active 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 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 rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Apr 5, 2022
@k8s-ci-robot
Copy link
Contributor

@johngmyers: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kops-verify-cloudformation 247afc9 link /test pull-kops-verify-cloudformation
pull-kops-verify-hashes 247afc9 link /test pull-kops-verify-hashes
pull-kops-e2e-k8s-containerd 247afc9 link /test pull-kops-e2e-k8s-containerd
pull-kops-e2e-cni-canal 473b3e4 link true /test pull-kops-e2e-cni-canal
pull-kops-e2e-cni-cilium-ipv6 473b3e4 link true /test pull-kops-e2e-cni-cilium-ipv6
pull-kops-e2e-cni-weave 473b3e4 link true /test pull-kops-e2e-cni-weave
pull-kops-e2e-cni-amazonvpc 473b3e4 link true /test pull-kops-e2e-cni-amazonvpc
pull-kops-e2e-cni-calico 473b3e4 link true /test pull-kops-e2e-cni-calico
pull-kops-e2e-cni-calico-ipv6 473b3e4 link true /test pull-kops-e2e-cni-calico-ipv6
pull-kops-e2e-cni-cilium 473b3e4 link true /test pull-kops-e2e-cni-cilium
pull-kops-e2e-cni-flannel 473b3e4 link true /test pull-kops-e2e-cni-flannel
pull-kops-e2e-cni-kuberouter 473b3e4 link true /test pull-kops-e2e-cni-kuberouter

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active 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:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

@k8s-ci-robot
Copy link
Contributor

@k8s-triage-robot: Closed this PR.

In response to this:

The Kubernetes project currently lacks enough active 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:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api area/documentation cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants