apiVersion: apps/v1
kind: Deployment
metadata:
  name: optima-api
  namespace: optima
spec:
  selector:
    matchLabels:
      app: optima-api
  replicas: 1
  template:
    metadata:
      labels:
        app: optima-api
    spec:
      containers:
        - name: optima-api
          image: ghcr.io/horizonstacksoftware/optima-api:latest
          imagePullPolicy: Always
          envFrom:
            - secretRef:
                name: api-env-secret
            - secretRef:
                name: optima-keys-secret
          ports:
            - containerPort: 3000
          resources:
            requests:
              memory: "128Mi"
              cpu: "100m"
            limits:
              memory: "512Mi"
              cpu: "1000m"
          livenessProbe:
            httpGet:
              path: /healthz
              port: 3000
            initialDelaySeconds: 10
            periodSeconds: 30
            failureThreshold: 3
          readinessProbe:
            httpGet:
              path: /healthz
              port: 3000
            initialDelaySeconds: 5
            periodSeconds: 10
            failureThreshold: 2
      imagePullSecrets:
        - name: github-container-registry
