apiVersion: apps/v1
kind: Deployment
metadata:
  name: volm
  namespace: volm-test
  labels:
    app: volm
    component: api
spec:
  replicas: 1
  revisionHistoryLimit: 1
  selector:
    matchLabels:
      app: volm
  template:
    metadata:
      labels:
        app: volm
        component: api
      annotations:
        prometheus.io/scrape: 'true'
        prometheus.io/port: '2112'
    spec:
      serviceAccountName: api-volm
      affinity:
        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
            - weight: 100
              podAffinityTerm:
                labelSelector:
                  matchExpressions:
                    - key: app
                      operator: In
                      values:
                        - volm
                topologyKey: kubernetes.io/hostname
      containers:
        - name: volm
          image: txn2/volm:v0.1.1
          imagePullPolicy: IfNotPresent
          env:
            - name: IP
              value: "0.0.0.0"
            - name: PORT
              value: "8070"
            - name: MODE
              value: "release" # "release" for prod
            - name: PVC_NAMESPACE
              value: "volm-test"
            - name: PVC_SELECTOR
              value: "pvci.txn2.com/service=pvci"
          ports:
            - name: http-int
              containerPort: 8070
            - name: http-mtx
              containerPort: 2112
          startupProbe:
            httpGet:
              path: /
              port: http-int
            failureThreshold: 3
            periodSeconds: 5
          resources:
            requests:
              cpu: ".2"
              memory: 256Mi
            limits:
              cpu: "1"
              memory: 1Gi