Managing Dev, Test & Prod the Filmy Way—with Kubernetes Namespaces & Secrets 🎭

🚀 Powering Up Kubernetes: The Adventures of Palukuri, Bhashwanth, and Pawan Kalyan 💥

🌟 Introduction

Imagine you're managing a tech team with three superstars:

  • 👨‍💻 Palukuri: Your cool dev guy writing code and playing with configs

  • 🧪 Bhashwanth: Your careful tester who keeps secrets safe

  • 🔥 Pawan Kalyan: The unstoppable production hero, carrying the show!

Each one works in a different environment—dev, test, and production. But they all need resources, secrets, and settings to get their job done. And guess what? Kubernetes makes it easy to organize, configure, and protect them using:

🧱 Namespaces, 🗃️ ConfigMaps, 🧷 Secrets, and 📏 ResourceQuotas


🏗️ Setting the Stage: Namespaces 🎭

Just like departments in a company, Namespaces separate workloads.

yamlCopyEditapiVersion: v1
kind: Namespace
metadata:
  name: dev
---
apiVersion: v1
kind: Namespace
metadata:
  name: test
---
apiVersion: v1
kind: Namespace
metadata:
  name: production

🎯 Run this:

bashCopyEditkubectl apply -f namespaces.yaml
kubectl get ns

Now we have 3 safe environments: dev, test, and production.


🧩 ConfigMaps: Palukuri’s Playground

Palukuri is in dev mode and loves to configure apps.

yamlCopyEditapiVersion: v1
kind: ConfigMap
metadata:
  name: app-config
  namespace: dev
data:
  LOG_LEVEL: debug
  API_ENDPOINT: https://dev.api.example.com

Palukuri’s pod:

yamlCopyEditmetadata:
  name: palukuri
  namespace: dev
...
env:
  - name: LOG_LEVEL
    valueFrom:
      configMapKeyRef:
        name: app-config
        key: LOG_LEVEL

📦 Boom! ConfigMap loaded—no rebuild, just update and go!


🕵️‍♂️ Secrets: Bhashwanth’s Hidden Treasure

Bhashwanth guards secrets like passwords and tokens 🔐

bashCopyEditkubectl create secret generic db-credentials \
  --namespace=test \
  --from-literal=username=bhash \
  --from-literal=password=s3cret

His pod:

yamlCopyEditmetadata:
  name: bhashwanth
  namespace: test
...
env:
  - name: DB_USER
    valueFrom:
      secretKeyRef:
        name: db-credentials
        key: username

👀 Shh! Only Bhashwanth can read the secret sauce!


🎥 Pawan Kalyan Goes Live in Production

Now enters our mass heroPawan Kalyan 💪
He needs the best DB, passwords, and an optimized environment!

yamlCopyEditmetadata:
  name: pawan-kalyan
  namespace: production
...
env:
  - name: DB_HOST
    valueFrom:
      secretKeyRef:
        name: db-credentials
        key: DB_HOST

He's strong 💥 with:

  • More CPU & memory

  • Secure Secrets

  • Production-ready ConfigMaps


🧮 ResourceQuotas: Keep Them in Check!

You don’t want Palukuri eating all the cluster resources 😅
So set a quota:

yamlCopyEditapiVersion: v1
kind: ResourceQuota
metadata:
  name: dev-quota
  namespace: dev
spec:
  hard:
    requests.cpu: "1"
    limits.cpu: "2"
    pods: "5"

📊 Use kubectl describe quota -n dev to track usage like a pro.


🏁 Conclusion: Kubernetes With Character!

You didn’t just learn Kubernetes. You trained Palukuri, Bhashwanth, and Pawan Kalyan to:

  • 🛡️ Live safely in Namespaces

  • 🔧 Use ConfigMaps for dynamic settings

  • 🔐 Hide secrets using Secrets

  • 📏 Stay under control with ResourceQuotas


🎉 Your Next Steps

  • Try Deployments for replicas.

  • Use Service to expose your heroes.

  • Secure even more with NetworkPolicies.

0
Subscribe to my newsletter

Read articles from BHASHWANTH PALUKURI directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

BHASHWANTH PALUKURI
BHASHWANTH PALUKURI