-
Notifications
You must be signed in to change notification settings - Fork 455
/
Copy pathm3dbnode-statefulset.yaml
148 lines (148 loc) · 3.39 KB
/
m3dbnode-statefulset.yaml
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# Headless service for the statefulset
apiVersion: v1
kind: Service
metadata:
name: m3dbnode
labels:
app: m3dbnode
namespace: m3db
spec:
ports:
- port: 9000
name: client
- port: 9001
name: cluster
- port: 9002
name: http-node
- port: 9003
name: http-cluster
- port: 9004
name: debug
- port: 7201
name: coordinator
- port: 7203
name: coordinator-metrics
# NOTE: There MUST be a headless (clusterIP == None) service with name equal
# to the `spec.serviceName` field of the stateful set. Search "headless" on
# https://v1-10.docs.kubernetes.io/docs/concepts/workloads/controllers/statefulset/
# for more info
clusterIP: None
selector:
app: m3dbnode
---
apiVersion: v1
kind: Service
metadata:
name: m3coordinator
labels:
app: m3dbnode
namespace: m3db
spec:
selector:
app: m3dbnode
ports:
- port: 7201
name: coordinator
- port: 7203
name: coordinator-metrics
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
labels:
app: m3dbnode
name: m3dbnode
namespace: m3db
spec:
serviceName: m3dbnode
replicas: 3
selector:
matchLabels:
app: m3dbnode
updateStrategy:
type: RollingUpdate
template:
metadata:
labels:
app: m3dbnode
spec:
tolerations:
- key: "dedicated-m3db"
effect: NoSchedule
operator: Exists
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- preference:
matchExpressions:
- key: m3db.io/dedicated-m3db
operator: In
values:
- "true"
weight: 10
containers:
- name: m3db
image: quay.io/m3/m3dbnode:latest
# Allows m3dbnode to raise its own file limits. Comment this out if you
# have a restrictive Pod Security Policy or similar enforcement
# mechanisms.
securityContext:
capabilities:
add:
- SYS_RESOURCE
imagePullPolicy: Always
# resources:
# limits:
# memory: 15Gi
# requests:
# memory: 10Gi
args:
- "-f"
- "/etc/m3db/m3dbnode.yml"
volumeMounts:
- name: config-vol
mountPath: /etc/m3db/
- name: m3db-db
mountPath: /var/lib/m3db
ports:
- containerPort: 9000
name: client
protocol: TCP
- containerPort: 9001
name: cluster
protocol: TCP
- containerPort: 9002
name: http-node
protocol: TCP
- containerPort: 9003
name: http-cluster
protocol: TCP
- containerPort: 9004
name: debug
protocol: TCP
- containerPort: 7201
name: coordinator
protocol: TCP
- containerPort: 7203
# max name length == 15 chars
name: coord-metrics
protocol: TCP
volumes:
- name: config-vol
configMap:
name: m3dbnode-config
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
volumeClaimTemplates:
- metadata:
name: m3db-db
spec:
accessModes:
- ReadWriteOnce
storageClassName: fast
resources:
requests:
storage: 200Gi