https://github.com/yankeguo/ezadmis
Tools for building and registering kubernetes admission webhooks
https://github.com/yankeguo/ezadmis
admission-webhook go golang kubernetes toolkit
Last synced: 7 months ago
JSON representation
Tools for building and registering kubernetes admission webhooks
- Host: GitHub
- URL: https://github.com/yankeguo/ezadmis
- Owner: yankeguo
- License: mit
- Created: 2022-09-23T08:56:28.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-01-10T06:09:34.000Z (9 months ago)
- Last Synced: 2025-01-27T05:41:43.025Z (9 months ago)
- Topics: admission-webhook, go, golang, kubernetes, toolkit
- Language: Go
- Homepage:
- Size: 121 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# ezadmis
[](https://pkg.go.dev/github.com/yankeguo/ezadmis)
Tools for building and registering Kubernetes admission webhooks
## Usage
The library `ezadmis` can reduce the complexity of writing a kubernetes admission webhook
.All things you have to do is to implement a handler function.
```go
type WebhookHandler func(ctx context.Context, req *admissionv1.AdmissionRequest, rw WebhookResponseWriter) (err error)
```- Parameters
- `ctx`, context of incoming request
- `request`, incoming `AdmissionRequest`
- `patches`, an optional output of JSONPatch operations for mutating webhook
- Return Values
- `deny`, if not empty, indicating this `AdmissionRequest` should be denied, and a message will be returned
- `err`, error occurred## Example
See [ezadmis-httpcat/main.go](cmd/ezadmis-httpcat/main.go)
## Tools
This repository provides two important tools
- [ezadmis-install](cmd/ezadmis-install)
Reduce the complexity of installing an admission webhook
- [ezadmis-httpcat](cmd/ezadmis-httpcat)
Print the incoming `AdmissionReview` request for debugging
## Extra Tools
See https://github.com/yankeguo/ezadmis-extra
## Credits
GUO YANKE, MIT License