Secret Size and Performance Limits
You'll learn: Why Kubernetes enforces a 1MB size limit on Secrets and how exceeding best practices can hurt cluster performance.
Understanding the 1MB Hard Limit
Kubernetes limits each Secret to 1MB in size. This isn't arbitrary—it's a safeguard. Secrets are stored in etcd, the distributed key-value store that acts as Kubernetes' brain. Think of etcd like a filing cabinet that every cluster decision-maker needs to access quickly. Stuffing massive files into it would slow down the entire system.
When you create a Secret, its data is Base64-encoded (which adds ~33% overhead) and stored in etcd. Every Pod that references that Secret causes the kubelet to fetch and mount it. Large Secrets mean:
- More etcd storage consumed (etcd has limited capacity)
- Slower API server responses (retrieving large objects takes time)
- Increased network traffic to nodes
- Higher memory usage on nodes holding multiple Pods with the same Secret
Best Practices to Avoid Performance Issues
Even though 1MB is the hard limit, aim much smaller:
- Keep Secrets under 100KB when possible
- Store large files (like certificates with long chains) externally in systems designed for bulk storage, and reference them via smaller Secrets containing URLs or access tokens
- Avoid storing entire configuration files as Secrets—use ConfigMaps for non-sensitive data
- Split very large credential sets into multiple Secrets
If you approach 1MB, consider whether you're using the right tool. Secrets are for credentials and keys, not binary payloads or large data files.
Key Takeaway:
Kubernetes limits Secrets to 1MB to protect etcd performance; keep them small (ideally <100KB) and use external storage for larger sensitive files.