apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: local-pv-provisioner
  labels:
    app.kubernetes.io/name: local-pv-provisioner
spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: local-pv-provisioner
  updateStrategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 35%
  template:
    metadata:
      labels:
        app.kubernetes.io/name: local-pv-provisioner
      annotations:
        prometheus.io/port: "8080"
    spec:
      containers:
        - name: local-pv-provisioner
          image: quay.io/cybozu/local-pv-provisioner:0.2.4
          imagePullPolicy: IfNotPresent
          args:
            - --device-dir=/dev/crypt-disk/by-path
            - --zap-stacktrace-level=panic
          env:
            - name: LP_NODE_NAME
              valueFrom:
                fieldRef:
                  fieldPath: spec.nodeName
          ports:
            - containerPort: 8080
              name: metrics
          volumeMounts:
            - name: dev
              mountPath: /dev/crypt-disk/by-path
              readOnly: true
          securityContext:
            runAsUser: 0
            runAsGroup: 0
            privileged: true
          livenessProbe:
            httpGet:
              path: /metrics
              port: 8080
              scheme: HTTP
      serviceAccountName: local-pv-provisioner
      volumes:
        - name: dev
          hostPath:
            path: /dev/crypt-disk/by-path
      nodeSelector:
        cke.cybozu.com/role: ss
      tolerations:
        - key: cke.cybozu.com/role
          operator: Equal
          value: storage
