forked from quobyte/kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
client-ds.yaml
86 lines (83 loc) · 2.55 KB
/
client-ds.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: client
namespace: quobyte
spec:
selector:
matchLabels:
role: client
template:
metadata:
annotations:
prometheus.io/scrape: 'true'
prometheus.io/path: '/prometheus'
prometheus.io/port: '55000'
labels:
role: client
version: "2"
spec:
containers:
- name: quobyte-client
image: quay.io/quobyte/quobyte-client:2
imagePullPolicy: Always
env:
- name: QUOBYTE_CLIENT_LOG_LEVEL
value: INFO
- name: QUOBYTE_REGISTRY
value: registry.quobyte
- name: QUOBYTE_MOUNT_POINT
# Note that the mount point has to be a subdir of the volume(Mount)
value: /mnt/kubernetes.io~quobyte
- name: NODENAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
ports:
- name: http-port
containerPort: 55000
hostPort: 55000
protocol: TCP
readinessProbe:
timeoutSeconds: 5
httpGet:
port: 55000
path: /
livenessProbe:
initialDelaySeconds: 30
timeoutSeconds: 5
httpGet:
port: 55000
path: /
command:
- /bin/bash
- -xec
- |
if cut -d" " -f2 /proc/self/mounts | grep -q ${QUOBYTE_MOUNT_POINT}; then
umount -l ${QUOBYTE_MOUNT_POINT}
fi
mkdir -p /root/.quobyte ${QUOBYTE_MOUNT_POINT}
# set the mount point immutable. As long as mount.quobyte does not run,
# other processes cannot write data to this dir.
chattr +i ${QUOBYTE_MOUNT_POINT} || \
echo "WARNING: The local filesystem does not support IMMUTABLE flag"
/usr/bin/mount.quobyte --hostname ${NODENAME} \
--allow-usermapping-in-volumename --http-port 55000 -f \
-d ${QUOBYTE_CLIENT_LOG_LEVEL} -l /dev/stdout ${OPTS} \
${QUOBYTE_REGISTRY}/ ${QUOBYTE_MOUNT_POINT}
securityContext:
privileged: true
volumeMounts:
- name: k8s-plugin-dir
mountPath: /mnt
mountPropagation: Bidirectional
lifecycle:
preStop:
exec:
command: ["/bin/bash", "-xc", "umount -l ${QUOBYTE_MOUNT_POINT}"]
nodeSelector:
quobyte_client: "true"
volumes:
- name: k8s-plugin-dir
hostPath:
path: /var/lib/kubelet/plugins/