apiVersion: apps/v1
kind: Deployment
metadata:
  name: garage-server-1
  labels:
    app.kubernetes.io/controller: server-1
    app.kubernetes.io/instance: garage
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: garage
    helm.sh/chart: garage-5.0.1
  namespace: garage
spec:
  revisionHistoryLimit: 3
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app.kubernetes.io/controller: server-1
      app.kubernetes.io/name: garage
      app.kubernetes.io/instance: garage
  template:
    metadata:
      annotations:
        checksum/configMaps: a4f613efa4f7fb06d8534c15125737341ddd9bb29862c9d650df9887dfed102e
      labels:
        app.kubernetes.io/controller: server-1
        app.kubernetes.io/instance: garage
        app.kubernetes.io/name: garage
        garage-type: server
    spec:
      enableServiceLinks: false
      serviceAccountName: garage
      automountServiceAccountToken: false
      hostIPC: false
      hostNetwork: false
      hostPID: false
      dnsPolicy: ClusterFirst
      affinity:
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            - labelSelector:
                matchExpressions:
                  - key: garage-type
                    operator: In
                    values:
                      - server
              topologyKey: kubernetes.io/hostname
      containers:
        - envFrom:
            - secretRef:
                name: garage-token
          image: dxflrs/garage:v2.3.0@sha256:866bd13ed2038ba7e7190e840482bc27234c4afaf77be8cfa439ae088c1e4690
          name: main
          resources:
            requests:
              cpu: 10m
              memory: 200Mi
          volumeMounts:
            - mountPath: /etc/garage.toml
              mountPropagation: None
              name: config
              readOnly: true
              subPath: garage-1.toml
            - mountPath: /var/lib/garage/data
              name: data-1
            - mountPath: /var/lib/garage/meta
              name: db-1
            - mountPath: /var/lib/garage/snapshots
              name: snapshots
      volumes:
        - configMap:
            name: garage
          name: config
        - name: data-1
          persistentVolumeClaim:
            claimName: garage-data
        - name: db-1
          persistentVolumeClaim:
            claimName: garage-db-1
        - name: snapshots
          persistentVolumeClaim:
            claimName: garage-snapshots
