πKubernetes Secrets Basics Labs
π― Objective
π§° Prerequisites
πΉ Lab 1: Create a Secret and Mount It as a Volume
Step 1: Create the secret
kubectl create secret generic db-creds \
--from-literal=username=admin \
--from-literal=password='S3cureP@ss'Step 2: Mount secret as volume
Step 3: Run the pod
Step 4: Check the secrets
πΉ Lab 2: Avoid Using Environment Variables (But Here's How)
Step 1: Mount secret as environment variables
Step 2: Run the pod
Step 3: Expose secrets
πΉ Lab 3: Use Sealed Secrets (Bitnami)
Step 1: Install the controller
Step 2: Install kubeseal client
Step 3: Use kubeseal
πΉ Lab 4: Use External Secret Managers
β
Wrap-Up
Last updated