-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathk8s-storage-nodes.yml
98 lines (96 loc) · 2.6 KB
/
k8s-storage-nodes.yml
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
# FIXME: PERSISTENT STORAGE
---
apiVersion: v1
kind: ConfigMap
metadata:
name: leaderless-kv-store-storage-nodes-config
data:
storage-nodes-config.yml: |
---
storage_node:
bind_address: :8080
bind_metrics_address: :8081
clock_epoch_file_path: /mnt/data/storage_node_clock_epoch
badger_db_folder: /mnt/data/storage_node_badgerdb
...
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: leaderless-kv-store-storage-nodes
spec:
selector:
matchLabels:
app: leaderless-kv-store-storage-nodes
serviceName: leaderless-kv-store-storage-nodes
replicas: 6
template:
metadata:
labels:
app: leaderless-kv-store-storage-nodes
spec:
containers:
- name: leaderless-kv-store-storage-node
image: ghcr.io/46bit/leaderless-key-value-store:latest
ports:
- containerPort: 8080
env:
- name: BIND_ADDRESS
value: :8080
- name: STORAGE_NODE_CONFIG_PATH
value: /mnt/config/storage-nodes-config.yml
command: [ "/app/bin/k8s-storage-node-startup.sh"]
volumeMounts:
- name: leaderless-kv-store-storage-nodes-config
mountPath: /mnt/config
- name: leaderless-kv-store-storage-data
mountPath: /mnt/data
volumes:
- name: leaderless-kv-store-storage-nodes-config
configMap:
name: leaderless-kv-store-storage-nodes-config
- name: leaderless-kv-store-storage-data
persistentVolumeClaim:
claimName: leaderless-kv-store-storage-data
initContainers:
- name: do-block-storage-permission-fix
image: busybox
command: ["/bin/chmod","-R","777", "/mnt/data"]
volumeMounts:
- name: leaderless-kv-store-storage-data
mountPath: /mnt/data
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
podAffinityTerm:
topologyKey: "kubernetes.io/hostname"
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- leaderless-kv-store-storage-nodes
volumeClaimTemplates:
- metadata:
name: leaderless-kv-store-storage-data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 25Gi
storageClassName: do-block-storage
---
apiVersion: v1
kind: Service
metadata:
name: leaderless-kv-store-storage-nodes
spec:
clusterIP: None
ports:
- port: 80
targetPort: 8080
selector:
app: leaderless-kv-store-storage-nodes
...