apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: benji-fsfreeze
  namespace: rook-ceph
  labels:
    app.kubernetes.io/name: benji
spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: benji
  template:
    metadata:
      labels:
        app.kubernetes.io/name: benji
        benji-backup.me/component: "fsfreeze"
    spec:
      serviceAccountName: benji
      dnsPolicy: ClusterFirstWithHostNet
      containers:
        - name: fsfreeze
          image: ghcr.io/elemental-lf/benji-k8s:0.15.0
          imagePullPolicy: IfNotPresent
          securityContext:
            privileged: true
          command:
            - sleep
            - 365d
          env:
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: POD_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
          volumeMounts:
            - name: rbd-mounts
              mountPath: /var/lib/kubelet/plugins/kubernetes.io/rbd/mounts/
            - name: tz-config
              mountPath: /etc/localtime
          resources:
            requests:
              cpu: 100m
              memory: 100Mi
            limits:
              cpu: 200m
              memory: 200Mi
      volumes:
        - name: rbd-mounts
          hostPath:
            path: /var/lib/kubelet/plugins/kubernetes.io/rbd/mounts/
            type: DirectoryOrCreate
        - name: tz-config
          hostPath:
            path: /usr/share/zoneinfo/Asia/Jakarta
