kind: DaemonSet
apiVersion: apps/v1
metadata:
  name: drbd-installer
  namespace: kube-system
spec:
  selector:
    matchLabels:
      app: drbd-installer
  template:
    metadata:
      labels:
        app: drbd-installer
    spec:
      containers:
        - name: drbd-installer
          image: ghcr.io/hwameistor/drbd-installer:v0.1.7
          imagePullPolicy: Always
          resources:
            limits:
              memory: 100Mi
              cpu: 100m
            requests:
              memory: 100Mi
              cpu: 100m
          args:
            - -debug=true
            - -block-the-pod=false
            - -skip-error=false
          securityContext:
            privileged: true
          env:
            - name: CMD_NSENTER_RUN_ARGS
              value: --mount=/var/host/proc/1/ns/mnt,--ipc=/var/host/proc/1/ns/ipc,--net=/var/host/proc/1/ns/net,--
            - name: CMD_NSENTER_ARGS_SEP
              value: ","
          volumeMounts:
            - mountPath: /var/host/proc
              name: host-proc
            - mountPath: /lib/modules
              name: host-modules-dir
            - mountPath: /etc/sysconfig/modules
              name: sysconfig-modules
      volumes:
        - name: host-proc
          hostPath:
            path: /proc
        - name: host-modules-dir
          hostPath:
            path: /lib/modules
        - name: sysconfig-modules
          hostPath:
            path: /etc/sysconfig/modules
      tolerations:
      - key: CriticalAddonsOnly
        operator: Exists
      - effect: NoSchedule
        key: node.kubernetes.io/not-ready
        operator: Exists
      - effect: NoSchedule
        key: node-role.kubernetes.io/master
        operator: Exists
      - effect: NoSchedule
        key: node.cloudprovider.kubernetes.io/uninitialized
        operator: Exists
