---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: ts-bridge
  namespace: ts-bridge
spec:
  selector:
    matchLabels:
      app: ts-bridge
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: ts-bridge
    spec:
      securityContext:
        runAsUser: 1000
        runAsGroup: 1000
        fsGroup: 1000
      containers:
        - image: REPLACE_ME
          name: ts-bridge
          args:
            - --storage-engine=boltdb
            - --enable-status-page
            - --stats-sd-project=REPLACE_ME
            - --update-parallelism=4
            - --sync-period=10s
          ports:
            - containerPort: 8080
              name: ts-bridge
          livenessProbe:
            httpGet:
              path: /health
              port: 8080
            initialDelaySeconds: 3
            periodSeconds: 3
          readinessProbe:
            httpGet:
              path: /health
              port: 8080
            initialDelaySeconds: 3
            periodSeconds: 3
          volumeMounts:
            - name: ts-bridge-persistent-storage
              mountPath: /ts-bridge
            - name: ts-bridge-config-volume
              mountPath: /ts-bridge/metrics.yaml
              subPath: metrics.yaml
      volumes:
        - name: ts-bridge-persistent-storage
          persistentVolumeClaim:
            claimName: ts-bridge-pv-claim
        - name: ts-bridge-config-volume
          configMap:
            name: ts-bridge-config
