---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: &app gaps
  namespace: media
  labels:
    app.kubernetes.io/name: *app
    app.kubernetes.io/instance: *app
spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: *app
      app.kubernetes.io/instance: *app
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app.kubernetes.io/name: *app
        app.kubernetes.io/instance: *app
    spec:
      containers:
        - name: *app
          image: docker.io/housewrecker/gaps:x64-v0.10.1
          imagePullPolicy: IfNotPresent
          env:
            - name: TZ
              value: "${TIMEZONE}"
          ports:
            - name: &port http
              containerPort: 8484
              protocol: TCP
          livenessProbe:
            tcpSocket:
              port: *port
            initialDelaySeconds: 0
            periodSeconds: 10
            timeoutSeconds: 1
            failureThreshold: 3
          readinessProbe:
            tcpSocket:
              port: *port
            initialDelaySeconds: 0
            periodSeconds: 10
            timeoutSeconds: 1
            failureThreshold: 3
          startupProbe:
            tcpSocket:
              port: *port
            failureThreshold: 30
            periodSeconds: 10
          volumeMounts:
            - name: config
              mountPath: /usr/data
          resources:
            requests:
              cpu: 100m
              memory: 100Mi
            limits:
              cpu: 500m
              memory: 1000Mi
      volumes:
        - name: config
          persistentVolumeClaim:
            claimName: gaps-config-v1
