cocoon-operator

command module
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2026 License: MIT Imports: 36 Imported by: 0

README

cocoon-operator

Kubernetes operator that manages VM-backed pod lifecycles through two CRDs: CocoonSet (declarative agent groups) and CocoonHibernation (per-pod hibernate / wake requests).

Both reconcilers are built on controller-runtime and consume the typed CRD shapes shipped from cocoon-common/apis/v1.

Documentation: cocoonstack.github.io/cocoon-operator (source in docs/).

cocoon-operator/
├── main.go              # manager wiring + flag parsing
├── cocoonset/           # CocoonSet reconciler, pod builders, status diff
├── hibernation/         # CocoonHibernation reconciler
└── snapshot/            # snapshot.Registry interface consumed by both reconcilers

Quick start

kubectl apply -k github.com/cocoonstack/cocoon-operator/config/default?ref=main
kubectl -n cocoon-system set env deploy/cocoon-operator \
  OCI_REGISTRY=REGION-docker.pkg.dev/PROJECT/REPO

Full steps, including the ADC-less sa-key overlay, in Installation.

Documentation

Development

make all            # full pipeline: deps + fmt + lint + test + build
make build          # build cocoon-operator binary
make test           # vet + race-detected tests
make lint           # golangci-lint on linux + darwin
make import-crds    # refresh config/crd/bases from cocoon-common
make help           # show all targets

The Makefile detects Go workspace mode (go env GOWORK) and skips go mod tidy when active so cross-module references resolve through go.work without forcing a release of cocoon-common.

Project Role
cocoon-common CRD types, annotation contract, shared helpers, and the OCI registry client
cocoon-webhook Admission webhook for sticky scheduling and CocoonSet validation
vk-cocoon Virtual kubelet provider managing VM lifecycle

License

MIT

Documentation

Overview

Package main is the cocoon-operator entry point. It runs the CocoonSet and CocoonHibernation reconcilers under controller-runtime.

Directories

Path Synopsis
Package cocoonset hosts the CocoonSet reconciler and pod builder helpers.
Package cocoonset hosts the CocoonSet reconciler and pod builder helpers.
Package hibernation drives hibernate/wake transitions for CocoonHibernation CRs.
Package hibernation drives hibernate/wake transitions for CocoonHibernation CRs.
Package metrics defines the prometheus collectors for cocoon-operator.
Package metrics defines the prometheus collectors for cocoon-operator.
Package snapshot contains the shared snapshot-registry interface used by both the CocoonSet and CocoonHibernation reconcilers.
Package snapshot contains the shared snapshot-registry interface used by both the CocoonSet and CocoonHibernation reconcilers.
Package version holds build-time metadata set via ldflags.
Package version holds build-time metadata set via ldflags.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL