forked from darcys22/godbledger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathk8s.04.godbledger.yml
79 lines (79 loc) · 1.93 KB
/
k8s.04.godbledger.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
apiVersion: v1
kind: Service
metadata:
name: godbledger
namespace: godbledger
spec:
type: NodePort
selector:
app: godbledger
role: server
ports:
- port: 8080
targetPort: 8080
nodePort: 30080
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: godbledger
namespace: godbledger
labels:
app: godbledger
role: server
spec:
replicas: 1
selector:
matchLabels:
app: godbledger
role: server
strategy:
rollingUpdate:
maxSurge: 100%
maxUnavailable: 0
type: RollingUpdate
template:
metadata:
labels:
app: godbledger
role: server
spec:
containers:
- name: godbledger
image: godbledger:latest
imagePullPolicy: Never # change this when deploying to a real cluster
ports:
- containerPort: 8080
env:
- name: MYSQL_DATABASE
value: ledger
- name: MYSQL_USER
valueFrom:
secretKeyRef:
name: mysql-creds
key: godbledger_user
- name: MYSQL_PASSWORD
valueFrom:
secretKeyRef:
name: mysql-creds
key: godbledger_pass
- name: WAIT_HOSTS
value: mysql:3306
- name: WAIT_HOSTS_TIMEOUT
value: '300'
- name: WAIT_SLEEP_INTERVAL
value: '10'
- name: WAIT_HOST_CONNECT_TIMEOUT
value: '10'
command:
- ./wait_entrypoint.sh # delays server start until mysql is responding on port 3306
- ./godbledger
- --verbosity=debug
- --rpc-host=0.0.0.0 # listen to traffic from all ips
- --rpc-port=8080
- --datadir=/var/lib/ledger
- --config=/var/lib/ledger/config.toml
- --database=mysql
- "--database-location=$(MYSQL_USER):$(MYSQL_PASSWORD)@tcp(mysql:3306)/$(MYSQL_DATABASE)?charset=utf8mb4,utf8"
restartPolicy: Always
terminationGracePeriodSeconds: 10