Splitting the Pod and Establishing Communication through Services
Explore how to split a Kubernetes Pod into separate components and establish communication between them using Services. Understand ReplicaSets for managing Pod replicas and how Services support fixed DNS communication within the cluster. Gain practical experience creating ReplicaSets and Services to maintain database and API Pods communicating internally.
We'll cover the following...
We'll cover the following...
Looking into the definition
Let’s look at a ReplicaSet definition go-demo-2-db-rs.yml for a Pod with only the database.
We’ll comment only on the things that changed.
Since this ReplicaSet defines only the database, we reduce the number of replicas to 1. We should scale MongoDB as well, but that’s out of the scope of this chapter. For now, we’ll consider that one replica of a database is enough.
Since selector ...