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

Use Webhook API to v1 #3409

Merged
merged 1 commit into from
Jun 29, 2020
Merged

Conversation

anishj0shi
Copy link
Contributor

@anishj0shi anishj0shi commented Jun 24, 2020

Proposed Changes

  • use v1 apis for ValidatingWebhookConfiguration and MutatingWebhookConfiguration

Also see:
knative/pkg#1444,
knative/serving#8461

Release Note

Eventing Webhooks now use apiextensions.k8s.io/v1 APIs. to ensure smooth upgradability user has to upgrade eventing  from eventing version 0.15.2. Or else, Upgrade might have to be attempted twice, which might have some ramifications such as webhook downtime.

@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Jun 24, 2020
@knative-prow-robot knative-prow-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jun 24, 2020
@lberk
Copy link
Member

lberk commented Jun 24, 2020

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 24, 2020
@anishj0shi
Copy link
Contributor Author

/test pull-knative-eventing-upgrade-tests

@vaikas
Copy link
Contributor

vaikas commented Jun 24, 2020

/lgtm
/approve

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 24, 2020
Copy link
Member

@matzew matzew left a comment

Choose a reason for hiding this comment

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

this looks good!

/lgtm
/approve

But, I guess the tests are failing, since the upgrade is IMO wrong.

@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: anishj0shi, matzew, vaikas

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

@anishj0shi
Copy link
Contributor Author

/test pull-knative-eventing-upgrade-tests

@anishj0shi
Copy link
Contributor Author

@matzew any clue on how can I fix these upgrade tests?

@matzew
Copy link
Member

matzew commented Jun 25, 2020

I've not check the logs, sorry

@matzew
Copy link
Member

matzew commented Jun 25, 2020

or: "STDIN": Internal error occurred: failed calling webhook "config.webhook.eventing.knative.dev": expected webhook response of admission.k8s.io/v1, Kind=AdmissionReview, got /, Kind=
Error from server (InternalError): error when applying patch:
{"metadata":{"annotations":{"kubectl.kubernetes.io/last-applied-configuration":"{\"apiVersion\":\"v1\",\"data\":{\"loglevel.controller\":\"info\",\"loglevel.webhook\":\"info\",\"zap-logger-config\":\"{\\n  \\\"level\\\": \\\"info\\\",\\n  \\\"development\\\": false,\\n  \\\"outputPaths\\\": [\\\"stdout\\\"],\\n  \\\"errorOutputPaths\\\": [\\\"stderr\\\"],\\n  \\\"encoding\\\": \\\"json\\\",\\n  \\\"encoderConfig\\\": {\\n    \\\"timeKey\\\": \\\"ts\\\",\\n    \\\"levelKey\\\": \\\"level\\\",\\n    \\\"nameKey\\\": \\\"logger\\\",\\n    \\\"callerKey\\\": \\\"caller\\\",\\n    \\\"messageKey\\\": \\\"msg\\\",\\n    \\\"stacktraceKey\\\": \\\"stacktrace\\\",\\n    \\\"lineEnding\\\": \\\"\\\",\\n    \\\"levelEncoder\\\": \\\"\\\",\\n    \\\"timeEncoder\\\": \\\"iso8601\\\",\\n    \\\"durationEncoder\\\": \\\"\\\",\\n    \\\"callerEncoder\\\": \\\"\\\"\\n  }\\n}\\n\"},\"kind\":\"ConfigMap\",\"metadata\":{\"annotations\":{},\"labels\":{\"eventing.knative.dev/release\":\"devel\",\"knative.dev/config-category\":\"eventing\",\"knative.dev/config-propagation\":\"original\"},\"name\":\"config-logging\",\"namespace\":\"knative-eventing\"}}\n"},"labels":{"eventing.knative.dev/release":"devel"}}}
to:

I guess, something wrong, with applying this in the upgrade phase ? Perhaps worth to run some of that locally for further debugging ?

@dprotaso
Copy link
Member

pull in the latest knative.dev/pkg

@dprotaso
Copy link
Member

Hm.. it's actually there

// Use the same type meta as the request - this is required by the K8s API
// note: v1beta1 & v1 AdmissionReview shapes are identical so even though
// we're using v1 types we still support v1beta1 admission requests
TypeMeta: review.TypeMeta,

@dprotaso
Copy link
Member

I wonder if there's a race where the new webhook k8s deployment should be deployed prior to the webhook configurations

@dprotaso
Copy link
Member

/retest

@anishj0shi
Copy link
Contributor Author

I wonder if there's a race where the new webhook k8s deployment should be deployed prior to the webhook configurations

we can check this, by changing the prefix numbers of CRDs in config/ dir, right?

@dprotaso
Copy link
Member

I'm just surprised knative/serving didn't encounter this

@dprotaso
Copy link
Member

serving has the webhook.yaml at the bottom of that directory - In my mind that should trigger what you're seeing here.

@knative-prow-robot knative-prow-robot removed the lgtm Indicates that a PR is ready to be merged. label Jun 25, 2020
Rename 500-webhook.yaml to webhook.yaml

Revert "Rename 500-webhook.yaml to webhook.yaml"

This reverts commit edc8230.
@dprotaso
Copy link
Member

/hold

Going forward

  1. Need to figure out why serving's upgrade test didn't catch this
  2. Pull the webhook fix in knative.dev/pkg to older releases branches and cut a few point releases next Tuesday.

#2 will unblock this PR but it will require users to upgrade to that point release prior to upgrading

Another option is to delay merging this PR until the release after next (ie. skip 0.16 and ship in 0.17). But then I would need to rollback the serving change as well.

@matzew
Copy link
Member

matzew commented Jun 25, 2020 via email

@dprotaso
Copy link
Member

Technically conversion web-hooks are also affected - though not all requests need to be converted.

I cherry-picked the right changes here: #3416

So as long as end-users upgrade to the point release that comes out on Tuesday they should be able to smoothly update to 0.16

@grantr
Copy link
Contributor

grantr commented Jun 26, 2020

Thanks @dprotaso for explaining the situation to me on slack. Here's my current understanding:

#3416 will be part of 0.15.2 which will be compatible with v1 webhook api and enable a smooth upgrade.

Anyone upgrading from a pre-0.15.2 version may need to attempt the upgrade twice, and there may be some webhook downtime during the upgrade. But that can be avoided by upgrading to 0.15.2 first. That seems fine to me.

@anishj0shi can you add a release note to this PR explaining the upgrade situation?

@dprotaso
Copy link
Member

Note: we'll have to wait for the point release for the pull-knative-eventing-upgrade-tests to pass :)

@dprotaso
Copy link
Member

New point release is out
/test pull-knative-eventing-upgrade-tests

@dprotaso
Copy link
Member

weird it didn't pick up the point release

Installing Knative Eventing from: https://github.com/knative/eventing/releases/download/v0.15.0/eventing.yaml

@dprotaso
Copy link
Member

dprotaso commented Jun 26, 2020

This seems wrong

# Latest release. If user does not supply this as a flag, the latest
# tagged release on the current branch will be used.
readonly LATEST_RELEASE_VERSION=$(git describe --match "v[0-9]*" --abbrev=0)

with it's use here:

local url="https://github.com/knative/eventing/releases/download/${LATEST_RELEASE_VERSION}"

@knative-test-reporter-robot

The following jobs failed:

Test name Triggers Retries
pull-knative-eventing-upgrade-tests 0/3

Failed non-flaky tests preventing automatic retry of pull-knative-eventing-upgrade-tests:

test/upgrade.TestContinuousEventsPropagationWithProber

@vaikas
Copy link
Contributor

vaikas commented Jun 26, 2020

/test pull-knative-eventing-upgrade-tests

@dprotaso
Copy link
Member

/hold cancel

@knative-prow-robot knative-prow-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 27, 2020
@dprotaso
Copy link
Member

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 27, 2020
@dprotaso
Copy link
Member

/hold

I forgot we should update the release notes

@knative-prow-robot knative-prow-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 27, 2020
@anishj0shi
Copy link
Contributor Author

anishj0shi commented Jun 29, 2020

@dprotaso @grantr
Added Release Notes to the PR :)

@matzew
Copy link
Member

matzew commented Jun 29, 2020

/lgtm

@anishj0shi
Copy link
Contributor Author

/unhold

@knative-prow-robot knative-prow-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 29, 2020
@knative-prow-robot knative-prow-robot merged commit 28e6fb8 into knative:master Jun 29, 2020
@dprotaso
Copy link
Member

Awesome thanks for your patience @anishj0shi while we sorted out the kinks

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. cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants