Stage 9, Part 4 of 9, Cluster Extensibility (CRDs, Controllers, Operators)

Text

PART 4: CAPACITY PLANNING & COST MODELING

17. Operator Resource Overhead

Typical Operator Resource Usage

ComponentCPU RequestMemory RequestReplicas
controller-runtime100m128Mi1-3
Webhook server100m128Mi3 (HA)
Prometheus Operator200m256Mi1
cert-manager100m128Mi1

Sizing Formula

text
Operator CPU = (Reconcile rate × Reconcile cost) × Replicas
Operator Memory = (Cache size × Object count) + Code overhead

Example:
  - 1,000 CRs
  - 50 KB per CR in cache
  - Memory = 1,000 × 50 KB + 128 MB = 178 MB

Webhook Capacity

Webhook TypeLatencyThroughput
ValidatingAdmissionPolicy (CEL)<1msUnlimited
Simple validating webhook5-20ms~500/s
Complex webhook50-200ms~50/s
Image verification100-500ms~20/s

18. CRD Storage Impact on etcd

CRD Storage Considerations

FactorImpact
CR countMore objects = more storage
CR sizeStatus updates increase size
Version countMore versions = more storage
Update frequencyMore writes = more etcd load

etcd Capacity Planning

CR CountCR SizeEstimated Storage
10010 KB1 MB
1,00010 KB10 MB
10,00010 KB100 MB
100,00010 KB1 GB

Production rule: Keep total etcd size under 2 GB. For large CR counts, consider aggregation or sharding.


19. SLA & Availability Design

Availability Math

text
99.9%   = 8.76 hours downtime/year
99.99%  = 52.56 minutes downtime/year
99.999% = 5.26 minutes downtime/year

Operator SLA Design

TargetArchitecture
99.9%Single operator replica
99.99%2+ replicas, leader election, HA webhooks
99.999%Above + chaos testing, multi-cluster

Webhook HA Requirements

RequirementWhy
3+ replicasSurvive zone failure
PodDisruptionBudgetPrevent all replicas down
Pod anti-affinitySpread across nodes
Service with local trafficReduce latency

1:1 copy of the class Google Doc, code in code blocks.