← Back to Kube-Zen

Shared Library for Zen Tools

Reusable components for Kubernetes operators and controllers, eliminating code duplication across zen-flow, zen-lock, zen-watcher, and other Zen tools

LaunchedOpen Source

What is zen-sdk?

zen-sdk provides reusable components for Kubernetes operators and controllers, eliminating code duplication across zen-flow, zen-lock, zen-watcher, and other Zen tools.

Philosophy: Do not create a monorepo. Create a shared library. Each tool is a separate repository, but they share common code through zen-sdk.

Components

πŸ‘‘

Leader Election

Simple, consistent API for enabling HA with controller-runtime's built-in leader election

πŸ“Š

Prometheus Metrics

Standard Prometheus metrics setup and common metrics for Kubernetes controllers

πŸ“

Structured Logging

Consistent structured logging configuration across all tools

πŸ”„

Graceful Shutdown

Standardized graceful shutdown helpers for HTTP servers, gRPC servers, and worker services

πŸ”

Retry Logic

Exponential backoff retry logic with context cancellation support for Kubernetes operations

πŸ”

Event Deduplication

Event deduplication package for preventing duplicate observations within configurable time windows

Quick Start

1

Install zen-sdk

go get github.com/kube-zen/zen-sdk@latest
2

Import Components

import (
    "github.com/kube-zen/zen-sdk/pkg/leader"
    "github.com/kube-zen/zen-sdk/pkg/metrics"
    "github.com/kube-zen/zen-sdk/pkg/logging"
)

Get Started

Ready to build Kubernetes controllers? Check out the Hello Controller example and start using zen-sdk today.