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

Add support for v1 AdmissionReview #72

Closed
sagikazarmark opened this issue Sep 27, 2020 · 12 comments
Closed

Add support for v1 AdmissionReview #72

sagikazarmark opened this issue Sep 27, 2020 · 12 comments
Assignees

Comments

@sagikazarmark
Copy link

As pointed out in #55, kubewebhook does not support v1 AdmissionReview, but I assume at some point it will be inevitable to add support for it.

@slok
Copy link
Owner

slok commented Sep 28, 2020

Indeed, Some months back I started adding support for it, but supporting both versions increased the complexity in the code and the API (a lot).

On the other part, supporting v1 instead of v1beta1 doesn't add almost anything. So I decided to stick to v1beta1.

Having said that, I'll not support both versions at the same time, I'll release a v2.x.x of Kubewebhook when v1 is supported, the question is when.

I've been thinking about this this past month and maybe I update Kubewebhook to Kubernetes v1.19 and then on the next version v1.20 remove support for v1beta and use v1 instead.

@sagikazarmark
Copy link
Author

On the other part, supporting v1 instead of v1beta1 doesn't add almost anything.

That may have been the case back then, but I think it will make it harder for users (and I mean both end users and consumers of your library) to reliably move between versions (both webhook and Kubernetes), so I'd reconsider adding support for both versions. Otherwise, webhook developers and their users have to time their upgrades perfectly which might leave some of them stuck on older versions with potential bugs or unpatched security versions.

Anyway, my two cents. Thanks for the library!

@slok slok self-assigned this Oct 21, 2020
@slok
Copy link
Owner

slok commented Oct 23, 2020

Hi, @sagikazarmark!

I started working on this, I'll try supporting both as you said, but for that, I need to refactor the library. This will be an v2 of Kubewebhook (I'll be merging on this branch).

@akpsgit
Copy link

akpsgit commented Nov 22, 2020

Hi @slok, thanks for handling it. Is there any update when this be available?

@slok
Copy link
Owner

slok commented Dec 10, 2020

Hi @akpsgit!

Sorry for the delay, I've been moving to a new house this and the past month, so... my plan is at Christmas, retake this and spent some part of the holidays on it, hoping in January will be ready.

@tpihl
Copy link

tpihl commented Dec 10, 2020

We''re also interested since returing warnings seems to be part of v1

@akpsgit
Copy link

akpsgit commented Dec 13, 2020

@slok thanks for the update!

@slok
Copy link
Owner

slok commented Dec 14, 2020

Hi all!

Just to let you know, this weekend I had some time and continue the work.

I'm already handling webhooks in both versions with the same Mutators and Validators, just small tests, but progress is being made. Need to implement stuff, clean up, and polish things because has been a huge refactor.

It will be a breaking change as I said (is v2), however, your mutator/validator logic should be isolated and shouldn't change, just how you set up, configure and communicate with kubewebhook. hope this new API is easier to use.

Also, knowing that v2 will break the API (in favor of a better API and open to support N versions of webhooks), I've refactored the Prometheus metrics with better insights (e.g tell what is the version of the webhook, warnings...).

On the release, I'll also provide Grafana dashboards for Kubewebhook V2 and some Prometheus alerts examples.

I have some doubts about supporting tracing on V2. Could you give me feedback about this feature, could you tell me if you use it or provides value?

Besides that, When v2 Is ready for a beta, I'll ask you if you can test it. so it helps to release a faster and more reliable v2 from day one.

Many thanks!

@slok
Copy link
Owner

slok commented Dec 31, 2020

Hello there!

I merged v2 into master and publish a new beta release. If you want you can start testing it! I've tested myself and seems to be working correctly (examples, app running for days in a cluster, integration tests...), however, I'm sure I don't have all the use cases identified. so if you could test it would be awesome.

You can import with:

require (
    // ...
	github.com/slok/kubewebhook/v2 v2.0.0-beta.1
    // ...
)

Apart from the examples and the godocs you can check k8s-webhook-example that has been already updated to use kubewebhook v2.

I've didn't add support for tracing (Maybe I'll add it later) and Prometheus metrics aren't compatible anymore, better metrics but the old Grafana dashboard will break, I need some more time to get some dashboards and alerts.

Thanks for all your help!

cc/ @sagikazarmark @akpsgit @tpihl @sstoner @FrimIdan @florisvdg

@slok
Copy link
Owner

slok commented Jan 6, 2021

I just published a Grafana dashboard for v2: https://grafana.com/grafana/dashboards/13685

kubewebhook-v2-general

kubewebhook-v2-mutating

kubewebhook-v2-validating

@slok slok pinned this issue Jan 14, 2021
@slok
Copy link
Owner

slok commented Jan 22, 2021

Hello there!

Anyone had the chance to check v2 since I released v2.0.0-beta.1?

@slok
Copy link
Owner

slok commented Apr 2, 2021

V2.0.0 released.

Closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants