---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: smokeping
  namespace: monitoring
  labels:
    app.kubernetes.io/name: smokeping
    app.kubernetes.io/instance: smokeping
    app.kubernetes.io/part-of: smokeping
    app.kubernetes.io/version: "2.7.3"
spec:
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app.kubernetes.io/name: smokeping
      app.kubernetes.io/instance: smokeping
  template:
    metadata:
      labels:
        app.kubernetes.io/name: smokeping
        app.kubernetes.io/instance: smokeping
    spec:
      containers:
        - name: smokeping
          image: "ghcr.io/linuxserver/smokeping:2.7.3"
          imagePullPolicy: IfNotPresent
          env:
            - name: TZ
              value: "America/Toronto"
          ports:
            - name: http
              containerPort: 80
              protocol: TCP
          volumeMounts:
            # we cannot mount config directly because this container massages it. Copy the files manually for now.
            - mountPath: /config
              name: data
              subPath: config
            - mountPath: /data
              name: data
              subPath: data
            # mount our secret so we can copy the files easily
            - mountPath: /kochhaus
              name: config
          livenessProbe:
            tcpSocket:
              port: http
            initialDelaySeconds: 30
            failureThreshold: 5
            timeoutSeconds: 10
          readinessProbe:
            tcpSocket:
              port: http
            initialDelaySeconds: 30
            failureThreshold: 5
            timeoutSeconds: 10
      volumes:
        - name: config
          secret:
            secretName: smokeping
        - name: data
          persistentVolumeClaim:
            claimName: smokeping-data
