-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path14-StatefulSet.txt
More file actions
48 lines (32 loc) · 1.44 KB
/
Copy path14-StatefulSet.txt
File metadata and controls
48 lines (32 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
*** About Me ***
- Database is a stateful set.
Nodejs(stateless) - passthrough for data query / update.
MongoDB(stateful) - update data based on previous state, query data.
Deployment => abstraction of pods for stateless applications.
StatefulSet => deploy stateful apps and replicate pods.
- Both manage pods and replicate pods.
*** Deployment ***
- Identical and interchangable
- Created in random order with random hashes.
- One Service that load balances to any pod.
*** StatefulSet ***
- Can't be randomly deleted / addressed => Pod Identity.
- Sticky identity for each pod, persistent across any re-scheduling.
- Need synchronization - between Leader and Follower pods.
- New Follower clones from previous pod in sequence and will listen from Leader.
- All data will be lost when all pods die !!!!
- Each pod state and data is stored in Persistent Volume.
- Re-scheduled pod is re-attached to a specific Persistent Volume.
- StatefulSet pods are name $(statefulset name)-$(ordinal)
mysql-0, mysql-1, mysql-2
- Leader, Follower, Follower
- Next pod is created only if previous pod is up and running.
- Deletion happens in reverse order starting from last one.
- Each pod has it's DNS endpoint from service.
mysql-0.svc2, mysql-1.svc2
1. Predictable pod name.
2. fixed individual DNS name.
=> IP address changes but name and endpoint stays same.
- Need to configure cloning and data synchronization.
- Make remote storage available.
- Managing and backup.