apiVersion: apps/v1
kind: Deployment
metadata:
  name: recorder
  namespace: owntracks
  labels:
    app: recorder
spec:
  selector:
    matchLabels:
      app: recorder
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: recorder
    spec:
      containers:
      - env:
        - name: OTR_HOST
          value: mqtt-plain.mosquitto.svc.cluster.local
        - name: OTR_USER
          value: ot-recorder
        image: docker.io/owntracks/recorder:0.8.6-12
        imagePullPolicy: IfNotPresent
        name: recorder
        command:
        - ot-recorder
        - --viewsdir
        - /htdocs/viewsjson
        livenessProbe:
          httpGet:
            path: /api/0/monitor
            port: 8083
          initialDelaySeconds: 1
          periodSeconds: 30
        ports:
        - containerPort: 8083
          protocol: TCP
        volumeMounts:
        - name: data
          mountPath: /store
        - name: views
          mountPath: /htdocs/viewsjson
        - name: config
          mountPath: /config
        securityContext:
          runAsUser: 9999
          runAsGroup: 9999
        resources:
          requests:
            memory: 32Mi
            cpu: 100m
          limits:
            memory: 128Mi
            cpu: 300m
      volumes:
      - name: data
        persistentVolumeClaim:
          claimName: owntracks-data
      - name: views
        configMap:
          name: views
      - name: config
        secret:
          secretName: recorder

