apiVersion: apps/v1
kind: Deployment
metadata:
  name: speedtest-tracker
  namespace: speedtest-tracker
  labels:
    app.kubernetes.io/name: speedtest-tracker
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: speedtest-tracker
  template:
    metadata:
      labels:
        app.kubernetes.io/name: speedtest-tracker
    spec:
      dnsPolicy: None
      dnsConfig:
        nameservers:
          - 10.152.183.10
          - 8.8.8.8
        searches:
          - speedtest-tracker.svc.cluster.local
        options:
          - name: ndots
            value: "5"
      containers:
        - name: speedtest-tracker
          image: lscr.io/linuxserver/speedtest-tracker:latest
          env:
            - name: PUID
              value: "1000"
            - name: PGID
              value: "1000"
            - name: APP_KEY
              valueFrom:
                secretKeyRef:
                  name: speedtest-tracker-secret
                  key: APP_KEY
            - name: DISPLAY_TIMEZONE
              value: Europe/Berlin
            - name: DB_CONNECTION
              value: sqlite
            - name: SPEEDTEST_SCHEDULE
              value: "0 * * * *"
            - name: SPEEDTEST_SERVERS
              value: ""
          resources:
            requests:
              cpu: 100m
              memory: 128Mi
            limits:
              cpu: 500m
              memory: 512Mi
          volumeMounts:
            - mountPath: /config
              name: speedtest-tracker
      volumes:
        - name: speedtest-tracker
          persistentVolumeClaim:
            claimName: speedtest-tracker
