oday was all about Kubernetes networking and self-healing. I dove into the theory of Services and did some chaos engineering with ReplicaSets.
🧠 Theory: Kubernetes Services
If Pods are mortal (they die and change IPs), Services are the immortal static address we use to find them.
I learned that a Service enables network access to a set of Pods. Instead of tracking changing IP addresses, a Service provides a stable endpoint (ClusterIP, NodePort, or LoadBalancer) that distributes traffic to the backend Pods. It’s the glue that holds the microservices communication together.
💻 Practical: ReplicaSets & Desired State
I moved from theory to the terminal to test ReplicaSets.
The core concept here is Desired State vs. Actual State.
Desired: "I want 3 copies of this app running."
Actual: "There are currently 3 copies running."
The Experiment: I created a ReplicaSet and then manually "killed" a Pod to see what would happen.
# Deleting a pod manually
kubectl delete pod my-app-12345
The Result: The ReplicaSet controller immediately detected that Actual < Desired. Within seconds, it scheduled a new Pod to bring the count back up to 3.
It was a great visual representation of how K8s handles high availability. It doesn't just launch containers; it actively watches them to ensure the cluster matches your configuration.
Has anyone else here played with breaking their own clusters to see how they fix themselves? Let me know in the comments!
Linkedin: https://www.linkedin.com/in/dasari-jayanth-b32ab9367/
Top comments (0)