Memcached Operator Documentation
The Memcached Operator is a Kubernetes operator for managing Memcached clusters, built with the Operator SDK and controller-runtime. It is part of the CobaltCore (C5C3) ecosystem -- a Kubernetes-native OpenStack distribution for operating Hosted Control Planes on bare-metal infrastructure.
The operator automates the deployment, configuration, and lifecycle management of Memcached instances on Kubernetes. Users declare their desired Memcached topology via a Custom Resource, and the operator reconciles the underlying Deployments, Services, PodDisruptionBudgets, ServiceMonitors, and NetworkPolicies.
Capabilities
- Declarative management of Memcached clusters via a Custom Resource
- Automated creation and reconciliation of Deployments, Services, PodDisruptionBudgets, ServiceMonitors, and NetworkPolicies
- Memcached configuration through CRD fields (memory, connections, threads, item size, verbosity)
- Built-in Prometheus monitoring via a
memcached-exportersidecar - High-availability primitives: pod anti-affinity, topology spread constraints, PodDisruptionBudgets, graceful shutdown
- Security: least-privilege RBAC, pod security contexts, optional SASL authentication, optional TLS encryption, NetworkPolicy generation
- Validation and defaulting webhooks
Tech Stack
| Component | Technology |
|---|---|
| Language | Go 1.24+ |
| Scaffolding | Operator SDK / Kubebuilder |
| Runtime | controller-runtime |
| CRD API group | memcached.c5c3.io |
| API versions | v1beta1 (active), v1alpha1 (deprecated) |
| Memcached image | memcached:1.6 |
| Exporter image | prom/memcached-exporter:v0.15.4 |
| Testing | envtest, Chainsaw |
Documentation
Explanation
Background knowledge and architectural context for the operator.
| Document | Description |
|---|---|
| Architecture Overview | Operator architecture, reconciliation loop, design principles, and CobaltCore context |
How-To Guides
Step-by-step instructions for common tasks.
| Document | Description |
|---|---|
| Installation | Install the operator and its prerequisites |
| Upgrade | Upgrade the operator to a new version |
| Migration to v1beta1 | Migrate Memcached CRs from v1alpha1 to v1beta1 |
| Troubleshooting | Diagnose and resolve common issues |
| Examples | Example Memcached CR configurations for common scenarios |
Reference
Detailed technical reference material.
| Document | Description |
|---|---|
| CRD Reference | Complete field reference for the Memcached Custom Resource Definition |
| Backend Reference Docs | Detailed per-feature implementation references covering reconciliation, webhooks, testing, security, and more |
The reference/backend/ directory contains in-depth implementation references for individual features, including:
- Deployment Reconciliation
- Headless Service Reconciliation
- PDB Reconciliation
- ServiceMonitor Reconciliation
- NetworkPolicy Reconciliation
- Idempotent Create-or-Update Pattern
- CRD Generation and Registration
- Memcached CRD Types
- Validation Webhook
- Defaulting Webhook
- Webhook Tests
- Webhook Certificate Management
- Reconciler Scaffold and Watches
- Status Conditions and ObservedGeneration
- Operator Metrics Server
- Exporter Sidecar Injection
- Pod Anti-Affinity Presets
- Topology Spread Constraints
- Graceful Shutdown
- Pod Security Contexts
- TLS Encryption
- Operator RBAC (Least Privilege)
- envtest Integration Tests
- Chainsaw E2E Tests
- CI Pipeline
- Multi-Stage Dockerfile
- Kustomize Deployment Manifests
- Helm Unit Tests
- Project Structure