# yaml-language-server: $schema=./values.schema.json
image:
  repository: docker.io/prometheuscommunity/smartctl-exporter
  pullPolicy: IfNotPresent
  tag: v0.14.0@sha256:cfe22c36d7d2fac48ebf619707305acb65eb0fb670656eb80f356e606d782bc1
securityContext:
  container:
    privileged: true
    runAsUser: 0
    runAsGroup: 0
service:
  main:
    ports:
      main:
        protocol: http
        port: 9633
workload:
  main:
    type: DaemonSet
    podSpec:
      containers:
        main:
          args:
            - --web.listen-address
            - :{{ .Values.service.main.ports.main.port }}
            - --web.telemetry-path
            - "{{ .Values.smartctl.metricsEndpoint }}"
            - --smartctl.path
            - /usr/sbin/smartctl
            - --smartctl.interval
            - "{{ .Values.smartctl.pollInterval }}"
            - --smartctl.rescan
            - "{{ .Values.smartctl.rescanInterval }}"
            - --smartctl.device-exclude
            - "{{ .Values.smartctl.excludedDevices }}"
            - --log.level
            - "{{ .Values.logs.general.level }}"
            - --log.format
            - "{{ .Values.logs.general.format }}"
          probes:
            liveness:
              path: "{{ .Values.smartctl.metricsEndpoint }}"
              port: main
            readiness:
              path: "{{ .Values.smartctl.metricsEndpoint }}"
              port: main
            startup:
              type: tcp
              port: main

persistence:
  hostdev:
    enabled: true
    type: hostPath
    hostPath: /dev
    mountPath: /hostdev

metrics:
  main:
    enabled: true
    type: "servicemonitor"
    endpoints:
      - port: main
        path: "{{ .Values.smartctl.metricsEndpoint }}"

smartctl:
  metricsEndpoint: "/metrics"
  pollInterval: "60s"
  rescanInterval: "10m"
  excludedDevices: ""
logs:
  general:
    level: info
    format: logfmt

configmap:
  dashboard:
    enabled: true
    labels:
      grafana_dashboard: "1"
    data:
      smartctl.json: >-
        {{ .Files.Get "dashboard.json" | indent 8 }}
