Validate Multi-Container Pod Values
Check values.yaml patterns for pods with sidecars, init containers, and multiple containers. Validate resource settings for each container.
Detailed Explanation
Multi-Container Pod Configuration
Helm charts that deploy pods with multiple containers (sidecars, init containers) have more complex values structures. Each container typically needs its own image and resource configuration.
Common Pattern
image:
repository: my-app
tag: "1.0.0"
pullPolicy: IfNotPresent
sidecar:
enabled: true
image:
repository: envoyproxy/envoy
tag: "v1.28.0"
pullPolicy: IfNotPresent
resources:
limits:
cpu: 200m
memory: 256Mi
requests:
cpu: 100m
memory: 128Mi
initContainers:
- name: wait-for-db
image:
repository: busybox
tag: "1.36"
command: ['sh', '-c', 'until nc -z db 5432; do sleep 1; done']
resources:
limits:
cpu: 50m
memory: 64Mi
requests:
cpu: 25m
memory: 32Mi
resources:
limits:
cpu: 500m
memory: 512Mi
requests:
cpu: 250m
memory: 256Mi
Validation Points
- Main container resources: The top-level
resourcessection applies to the main application container - Sidecar resources: Each sidecar should have its own
resourcessection; missing resources on sidecars can cause node overcommitment - Image configurations: Each container's image should follow the same conventions (repository, tag, pullPolicy)
- Total resource budget: The sum of all container resources should be reasonable for a single pod
Sidecar Patterns
| Pattern | Use Case | Example |
|---|---|---|
| Envoy/Istio proxy | Service mesh | envoyproxy/envoy |
| Log collector | Centralized logging | fluent/fluent-bit |
| Metrics exporter | Monitoring | prom/statsd-exporter |
| Cloud SQL proxy | Database access | gcr.io/cloud-sql-connectors/cloud-sql-proxy |
Best Practices
- Always define resources for sidecar containers to prevent unbounded resource usage
- Use
initContainersfor one-time setup tasks (database migration, config fetching) - Keep sidecar resource requests modest; they share the pod's resource budget
Use Case
Deploying a microservice with an Envoy sidecar proxy and a database migration init container, where total pod resources must fit within node capacity and namespace resource quotas.
Try It — Helm Values Validator
Related Topics
Validate Kubernetes Resource Limits and Requests
Resource Management
Validate Helm Image Configuration Patterns
Basic Configuration
Validate a Basic Web App values.yaml
Basic Configuration
Production Readiness Checklist for Helm Values
Advanced Patterns
Validate HPA Autoscaling Configuration in Helm
Resource Management