How ravendb/ravendb-operator works
RavenDB Kubernetes Operator reconciles a RavenDBCluster custom resource into Kubernetes resources, then observes those resources and reports cluster health and status. Admission webhooks validate and default submitted configuration; reconciliation is coordinated by the director and resource-owning actors. The README also identifies TLS/certificate management, external access, persistent storage, bootstrapping, and safety-gated rolling upgrades as product capabilities. Some subsystem links are documented rather than visible in the sampled implementation; those are marked dashed or omitted where the caller is unclear.
Main entry points: ravendbcluster_controller.go Cluster Controller · actor Cluster Actors · director.go Actor Director · webhook.go Admission Hooks
Components 24
Cluster API
- RavenDBCluster CR
api/v1/cluster_types.go
Reconciliation
- Cluster Controller
internal/controller/ravendbcluster_controller.go - Actor Director
pkg/director/director.go - Cluster Actors
pkg/actor - Node Actors
pkg/actor/statefulset_actor.go - Service Actor
pkg/actor/service_actor.go - Kubernetes Builders
pkg/resource - StatefulSet Builder
pkg/resource/statefulset.go - Service Builder
pkg/resource/service.go
Cluster Lifecycle
- Cluster Resources
pkg/resource - Persistent Storage
pkg/resource/volume.go - Cluster Bootstrap
pkg/actor/bootstrapper_actor.go - Lifecycle Hooks
pkg/actor/hooks_actor.go - External Access
pkg/resource/ingress.go - Upgrade Safety Gates
pkg/upgrade
Health And Status
- Resource Collector
pkg/health/resource_collector.go - Health Evaluator
pkg/health/evaluator.go - Cluster Status
api/v1/status_helpers.go
Admission
- Admission Hooks
api/v1/webhook.go - Spec Validators
pkg/webhook/validator - Spec Defaults
pkg/webhook/mutator/mutator.go
Other components
- Operator
- Kubernetes API
- RavenDB Nodes
Connections 25
- Operator → RavenDBCluster CR: submits spec
README.md - RavenDBCluster CR → Admission Hooks: admission request
README.md - Admission Hooks → Spec Validators: registers validators
api/v1/webhook.go - Admission Hooks → Spec Defaults: defaults spec
api/v1/webhook.go - Operator → Cluster Controller: starts manager
- Cluster Controller → RavenDBCluster CR: reads resource
internal/controller/ravendbcluster_controller.go - Cluster Controller → Actor Director: executes actors
internal/controller/ravendbcluster_controller.go - Actor Director → Cluster Actors: dispatches cluster
pkg/director/director.go - Actor Director → Node Actors: dispatches per node
pkg/director/director.go - Node Actors → StatefulSet Builder: builds workload
- Service Actor → Service Builder: builds service
pkg/actor/service_actor.go - Service Builder → Cluster Resources: defines services
pkg/resource/service.go - StatefulSet Builder → Persistent Storage: configures volumes
- Cluster Actors → Cluster Resources: applies resources
- Cluster Actors → Cluster Bootstrap: creates bootstrap job
- Cluster Actors → Lifecycle Hooks: manages hooks
- Cluster Actors → External Access: configures routing
- Cluster Controller → Resource Collector: observes resources
internal/controller/ravendbcluster_controller.go - Resource Collector → Health Evaluator: provides facts
- Health Evaluator → Cluster Status: computes conditions
- Cluster Controller → Cluster Status: patches status
internal/controller/ravendbcluster_controller.go - Cluster Controller → Upgrade Safety Gates: coordinates upgrades
- Cluster Controller → Kubernetes API: applies and reads
- Cluster Resources → Kubernetes API: creates objects
- RavenDB Nodes → Kubernetes API: runs as resources