Overview
The dakr-operator (aka "workload operator" or "write operator") receives optimization recommendations and applies them to your Kubernetes workloads.
Write Operator (dakr-op)
The Write Operator receives optimization recommendations from the DevZero platform and applies them to your cluster. It operates within policy boundaries you define -- nothing is changed without your rules allowing it.
What It Does
- Connects to the DevZero platform via a persistent gRPC stream
- Receives recommendations for workload and node group optimization
- Receives CRD updates used by all other DevZero operators (including itself)
- Validates each recommendation against your configured policies
- Applies approved changes as Kubernetes-native operations
Types of Changes
| Action | What Happens | Kubernetes Operation |
|---|---|---|
| Rightsizing | Adjusts CPU/memory requests and limits | Patch Deployment/StatefulSet spec |
| Replica scaling | Adjusts replica count based on traffic patterns | Patch Deployment replicas or HPA |
| Live migration | Resizes workloads without restart | CRIU checkpoint/restore |
| Node consolidation | Marks underutilized nodes for draining | Cordon + drain via Node Operator |
CRDs
The Write Operator creates and manages two Custom Resource Definitions:
WorkloadRecommendation
Represents a pending or applied recommendation for a workload:
apiVersion: dakr.devzero.io/v1alpha1
kind: WorkloadRecommendation
metadata:
name: my-deployment-rec
namespace: production
spec:
targetRef:
kind: Deployment
name: my-deployment
containers:
- name: app
resources:
requests:
cpu: "250m" # current: 1000m
memory: "256Mi" # current: 1Gi
limits:
cpu: "500m"
memory: "512Mi"
status:
phase: Pending # Pending | Approved | Applied | Rejected
projectedSavings: "$42.30/month"NodeGroupRecommendation
Represents a recommendation for node pool optimization:
apiVersion: dakr.devzero.io/v1alpha1
kind: NodeGroupRecommendation
metadata:
name: ng-rec-001
spec:
nodeGroup: default-pool
action: consolidate
targetNodeCount: 3 # current: 5
status:
phase: PendingHow Policies Control It
The Write Operator only applies changes that match active policies. If no policy covers a workload, the recommendation is surfaced in the dashboard but not applied.
See Policies & Rules for details on configuring policies.
Installation
The Write Operator is installed alongside the Read Operator during cluster setup. It can also be installed separately:
helm upgrade --install dakr-operator \
oci://registry-1.docker.io/devzeroinc/dakr-operator \
--namespace dakr-operator \
--create-namespace \
--set clusterID=<your-cluster-id> \
--set apiEndpoint=api.devzero.io:443Security
- The Write Operator's RBAC is scoped to only the resource types it needs to modify (Deployments, StatefulSets, DaemonSets, HPAs)
- All changes are logged and auditable via the DevZero dashboard
- Changes can be rolled back from the dashboard or by deleting the WorkloadRecommendation CRD