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

Remove priority field from the APIService manifest to make it compatible with 1.11+ bootstrap clusters #486

Merged
merged 1 commit into from
Aug 29, 2018

Conversation

xmudrii
Copy link
Member

@xmudrii xmudrii commented Aug 29, 2018

What this PR does / why we need it:

As of Kubernetes 1.11, the priority field has been removed from the APIService resource. The priority field have been replaced with groupPriority and versionPriority fields.

More about those fields can be found in godoc comments.

Those fields have been backported to older Kubernetes versions, including 1.10 used by Minikube. Here's a commit that introduced that change: kubernetes/kubernetes@d13ad28

Trying to create a cluster using clusterctl with a bootstrap cluster version 1.11 or newer, results in the following error:

[marko@xmudrii-1 clusterctl (master)]$ go run main.go create cluster --provider digitalocean -c examples/digitalocean/out/cluster.yaml -m examples/digitalocean/out/machines.yaml -p examples/digitalocean/out/provider-components.yaml --cleanup-bootstrap-cluster false --existing-bootstrap-cluster-kubeconfig /var/run/kubernetes/admin.kubeconfig
I0829 12:45:28.516323   13818 clusterdeployer.go:122] Creating bootstrap cluster
I0829 12:45:28.520057   13818 clusterdeployer.go:130] Applying Cluster API stack to bootstrap cluster
I0829 12:45:28.520078   13818 clusterdeployer.go:313] Applying Cluster API APIServer
I0829 12:45:29.952983   13818 clusterdeployer.go:236] Cleaning up bootstrap cluster.
F0829 12:45:29.953000   13818 create_cluster.go:63] unable to apply cluster api stack to bootstrap cluster: unable to apply cluster apiserver: unable to apply apiserver yaml: couldn't kubectl apply: exit status 1, output: error: error validating "STDIN": error validating data: ValidationError(APIService.spec): unknown field "priority" in io.k8s.kube-aggregator.pkg.apis.apiregistration.v1beta1.APIServiceSpec; if you choose to ignore these errors, turn validation off with --validate=false

After the fix is in place, this part passes without any other problem. We already have both versionPriority and groupPriority, so I believe we don't need any other change.

I have tested with both external cluster version 1.11, 1.12 (current master), 1.10, and Minikube 1.10.

Release note:

Remove priority field from the APIService manifest to make it compatible with 1.11+ bootstrap clusters.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 29, 2018
@sttts
Copy link

sttts commented Aug 29, 2018

/ok-to-test

@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Aug 29, 2018
@detiber
Copy link
Member

detiber commented Aug 29, 2018

/lgtm

@roberthbailey ptal

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 29, 2018
@roberthbailey
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: roberthbailey, xmudrii

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

The pull request process is described 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 k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 29, 2018
@roberthbailey
Copy link
Contributor

thanks for fixing this!

@k8s-ci-robot k8s-ci-robot merged commit 211cb35 into kubernetes-sigs:master Aug 29, 2018
@xmudrii xmudrii deleted the apiservice-priority branch August 29, 2018 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants