apiVersion: apps/v1
kind: Deployment
metadata:
  name: nighteye-backend
spec:
  selector:
    matchLabels:
      component: nighteye-backend
  template:
    metadata:
      labels:
        component: nighteye-backend
    spec:
      containers:
        - name: nighteye-backend
          image: ghcr.io/rohankmr414/nighteye/backend:latest
          resources:
            limits:
              memory: "700Mi"
              cpu: "0.5"
          readinessProbe:
            httpGet:
              path: /healthz
              port: 8000
            initialDelaySeconds: 5
            timeoutSeconds: 2
            periodSeconds: 10
            failureThreshold: 3
          livenessProbe:
            httpGet:
              path: /healthz
              port: 8000
            initialDelaySeconds: 5
            timeoutSeconds: 2
            periodSeconds: 10
            failureThreshold: 3
          ports:
            - containerPort: 8000
          env:
            - name: COIN_CAP_API_KEY
              valueFrom:
                secretKeyRef:
                  name: backend-secret
                  key: coin-cap-api-key

            - name: PORT
              value: "8000"
