apiVersion: apps/v1
kind: Deployment
metadata:
  name: optima-worker
  namespace: optima
spec:
  selector:
    matchLabels:
      app: optima-worker
  replicas: 1
  template:
    metadata:
      labels:
        app: optima-worker
    spec:
      containers:
        - name: optima-worker
          image: ghcr.io/horizonstacksoftware/optima-worker:latest
          imagePullPolicy: Always
          env:
            - name: MANAGER_SOCKET_URL
              value: "http://optima-api.optima.svc.cluster.local:8671"
            - name: API_DATABASE_URL
              valueFrom:
                secretKeyRef:
                  name: api-env-secret
                  key: DATABASE_URL
          envFrom:
            - secretRef:
                name: api-env-secret
          resources:
            requests:
              memory: "128Mi"
              cpu: "100m"
            limits:
              memory: "512Mi"
              cpu: "1000m"
      imagePullSecrets:
        - name: github-container-registry
