-
Notifications
You must be signed in to change notification settings - Fork 39.8k
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
embed kube-apiextensions inside of kube-apiserver #46055
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deads2k
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
genericConfig.OpenAPIConfig = nil | ||
genericConfig.SwaggerConfig = nil | ||
|
||
// copy the loopbackclientconfig. We're going to change the contenttype back to json until we get protobuf serializations for it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the issue here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as discussed in irc, this is a follow-up
cmd/kube-apiserver/app/server.go
Outdated
return err | ||
} | ||
|
||
// TPRs are enabled and not yet beta, since this these are the successor, they fall under the same rule |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean here? the same rule = they are enabled by default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-this
@@ -61,14 +66,18 @@ type tprRegistrationController struct { | |||
|
|||
// NewAutoRegistrationController returns a controller which will register TPR GroupVersions with the auto APIService registration | |||
// controller so they automatically stay in sync. | |||
func NewAutoRegistrationController(tprInformer informers.ThirdPartyResourceInformer, apiServiceRegistration AutoAPIServiceRegistration) *tprRegistrationController { | |||
// In order to stay sane with both TPR and CRD present, we have a single controlle that manages both. When choosing whether to have an |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
controller
Looks good so far. We need some integration or even e2e tests for this. |
You mean distinct from the integration tests for the apiextensions-server? |
73d79e7
to
22193fd
Compare
|
||
// TPRs are enabled and not yet beta, since this these are the successor, they fall under the same enablement rule | ||
// Subsequent API servers in between here and kube-apiserver will need to be gated. | ||
// These come first so that if someone registers both a TPR and a CRD, the CRD is preferred. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is your rationale for preferring CRD? I'm thinking of a scenario like this:
- TPR already exists and is being used.
- Upgrade to 1.7.
- Accidentally create CRD that conflicts.
- Effectively all your TPR data just got deleted. Outage ensues.
I would think then it actually makes more sense to let TPR have precedence over CRD. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is your rationale for preferring CRD? I'm thinking of a scenario like this:
TPR already exists and is being used.
Upgrade to 1.7.
Accidentally create CRD that conflicts.
Effectively all your TPR data just got deleted. Outage ensues.
I would think then it actually makes more sense to let TPR have precedence over CRD. What do you think?
I wanted to prefer the more current API and it makes finalization logic simpler. Otherwise we'll be considering non-REST API approaches to finalization to avoid deleting all your TPR instances.
We do have a spot that sits above both APIs and could have knowledge of them to avoid collisions. An admission plugin could be written to prevent conflicts between these.
Added tests, this is ready for review. |
hack/make-rules/test-cmd-util.sh
Outdated
sleep ${wait} | ||
done | ||
|
||
kube::log::error "Timed out waiting for non-native-resources; tried ${times} waiting ${wait} between each" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
${wait}s
Looks good so far. Some older comments still open. |
Got the typos. |
Deserves a release note. |
done |
nit: why "logical"? They are the successor. |
lgtm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
To catch this up to date with the migration conversation. This may move ordering with respect to the existing kube-apiserver overall, but it will still be included, so the "normal" client usage isn't affected. |
Automatic merge from submit-queue (batch tested with PRs 46022, 46055, 45308, 46209, 43590) |
@deads2k: The following test(s) failed:
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. |
To reduce operation complexity, we decided to include the kube-apiextensions-server inside of kube-apiserver (https://github.com/kubernetes/community/blob/master/sig-api-machinery/api-extensions-position-statement.md#q-should-kube-aggregator-be-a-separate-binaryprocess-than-kube-apiserver). With the API reasonably well established and a finalizer about merge, I think its time to add ourselves.
This pull wires kube-apiextensions-server ahead of the TPRs so that one will replace the other if both are added by accident (CRDs should have priority) and wires a controller for automatic aggregation.
WIP because I still need tests: unit test for controller, test-cmd test to mirror the TPR test.