66 lines
1.7 KiB
YAML
66 lines
1.7 KiB
YAML
apiVersion: apps/v1
|
|
kind: DaemonSet
|
|
metadata:
|
|
name: etcd-io-guard
|
|
namespace: node-io
|
|
labels:
|
|
app: etcd-io-guard
|
|
spec:
|
|
selector:
|
|
matchLabels:
|
|
app: etcd-io-guard
|
|
updateStrategy:
|
|
type: RollingUpdate
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: etcd-io-guard
|
|
spec:
|
|
# siriussec is the only node that hosts the etcd data dir and the dind
|
|
# runner data-root on the same NVMe.
|
|
nodeSelector:
|
|
kubernetes.io/hostname: siriussec
|
|
tolerations:
|
|
- operator: Exists
|
|
hostPID: true
|
|
priorityClassName: system-node-critical
|
|
containers:
|
|
- name: guard
|
|
image: busybox:1.36
|
|
imagePullPolicy: IfNotPresent
|
|
command: ["/bin/sh", "/opt/guard/guard.sh"]
|
|
env:
|
|
- name: DIRTY_BYTES
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
name: etcd-io-guard-config
|
|
key: dirty-bytes
|
|
- name: DIRTY_BACKGROUND_BYTES
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
name: etcd-io-guard-config
|
|
key: dirty-background-bytes
|
|
securityContext:
|
|
privileged: true
|
|
resources:
|
|
requests:
|
|
cpu: 5m
|
|
memory: 8Mi
|
|
limits:
|
|
cpu: 50m
|
|
memory: 32Mi
|
|
volumeMounts:
|
|
- name: host-proc-sys
|
|
mountPath: /host/proc/sys/vm
|
|
- name: script
|
|
mountPath: /opt/guard
|
|
readOnly: true
|
|
volumes:
|
|
- name: host-proc-sys
|
|
hostPath:
|
|
path: /proc/sys/vm
|
|
type: Directory
|
|
- name: script
|
|
configMap:
|
|
name: etcd-io-guard-script
|
|
defaultMode: 0755
|