Documentation
¶
Overview ¶
Package webhook provides the mutating admission webhook handler for rewriting secret volumes to point to shadow secrets.
Index ¶
Constants ¶
View Source
const ( SecretName = "kloak-webhook-certs" CertKey = "tls.crt" KeyKey = "tls.key" )
View Source
const ( // LabelEnabled is the label used to enable Kloak on a pod or namespace. // Pod-level enablement uses a label (not annotation) so that Kubernetes // objectSelector can match it, allowing the webhook to be scoped precisely. LabelEnabled = "getkloak.io/enabled" // AnnotationEnabled is the annotation injected by the webhook onto mutated pods. // The controller (DaemonSet) reads this to determine if a pod is kloak-enabled. AnnotationEnabled = "getkloak.io/enabled" )
View Source
const ( // AnnotationHosts is the hostname/IP a secret may be sent to. AnnotationHosts = "getkloak.io/hosts" // AnnotationPort restricts a secret to a specific port (or port/proto). AnnotationPort = "getkloak.io/port" )
Variables ¶
This section is empty.
Functions ¶
func EnsureWebhookCerts ¶
EnsureWebhookCerts generates a self-signed certificate for the mutating webhook if the secret does not already exist in the cluster.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(c client.Client, log *zap.SugaredLogger) *Handler
type SecretValidator ¶ added in v0.1.1
type SecretValidator struct {
// contains filtered or unexported fields
}
SecretValidator is a ValidatingAdmissionWebhook for kloak-enabled Secrets. It rejects configurations that would silently bypass runtime filters (e.g. a host label longer than the BPF map can compare).
func NewSecretValidator ¶ added in v0.1.1
func NewSecretValidator(log *zap.SugaredLogger) *SecretValidator
Click to show internal directories.
Click to hide internal directories.