-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcodis-dashboard-template.yaml
54 lines (54 loc) · 1.71 KB
/
codis-dashboard-template.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
apiVersion: "apps/v1beta1"
kind: StatefulSet
metadata:
name: codis-dashboard-PRODUCT_NAME
spec:
replicas: 1
serviceName: codis-dashboard-PRODUCT_NAME
template:
metadata:
labels:
app: codis-dashboard-PRODUCT_NAME
spec:
imagePullSecrets:
- name: adhoc-docker-registry
containers:
- name: codis-dashboard
image: registry.appadhoc.com:30443/adhoc-cache:3.2
imagePullPolicy: IfNotPresent
command: ["codis-dashboard"]
args: ["-l","/tmp/$(POD_NAME).log","-c","$(CODIS_PATH)/config/dashboard.toml","--host-admin","$(POD_IP):18080", "--zookeeper","$(ZK_ADDR)","--product_name","PRODUCT_NAME","--pidfile","log/dashboard.pid","--remove-lock"]
lifecycle:
postStart:
exec:
command: ["/bin/bash", "-c", "codis-admin --dashboard-list --zookeeper=${ZK_ADDR}"]
preStop:
exec:
command: [/bin/sh", "-c", "PID=$(cat log/dashboard.pid) && kill $PID && while ps -p 1 > /dev/null; do sleep 1; done"]
env:
- name: CODIS_PATH
value: "/gopath/src/github.com/CodisLabs/codis"
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: ZK_ADDR
value: "adhoc-zk-headless:2181"
#- name: PRODUCT_NAME
# value: "codis-test"
#- name: PRODUCT_AUTH
# value: ""
ports:
- containerPort: 18080
name: dashboard
resources:
limits:
cpu: "4"
memory: 4Gi
requests:
cpu: "0.1"
memory: 0.1Gi