...
/Splitting the Pod and Establishing Communication through Services
Splitting the Pod and Establishing Communication through Services
Learn how to split Pods, create a separate DB Pod, and a Service to communicate with it.
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.
Press + to interact
apiVersion: apps/v1kind: ReplicaSetmetadata:name: go-demo-2-dbspec:selector:matchLabels:type: dbservice: go-demo-2template:metadata:labels:type: dbservice: go-demo-2vendor: MongoLabsspec:containers:- name: dbimage: mongo:3.3ports:- containerPort: 28017
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, ...
Access this course and 1400+ top-rated courses and projects.