module
Version:
v0.3.1
Opens a new window with list of versions in this module.
Published: Jan 11, 2023
License: Apache-2.0
Opens a new window with license information.
README
¶
k8s-sizing-webhook
A production ready Kubernetes admission webhook making sure resources are sized correctly using Kubewebhook.
The webhook is based on the production ready Kubewebhook example and comes with:
- Clean and decouple structure.
- Metrics.
- Gracefull shutdown.
- Testing webhooks.
- Serve multiple webhooks on the same application.
Structure
The application is mainly structured in 3 parts:
main
: This is where everything is created, wired, configured and set up, cmd/k8s-sizing-webhook.
http
: This is the package that configures the HTTP server, wires the routes and the webhook handlers. internal/http/webhook.
- Application services: These services have the domain logic of the validators and mutators:
mutation/mem
: Logic for memfix.bitteeinbit.dev
webhook.
mutation/cpu
: Logic for remove-cpu-limit.bitteeinbit.dev
webhook. (TODO)
You can use the example YAML deploy
folder to deploy it.
Webhooks
memfix.bitteeinbit.dev
- Webhook type: Mutating.
- Resources affected:
deployments
, daemonsets
, cronjobs
, jobs
, statefulsets
, pods
This webhooks makes the memory guaranteed. This way OOM can be reduced because memory balloning is avoided.
- If both requests and limits are provided, the limit is also used for requests.
- If only requests is set, then limit is set to requests' value.
- If no value is provided, then the resource is left alone.
Directories
¶
cmd
|
|
|
|
internal
|
|
|
|
|
|
|
|
|
|
|
|
Click to show internal directories.
Click to hide internal directories.