forked from codefresh-io/venona
-
Notifications
You must be signed in to change notification settings - Fork 0
/
daemonset.dind-lv-monitor.vp.yaml
76 lines (72 loc) · 2.14 KB
/
daemonset.dind-lv-monitor.vp.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
{{- if eq .Storage.Backend "local" -}}
{{- $localVolumeParentDir := ( .Storage.LocalVolumeParentDir | default "/var/lib/codefresh/dind-volumes" ) }}
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: dind-lv-monitor-{{ .AppName }}
namespace: {{ .Namespace }}
labels:
app: dind-lv-monitor
spec:
selector:
matchLabels:
app: dind-lv-monitor
template:
metadata:
labels:
app: dind-lv-monitor
annotations:
prometheus_port: "9100"
prometheus_scrape: "true"
spec:
serviceAccountName: volume-provisioner-{{ .AppName }}
# Debug:
# hostNetwork: true
# nodeSelector:
# kubernetes.io/role: "node"
tolerations:
- key: 'codefresh/dind'
operator: 'Exists'
effect: 'NoSchedule'
{{ toYaml .Tolerations | indent 8}}
containers:
- image: {{ if ne .DockerRegistry ""}} {{- .DockerRegistry }}/codefresh/dind-volume-utils:v5 {{- else }}codefresh/dind-volume-utils:v5{{- end}}
name: lv-cleaner
resources:
{{ toYaml .Storage.LocalVolumeMonitor | indent 10 }}
imagePullPolicy: Always
command:
- /bin/local-volumes-agent
env:
{{- if $.EnvVars }}
{{- range $key, $value := $.EnvVars }}
- name: {{ $key }}
value: "{{ $value}}"
{{- end}}
{{- end}}
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: VOLUME_PARENT_DIR
value: {{ $localVolumeParentDir }}
# Debug:
# - name: DRY_RUN
# value: "1"
# - name: DEBUG
# value: "1"
# - name: SLEEP_INTERVAL
# value: "3"
# - name: LOG_DF_EVERY
# value: "60"
# - name: KB_USAGE_THRESHOLD
# value: "20"
volumeMounts:
- mountPath: {{ $localVolumeParentDir }}
readOnly: false
name: dind-volume-dir
volumes:
- name: dind-volume-dir
hostPath:
path: {{ $localVolumeParentDir }}
{{- end -}}