-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathk8s-coordinators.yml
113 lines (110 loc) · 2.68 KB
/
k8s-coordinators.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
---
apiVersion: v1
kind: ConfigMap
metadata:
name: leaderless-kv-store-coordinators-config
data:
coordinator-config.yml: |
---
coordinator_node:
rendezvous_hashing_seed: 0
replication_level: 3
storage_node_ids:
- 0
- 1
- 2
- 3
- 4
- 5
dns_service_discovery:
update_interval: 10s
remove_unused_connection_pools_after: 5m
size_of_connection_pools: 8
...
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: leaderless-kv-store-coordinators
spec:
selector:
matchLabels:
app: leaderless-kv-store-coordinators
replicas: 3
template:
metadata:
labels:
app: leaderless-kv-store-coordinators
spec:
containers:
- name: leaderless-kv-store-coordinator
image: ghcr.io/46bit/leaderless-key-value-store:latest
ports:
- containerPort: 8080
env:
- name: BIND_ADDRESS
value: :8080
- name: DNS_SD_STORAGE_NODE_DOMAIN
value: leaderless-kv-store-storage-nodes.default.svc.cluster.local
- name: DNS_SD_STORAGE_NODE_PORT
value: "8080"
- name: GRPC_GO_RETRY
value: "on"
command: [ "/app/bin/coordinator", "/mnt/coordinator-config.yml" ]
volumeMounts:
- name: leaderless-kv-store-coordinators-config
mountPath: /mnt
volumes:
- name: leaderless-kv-store-coordinators-config
configMap:
name: leaderless-kv-store-coordinators-config
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
podAffinityTerm:
topologyKey: "kubernetes.io/hostname"
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- leaderless-kv-store-coordinators
---
apiVersion: v1
kind: Service
metadata:
name: leaderless-kv-store-coordinators
spec:
ports:
- port: 80
targetPort: 8080
selector:
app: leaderless-kv-store-coordinators
...
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: leaderless-kv-store
annotations:
kubernetes.io/ingress.class: nginx
cert-manager.io/cluster-issuer: letsencrypt
nginx.ingress.kubernetes.io/backend-protocol: "GRPC"
spec:
tls:
- hosts:
- leaderless-kv-store.46bit.cloud
secretName: leaderless-kv-store-tls
rules:
- host: leaderless-kv-store.46bit.cloud
http:
paths:
- pathType: Prefix
path: /
backend:
service:
name: leaderless-kv-store-coordinators
port:
number: 80
...