Skip to main content

Kubernetes ConfigMaps

ConfigMaps vs Secrets

0:00
LearnStep 1/2

ConfigMaps vs Secrets

ConfigMaps vs Secrets

Comparison

FeatureConfigMapSecret
PurposeNon-sensitive configSensitive data
EncodingPlain textBase64
Encryption at restNoOptional
Size limit1MB1MB
RBACStandardCan be restricted

When to Use ConfigMap

  • Configuration files (nginx.conf, application.properties)
  • Environment-specific settings (URLs, feature flags)
  • Non-sensitive parameters

When to Use Secret

  • Passwords and API keys
  • TLS certificates
  • Docker registry credentials
  • OAuth tokens

Using Both Together

yaml