-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcoderprabhu-mongo-statefulset.yaml
64 lines (64 loc) · 1.69 KB
/
coderprabhu-mongo-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
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: mongo
spec:
serviceName: "mongo"
replicas: 1
selector:
matchLabels:
role: mongo
template:
metadata:
labels:
role: mongo
environment: prod
spec:
terminationGracePeriodSeconds: 10
containers:
- name: mongo
image: mongo
command:
- mongod
- "--replSet"
- rs0
# - "--smallfiles" not supported in mongo 4.2 and above
# - "--noprealloc"
# https://github.com/thesandlord/mongo-k8s-sidecar/pull/3/files
- "--bind_ip_all"
# - "--bind_ip"
# - "0.0.0.0"
ports:
- containerPort: 27017
volumeMounts:
- name: mongo-persistent-storage
mountPath: /data/db
resources:
requests:
cpu: "0.01"
memory: "50Mi"
limits:
cpu: "0.2"
memory: "140Mi"
- name: mongo-sidecar
image: cvallance/mongo-k8s-sidecar
env:
- name: MONGO_SIDECAR_POD_LABELS
value: "role=mongo,environment=prod"
resources:
requests:
cpu: "0.01"
memory: "24Mi"
limits:
cpu: "0.2"
memory: "100Mi"
volumeClaimTemplates:
- metadata:
name: mongo-persistent-storage
annotations:
volume.beta.kubernetes.io/storage-class: "coderprabhu-storage-class-hdd"
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 1Gi