apiVersion: apps/v1
kind: Deployment
metadata:
  name: transmission-app
  namespace: transmission
  labels:
    app.kubernetes.io/name: transmission
    app.kubernetes.io/instance: transmission
spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: transmission
  replicas: 1
  template:
    metadata:
      labels:
        app.kubernetes.io/name: transmission
    spec:
      hostNetwork: true
      dnsPolicy: ClusterFirstWithHostNet
      containers:
        - name: transmission-app
          image: linuxserver/transmission
          imagePullPolicy: Always
          livenessProbe:
            httpGet:
              path: /
              port: 9091
            failureThreshold: 5
            initialDelaySeconds: 60
            periodSeconds: 10
            timeoutSeconds: 10
          readinessProbe:
            httpGet:
              path: /
              port: 9091
            failureThreshold: 5
            initialDelaySeconds: 60
            periodSeconds: 10
            timeoutSeconds: 10
          ports:
            - containerPort: 9091
              hostPort: 9091
            - containerPort: 51413
              hostPort: 51413
            - containerPort: 51413
              hostPort: 51413
              protocol: UDP
          envFrom:
            - configMapRef:
                name: transmission-envs
          volumeMounts:
            - mountPath: /config
              name: config-volume
            - mountPath: /downloads
              name: download-volume
      volumes:
        - name: config-volume
          hostPath:
            # Ensure the file directory is created.
            path: /mnt/ssd/containers/config/transmission
            type: DirectoryOrCreate
        - name: download-volume
          hostPath:
            # Ensure the file directory is created.
            path: /mnt/data/shares/download
            type: DirectoryOrCreate