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 AdmissionWebhook Examples #20

Open
amouat opened this issue Sep 23, 2020 · 8 comments
Open

Add AdmissionWebhook Examples #20

amouat opened this issue Sep 23, 2020 · 8 comments
Assignees
Labels

Comments

@amouat
Copy link
Contributor

amouat commented Sep 23, 2020

Add examples for ValidatingAdmissionWebhook and MutatingAdmissionWebhook.

It should be possible to use examples from the Kubernetes docs, but please make sure they work standalone.

If you want to pick up this issue, please first read the README.md and CONTRIBUTING.md. Make sure you follow the existing style and standards for other examples.

@Spazzy757
Copy link

Spazzy757 commented Oct 5, 2020

Question on this, obviously you would need some kind of service to route the webhook to right?
Does that fall into the stand alone bit (would I need to create the configuration for the server part as well)?

@amouat
Copy link
Contributor Author

amouat commented Oct 6, 2020

Yeah, good question. It's really one for @ianmiell as this is his project.

Personally, I'd lean towards not including the service and documenting this and what the failure scenario is (I think the default is disallow in validating admission webhooks, but this is probably configurable).

Having said that, it would be easy to build a very simple service and put in a deployment. The major advantage is the reader could also see what goes into the service (assuming you link to the code or put it in here if it's small enough). The disadvantage is we're complicating things and arguably expanding the remit of the repo.

@Spazzy757
Copy link

I will wait for @ianmiell From the look of the other examples there is no space for explanations or comments in the examples so that would make this a "special case" which I don't think fits. That being said, giant swarm does have a simple example that we could possibly use https://docs.giantswarm.io/guides/creating-your-own-admission-controller/ but then we depend on them.

@Spazzy757 Spazzy757 self-assigned this Oct 6, 2020
@ianmiell
Copy link
Collaborator

ianmiell commented Oct 6, 2020 via email

@Spazzy757
Copy link

@ianmiell I had comments (see 3d550b8) but I then realised none of the other examples had inline comments for the yaml so I removed them. What would be the best way forward here?

@ianmiell
Copy link
Collaborator

ianmiell commented Oct 7, 2020 via email

@amouat
Copy link
Contributor Author

amouat commented Oct 7, 2020

We have a webhook for Trow. I don't remember it being that complicated - what's the shell commands you're thinking of? There is a chicken & egg problem - if you have a deployment for the admission service, it needs to run before the webhook is configured.

I think the project should limit itself to k8s YAML and just assume the webhook service exists. That way if someone uses kubectl example ... they would get a minimal bit of YAML that probably helps them.

@ianmiell
Copy link
Collaborator

ianmiell commented Oct 7, 2020 via email

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

No branches or pull requests

3 participants