ConfigMaps & SecretsBeginner
1Question 1 of 1
yamlWhat is the difference between ConfigMaps and Secrets in Kubernetes?
Explanation & Concept
• ConfigMap: Stores non-confidential configuration data as key-value pairs or configuration files. • Secret: Stores confidential information (passwords, tokens, keys) base64-encoded and can be encrypted at rest in etcd. Both can be injected into containers as environment variables or mounted as files.
Code Example
yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: app-config
data:
APP_ENV: "production"
LOG_LEVEL: "info"How It Works & Key Takeaways
Separating configuration from container images allows updating app settings without rebuilding container images.
Mock Test · 1 Questions · Optional
Ready for Namespaces?
Take a quick test to evaluate yourself, or move straight to the next module.
Beginner1 questions