π Week 7: Kubernetes Basics & Advanced Challenge


This week was all about Kubernetes β the backbone of modern container orchestration. If Docker helps us package applications, Kubernetes ensures those containers run at scale, reliably, and securely. Through the SpringBoot BankApp project, I explored real-world Kubernetes scenarios that DevOps engineers face daily: deployments, networking, storage, scaling, RBAC, job scheduling, and even advanced tools like Helm and Service Mesh.
πΉ Task 1: Kubernetes Architecture & Deploying a Pod
π Understanding Kubernetes Architecture
Kubernetes follows a master-worker model:
Control Plane (Master)
API Server β Acts as the "front door" of the cluster. All commands (
kubectl
) go here.etcd β The "database" of Kubernetes, stores the desired cluster state.
Scheduler β Assigns pods to nodes based on resource availability.
Controller Manager β Ensures actual state = desired state (e.g., ReplicaSet ensures required pods are running).
Cloud Controller β Integrates with cloud providers (AWS, GCP, Azure).
Worker Nodes
Kubelet β Talks to API Server, ensures containers are running.
Kube Proxy β Handles service networking inside the cluster.
Container Runtime β Docker/Containerd runs the actual containers.
π¦ Deploying a Pod
I created my first Pod running NGINX:
apiVersion: v1
kind: Pod
metadata:
name: nginx-pod
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:latest
ports:
- containerPort: 80
Applied with:
kubectl apply -f pod.yaml
β Learned that Pods are the smallest deployable unit in Kubernetes.
πΉ Task 2: Deployments, StatefulSets, DaemonSets & Namespaces
Kubernetes has different controllers to manage Pods efficiently.
- Namespace β Used for isolating resources.
apiVersion: v1
kind: Namespace
metadata:
name: bankapp-namespace
- Deployment β Manages stateless pods. If a pod fails, Deployment ensures a new one comes up.
apiVersion: apps/v1
kind: Deployment
metadata:
name: bankapp-deployment
namespace: bankapp-namespace
spec:
replicas: 3
selector:
matchLabels:
app: bankapp
template:
metadata:
labels:
app: bankapp
spec:
containers:
- name: bankapp
image: bankapp:latest
ports:
- containerPort: 8080
StatefulSet β Best for databases (stable network IDs + persistent storage).
DaemonSet β Runs one pod per node (useful for logging/monitoring agents).
π Key takeaway:
Deployment = stateless apps
StatefulSet = databases, queues
DaemonSet = monitoring/security
πΉ Task 3: Networking & Exposure
By default, pods are ephemeral and isolated. To expose them:
ClusterIP β Default service, internal-only.
NodePort β Exposes service on each nodeβs IP with a static port.
LoadBalancer β Cloud provider provisioned LB for external traffic.
Example Service YAML:
apiVersion: v1
kind: Service
metadata:
name: bankapp-service
namespace: bankapp-namespace
spec:
selector:
app: bankapp
ports:
- port: 80
targetPort: 8080
type: NodePort
Ingress β Provides HTTP routing + SSL termination.
Network Policies β Control who can talk to whom in the cluster.
π This is where real production apps get secured.
πΉ Task 4: Storage Management
Apps like databases need persistent storage:
Persistent Volume (PV) β Storage provided by admin.
Persistent Volume Claim (PVC) β App requests for storage.
StorageClass β Enables dynamic provisioning (e.g., AWS EBS, GCP PD).
Example PVC YAML:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: db-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
β Learned how Kubernetes abstracts storage like it does with compute & networking.
πΉ Task 5: ConfigMaps & Secrets
ConfigMap β For environment configs.
Secret β For sensitive data (base64 encoded).
Example:
apiVersion: v1
kind: Secret
metadata:
name: db-secret
type: Opaque
data:
username: YWRtaW4= # admin
password: cGFzc3dvcmQ= # password
π Mounted these into pods β application consumes configs without hardcoding.
πΉ Task 6: Autoscaling & Resource Management
Defined resource requests & limits to ensure fair scheduling:
resources:
requests:
cpu: "100m"
memory: "200Mi"
limits:
cpu: "500m"
memory: "512Mi"
- Implemented Horizontal Pod Autoscaler (HPA):
kubectl autoscale deployment bankapp-deployment --cpu-percent=50 --min=1 --max=5
- Explored Vertical Pod Autoscaler (VPA) for memory-hungry apps.
π Lesson: HPA = scale out, VPA = scale up.
πΉ Task 7: Security & Access Control
β RBAC (Role-Based Access Control)
Created Roles & RoleBindings for different teams:
Admin β full access
Developer β create pods, but not delete critical resources
Tester β read-only
π Simulated unauthorized access β RBAC blocked it.
β Node Taints & Pod Tolerations
Marked a node as critical workloads only.
Only pods with tolerations could run there.
β Pod Disruption Budget (PDB)
Ensured at least 2 pods were always running during upgrades.
πΉ Task 8: Jobs, CronJobs & CRDs
Job β Ran a one-time DB migration.
CronJob β Scheduled daily backups.
CRD (Custom Resource Definition) β Extended Kubernetes with a new resource type.
π CRDs make Kubernetes infinitely extensible.
πΉ Task 9: Bonus β Helm
Created a Helm chart for SpringBoot BankApp β deployed with:
helm install bankapp ./bankapp-chart
π Helm = Kubernetes package manager β simplifies deployments & upgrades.
π‘ Interview Prep Q&A
Q: Whatβs the role of etcd?
A: Stores the entire cluster state (like a database).Q: Deployment vs StatefulSet vs DaemonSet?
A: Deployment = stateless apps, StatefulSet = databases, DaemonSet = per-node agents.Q: HPA vs VPA?
A: HPA scales pods horizontally, VPA adjusts pod resources vertically.Q: Why RBAC?
A: Prevents unauthorized access β critical in multi-team environments.
π Key Takeaways
β
Kubernetes abstracts infra β compute, networking, storage, configs.
β
Learned how to deploy, expose, scale, and secure apps.
β
Explored advanced tools like Helm & CRDs.
β
Gained interview-level knowledge of Kubernetes.
π Final Thoughts
This week was intense! Kubernetes initially feels complex, but breaking it down into architecture β workloads β networking β storage β scaling β security made it manageable.
The SpringBoot BankApp project gave me hands-on exposure that matches real-world DevOps challenges.
Excited to keep building and move towards GitOps + Cloud-native setups in future weeks π
π€ Connect With Me
πLinkedIn: linkedin.com/in/vaishnavi-tandekar
π Blog Series: hashnode.com/@VaishnaviTandekar
π» GitHub Repo: 90DaysOfDevOps
π Hashtags
#90DaysOfDevOps #Kubernetes #DevOps #CloudNative #InterviewPrep #Helm #Microservices
Subscribe to my newsletter
Read articles from Vaishnavi Tandekar directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Vaishnavi Tandekar
Vaishnavi Tandekar
Hey there! Iβm Vaishnavi π Learning DevOps step by step π οΈ Writing what I learn so no one learns alone β¨