apiVersion: apps/v1
kind: Deployment
metadata:
  name: matchbox
spec:
  replicas: 1
  strategy:
    rollingUpdate:
      maxUnavailable: 1
  selector:
      matchLabels:
        app: matchbox
  template:
    metadata:
      labels:
        name: matchbox
        phase: prod
        app: matchbox
    spec:
      containers:
        - name: matchbox
          image: quay.io/poseidon/matchbox:v0.8.3
          env:
            - name: MATCHBOX_ADDRESS
              value: "0.0.0.0:8080"
            - name: MATCHBOX_LOG_LEVEL
              value: "debug"
          ports:
            - name: http
              containerPort: 8080
            - name: https
              containerPort: 8081
          resources:
            requests:
              cpu: "50m"
              memory: "50Mi"
          volumeMounts:
            - name: groups
              mountPath: /var/lib/matchbox/groups
            - name: ignition
              mountPath: /var/lib/matchbox/ignition
            - name: profiles
              mountPath: /var/lib/matchbox/profiles
            - name: assets
              mountPath: /var/lib/matchbox/assets
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
      volumes:
        - name: groups
          configMap:
            name: matchbox-groups
        - name: ignition
          configMap:
            name: matchbox-ignition
        - name: profiles
          configMap:
            name: matchbox-profiles
        - name: assets
          persistentVolumeClaim:
            claimName: matchbox-assets
