As Kubernetes clusters scale, cloud infrastructure costs can spiral out of control quickly. FinOps, a cloud cost management methodology that blends finance, technology, and business practices, helps teams achieve cost visibility, optimization, and governance in Kubernetes environments.
FinOps Core Principles
FinOps operates across three phases: Visibility (understanding where costs flow), Optimization (reducing waste and improving efficiency), and Governance (establishing ongoing cost management processes).
Resource Requests and Limits Configuration
Right-sizing resource quotas is the foundation of cost optimization. Here is a typical production configuration:
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: web-app-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: web-app
minReplicas: 3
maxReplicas: 20
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 70
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: 80
---
apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
name: web-app-vpa
spec:
targetRef:
apiVersion: apps/v1
kind: Deployment
name: web-app
updatePolicy:
updateMode: Auto
resourcePolicy:
containerPolicies:
- containerName: '*'
minAllowed:
cpu: 100m
memory: 128Mi
maxAllowed:
cpu: 2
memory: 2GiCost Allocation and Tools
Kubecost enables cost allocation by namespace, label, or workload, giving precise expenditure breakdowns per team. Karpenter, as a dynamic node orchestrator, automatically selects optimal instance types and Spot instances, reducing compute costs by 40-60%. Combined with reclaiming unused resources, setting appropriate Pod requests and limits, and leveraging Spot instances, organizations can achieve significant cost savings on Kubernetes.