百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
K

kubewebhook

> 云原生
开源

使用 Go 框架创建 Kubernetes 可变和验证的 Webhook

631 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

使用 Go 框架创建 Kubernetes 可变和验证的 Webhook

kubewebhook

Kubewebhook is a small Go framework to create external admission webhooks for Kubernetes.

With Kubewebhook you can make validating and mutating webhooks in any version, fast, easy, and focusing mainly on the domain logic of the webhook itself.

Features

  • Ready for mutating and validating webhook kinds.
  • Abstracts webhook versioning (compatible with v1beta1 and v1).
  • Resource inference (compatible with CRDs and fallbacks to Unstructured).
  • Easy and testable API.
  • Simple, extensible and flexible.
  • Multiple webhooks on the same server.
  • Webhook metrics (RED) for Prometheus with Grafana dashboard included.
  • Webhook tracing with Opentelemetry support.
  • Supports warnings.

Getting started

Use github.com/slok/kubewebhook/v2 to import Kubewebhook v2.

…

You can get more examples in here

Production ready example

This repository is a production ready webhook app: https://github.com/slok/k8s-webhook-example

It shows, different webhook use cases, app structure, testing domain logic, kubewebhook use case, how to deploy...

Static and dynamic webhooks

We have 2 kinds of webhooks:

  • Static: Common one, is a single resource type webhook.
    • Use mutating.WebhookConfig.Obj to configure.
    • Use validating.WebhookConfig.Obj to configure.
  • Dynamic: Used when the same webhook act on multiple types, unknown types and/or is used for generic stuff (e.g labels).
    • To use this kind of webhook, don't set the type on the configuration or set to nil.
    • If a request for an unknown type is not known by the webhook libraries, it will fallback to runtime.Unstructured object type.
    • Very useful to manipulate multiple resources on the same webhook (e.g Deployments, Statefulsets).
    • CRDs are unknown types so they will fallback to runtime.Unstructured`.
    • If using CRDs, better use Static webhooks.
    • Very useful to maniputale any metadata based validation or mutations (e.g Labels, annotations...)

Compatibility matrix

To know the validated compatibility, check the integration tests on CI.

Kubewebhook Kubernetes Admission reviews Dynamic webhooks OpenTelemetry tracing
v2.7 1.31, 1.30, 1.29, 1.28 v1beta1, v1 ✔ ✔
v2.6 1.29, 1.28, 1.27, 1.26 v1beta1, v1 ✔ ✔
v2.5 1.25 v1beta1, v1 ✔ ✔
v2.4 1.24 v1beta1, v1 ✔ ✔
v2.3 1.23 v1beta1, v1 ✔ ✔
v2.2 1.22 v1beta1, v1 ✔ ✔
v2.1 1.21 v1beta1, v1 ✔ ✖
v2.0 1.20 v1beta1, v1 ✔ ✖
v0.11 1.19 v1beta1 ✔ ✖
v0.10 1.18 v1beta1 ✔ ✖
v0.9 1.18 v1beta1 ✖ ✖
v0.8 1.17 v1beta1 ✖ ✖
v0.7 1.16 v1beta1 ✖ ✖
v0.6 1.15 v1beta1 ✖ ✖
v0.5 1.14 v1beta1 ✖ ✖
v0.4 1.13 v1beta1 ✖ ✖
v0.3 1.12 v1beta1 ✖ ✖
v0.2 1.11 v1beta1 ✖ ✖
v0.2 1.10 v1beta1 ✖ ✖

Documentation

You can access here.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Goadmissionapiservercontrollerk8s

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类云原生
定价开源

> 相关工具

K
Kubernetes
容器编排事实标准
H
Helm
Kubernetes 包管理器
S
seaweedfs
SeaweedFS is a distributed storage system for object storage (S3), file systems, and Iceberg tables,