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

make webhook admission kind of work #16861

Merged

Conversation

deads2k
Copy link
Contributor

@deads2k deads2k commented Oct 13, 2017

This is done to support openshift/kubernetes-namespace-reservation#3 . It contains multiple fixes needed to make webhooks run at all. In addition, it changes validation rules and admission handling until we get changes like kubernetes/kubernetes#53826 into the API.

This affects handling and compatibility of an alpha feature.

@dgoodwin @abhgupta be ready for upgrade pain in this area.
@bparees I turned this on in cluster-up. Surgery was relatively minor

@deads2k deads2k added the kind/bug Categorizes issue or PR as related to a bug. label Oct 13, 2017
@openshift-merge-robot openshift-merge-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 13, 2017
@openshift-ci-robot openshift-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Oct 13, 2017
@bparees
Copy link
Contributor

bparees commented Oct 13, 2017

cluster up changes lgtm.

@deads2k
Copy link
Contributor Author

deads2k commented Oct 13, 2017

/retest

@dgoodwin
Copy link
Contributor

Upgrade pain just in the sense that we'll need a build deployed with this change before we can get anything operational?

@deads2k
Copy link
Contributor Author

deads2k commented Oct 13, 2017

Upgrade pain just in the sense that we'll need a build deployed with this change before we can get anything operational?

Alpha fields are alpha. The API will change and your webhook admission will either disappear or start failing.

@deads2k
Copy link
Contributor Author

deads2k commented Oct 13, 2017

/retest

@openshift-merge-robot openshift-merge-robot added the vendor-update Touching vendor dir or related files label Oct 14, 2017
@@ -144,6 +145,14 @@ func NewPluginInitializer(
cloudConfig,
restMapper,
quotaRegistry)
// upstream broke this, so we can't use their mechanism. We need to get an actual client cert and practically speaking privileged loopback will always have one
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

broke what?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

broke what?

They wire to the wrong client cert: kubernetes/kubernetes#53828 . Also, it's built such that using the "normal" constructor produces a plugin initializer that will panic on a "normal" admission chain.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That link helps. Next time I read your PR description.

@@ -45,6 +45,8 @@ import (
"k8s.io/kubernetes/pkg/kubeapiserver/admission/configuration"

// install the clientgo admission API for use with api registry
"strings"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

order

@deads2k deads2k force-pushed the cli-08-clusterup-admission branch 3 times, most recently from b9fcab6 to 3d06084 Compare October 16, 2017 13:53
openshift-merge-robot added a commit that referenced this pull request Oct 16, 2017
Automatic merge from submit-queue (batch tested with PRs 16867, 16231).

remove unnecessary anonymous function

There is an upstream replacement for this function.  This cleans up the last usages.

blocks #16861
/kind bug
@@ -19,6 +19,8 @@ import (
kapi "k8s.io/kubernetes/pkg/api"

"github.com/openshift/origin/pkg/cmd/util"

_ "github.com/openshift/origin/pkg/api/install"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how is this related to the PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how is this related to the PR?

if the APIs aren't installed, their fake apiserver fails.

response := &admissionv1alpha1.AdmissionReview{}
if err := client.Post().Context(ctx).Body(&request).Do().Into(response); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did this work upstream?

@sttts
Copy link
Contributor

sttts commented Oct 16, 2017

Commented on the upstream PRs.

@deads2k deads2k force-pushed the cli-08-clusterup-admission branch from 3d06084 to 329cf75 Compare October 16, 2017 17:39
@deads2k deads2k force-pushed the cli-08-clusterup-admission branch from 329cf75 to b8e3c19 Compare October 16, 2017 17:41
@deads2k
Copy link
Contributor Author

deads2k commented Oct 16, 2017

comments addressed

@deads2k deads2k added the lgtm Indicates that a PR is ready to be merged. label Oct 16, 2017
@deads2k
Copy link
Contributor Author

deads2k commented Oct 16, 2017

/retest

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@sttts
Copy link
Contributor

sttts commented Oct 17, 2017

/lgtm

@openshift-merge-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deads2k, sttts

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

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot
Copy link
Contributor

/test all [submit-queue is verifying that this PR is safe to merge]

@openshift-merge-robot
Copy link
Contributor

Automatic merge from submit-queue (batch tested with PRs 16861, 16438).

@openshift-merge-robot openshift-merge-robot merged commit 20db538 into openshift:master Oct 17, 2017
@openshift-ci-robot
Copy link

@deads2k: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
ci/openshift-jenkins/extended_conformance_install_update b8e3c19 link /test extended_conformance_install_update

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.

@@ -144,6 +145,14 @@ func NewPluginInitializer(
cloudConfig,
restMapper,
quotaRegistry)
// upstream broke this, so we can't use their mechanism. We need to get an actual client cert and practically speaking privileged loopback will always have one
kubePluginInitializer.SetClientCert(privilegedLoopbackConfig.TLSClientConfig.CertData, privilegedLoopbackConfig.TLSClientConfig.KeyData)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where can a webhook find the CA that signs this cert?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where can a webhook find the CA that signs this cert?

This cert is signed by the client CA for the apiservers. Since the our webhook apiservers are run as aggregated API servers, they automatically trust that CA (though a user could wire it differently). That means that normal cluster authentication and authorization (rbac) rules apply.

@deads2k deads2k deleted the cli-08-clusterup-admission branch January 24, 2018 14:36
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. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. vendor-update Touching vendor dir or related files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants