forked from quobyte/quobyte-csi-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclient.yaml
104 lines (104 loc) · 3.77 KB
/
client.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: client
namespace: <CHANGE-NAMESPACE>
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
# Your Quobyte registry endpoint
value: <YOUR_QUOBYTE_REGISTRY> # Example: hydrogen.quobyte.com:12354
- name: QUOBYTE_MOUNT_POINT
# Corresponding volume mount must be one directory below this path
# Example volumeMount is : /home/quobyte and clientMountPoint is /home/quobyte/mounts
value: /home/quobyte/mounts
# Enabling access keys requires Quobyte version 3.0 or later
- name: ENABLE_ACCESS_KEY_MOUNTS
value: "false" # to enable, set it to true
- 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
- |
ENABLE_ACCESS_CONTEXTS=""
if [[ ${ENABLE_ACCESS_KEY_MOUNTS} = true ]]; then
ENABLE_ACCESS_CONTEXTS="--enable-access-contexts --no-default-permissions"
fi
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}
if find "$QUOBYTE_MOUNT_POINT" -mindepth 1 -print -quit 2>/dev/null | grep -q .; then
echo "POLLUTED MOUNT POINT DETECTED! Cannot use $QUOBYTE_MOUNT_POINT as a mount point."
echo "Please remove all files and directories from $QUOBYTE_MOUNT_POINT and "
echo "run 'chattr +i $QUOBYTE_MOUNT_POINT' to prevent future mount point pollution."
else
# 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. Mount point pollution is possible."
/usr/bin/mount.quobyte --hostname ${NODENAME} \
--http-port 55000 -f \
-d ${QUOBYTE_CLIENT_LOG_LEVEL} -l /dev/stdout ${OPTS} \
--minidump-path /tmp/minidumps --allow-minidump-upload \
${QUOBYTE_REGISTRY}/ ${QUOBYTE_MOUNT_POINT} ${ENABLE_ACCESS_CONTEXTS}
fi
securityContext:
privileged: true
volumeMounts:
- name: quobyte-mount
mountPath: /home/quobyte
mountPropagation: Bidirectional
- name: minidumps-dir
mountPath: /tmp/minidumps
lifecycle:
preStop:
exec:
command: ["/bin/bash", "-xc", "umount -l ${QUOBYTE_MOUNT_POINT}"]
nodeSelector:
quobyte_client: "true"
volumes:
- name: quobyte-mount
hostPath:
path: /home/quobyte
- name: minidumps-dir
hostPath:
path: /var/lib/quobyte/.minidumps