← Back to Blog

Kubernetes ConfigMaps & Secrets: Manage Configuration

How to use Kubernetes ConfigMaps and Secrets: creation, mounting, environment variables, and best practices.

ConfigMap

apiVersion: v1\nkind: ConfigMap\nmetadata:\n  name: app-config\ndata:\n  DATABASE_HOST: postgres\n  LOG_LEVEL: info

Secret

apiVersion: v1\nkind: Secret\nmetadata:\n  name: app-secrets\ntype: Opaque\nstringData:\n  DATABASE_PASSWORD: mysecretpass

Try It Free

Use our free online tool — 100% client-side, no data leaves your browser.

Open YAML Validator

Related Tools & Articles