Carbon-Aware Kubernetes
Sustainability in cloud computing isnβt just about PR β itβs about reducing operational costs and meeting corporate ESG commitments. Kubernetes gives you the tools to schedule workloads based on carbon intensity, consolidate resources, and reduce waste.
Carbon-Aware Scheduling with KEDA
Use carbon intensity data to scale workloads:
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: carbon-aware-batch
spec:
scaleTargetRef:
name: batch-processor
minReplicaCount: 0
maxReplicaCount: 10
triggers:
- type: metrics-api
metadata:
targetValue: "200" # Scale up when carbon intensity is low
url: "http://carbon-api.internal/intensity"
valueLocation: "carbonIntensity"
authenticationRef:
name: carbon-api-authWhen the grid is powered by renewables (low carbon intensity), scale up batch processing. When itβs fossil-heavy, scale down.
Green Scheduling with Karmada
Distribute workloads to the greenest region:
apiVersion: policy.karmada.io/v1alpha1
kind: PropagationPolicy
metadata:
name: prefer-green-regions
spec:
resourceSelectors:
- apiVersion: apps/v1
kind: Deployment
placement:
clusterAffinity:
clusterNames:
- eu-north-1 # Sweden (hydro/wind)
- us-west-2 # Oregon (hydro)
replicaScheduling:
replicaSchedulingType: Weighted
weightPreference:
dynamicWeight: AvailableReplicasResource Consolidation
Node Consolidation with Karpenter
apiVersion: karpenter.sh/v1
kind: NodePool
spec:
disruption:
consolidationPolicy: WhenEmptyOrUnderutilized
consolidateAfter: 60s
template:
spec:
requirements:
- key: karpenter.sh/capacity-type
operator: In
values: ["spot"] # Spot instances use otherwise-wasted capacity
- key: node.kubernetes.io/instance-type
operator: In
values: ["m6g.xlarge", "m7g.xlarge"] # ARM instances (more efficient)Right-Sizing with VPA
Over-provisioned pods waste energy:
# Find the worst offenders
kubectl top pods --all-namespaces --sort-by=cpu | head -20Measuring Your Footprint
Kepler (Kubernetes-based Efficient Power Level Exporter)
helm install kepler kepler/kepler -n monitoring
# Kepler exposes per-pod energy consumption via Prometheus metrics
# kepler_container_joules_total{container_name="app", pod_name="api-xyz"}Build Grafana dashboards showing:
- kWh per namespace β charge teams for their energy usage
- Carbon intensity over time β correlate with workload scheduling
- Energy per request β efficiency metric for services
Quick Wins
- Use ARM instances β 40% more energy-efficient than x86 for most workloads
- Scale to zero in dev/staging β no traffic = no pods = no energy
- Compress container images β smaller images = less network transfer = less energy
- Enable pod topology spread β avoid hotspots that require cooling
- Schedule batch jobs at night β grid is often greener during off-peak hours
Impact
A mid-size Kubernetes deployment (100 nodes) can save:
- 30-50% energy through right-sizing and consolidation
- 20-30% more through carbon-aware scheduling
- $50K-200K/year in cloud costs as a side effect
Green computing and cost optimization are the same thing β just measured differently.
Want to reduce your Kubernetes carbon footprint? I help organizations implement sustainable cloud practices. Get in touch.\n

