Documentation
¶
Overview ¶
cocoon-operator manages Hibernation and CocoonSet CRDs for Cocoon VM pods.
It watches Hibernation CRDs and drives pod hibernate/wake by annotating pods with cocoon.cis/hibernate=true. vk-cocoon detects the annotation and handles the actual VM snapshot/restore lifecycle.
K8s concepts reused:
- Pod stays alive during hibernation (phase=Running, Ready=False, container Waiting "Hibernated"). This prevents RS/STS controllers from recreating it.
- Pod-deletion-cost annotation is used to influence which pod gets selected when the operator needs to work with Deployment scale operations.
- ConfigMap cocoon-vm-snapshots tracks suspended VM snapshots (managed by vk-cocoon).
Usage:
# Install CRDs
kubectl apply -f deploy/crd.yaml
kubectl apply -f deploy/cocoonset-crd.yaml
# Hibernate a pod
kubectl apply -f - <<EOF
apiVersion: cocoon.cis/v1alpha1
kind: Hibernation
metadata:
name: hibernate-bot-1
namespace: prod
spec:
podName: sre-agent-xxx
action: hibernate
EOF
# Wake it up
kubectl patch hibernation hibernate-bot-1 -n prod --type merge -p '{"spec":{"action":"wake"}}'
Directories
¶
| Path | Synopsis |
|---|---|
|
Package cocoonmeta defines shared metadata keys and naming rules used across Cocoon controllers, webhooks, dashboards, and providers.
|
Package cocoonmeta defines shared metadata keys and naming rules used across Cocoon controllers, webhooks, dashboards, and providers. |
|
Package logutil provides a shared log initialization function for cocoonstack projects.
|
Package logutil provides a shared log initialization function for cocoonstack projects. |
|
Package version holds build-time metadata set via ldflags.
|
Package version holds build-time metadata set via ldflags. |
Click to show internal directories.
Click to hide internal directories.