apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: discord-gateway
  name: discord-gateway
  annotations:
    fluxcd.io/automated: "true"
  labels:
    app: discord-gateway
spec:
  replicas: 1
  selector:
    matchLabels:
      app: discord-gateway
  template:
    metadata:
      labels:
        app: discord-gateway
    spec:
      containers:
      - name: discord-gateway
        image: devlaunchers/discord-gateway:sha-c3976e4
        env:
        - name: DISCORD_TOKEN
          valueFrom:
            secretKeyRef:
              name: discord-gateway
              key: discord-token
        - name: BACKEND_URL
          valueFrom:
            secretKeyRef:
              name: discord-gateway
              key: backend-url
        - name: BACKEND_TOKEN
          valueFrom:
            secretKeyRef:
              name: discord-gateway
              key: backend-token
        - name: PORT
          value: "3000"
        ports:
        - containerPort: 3000
        resources:
          limits:
            cpu: 100m
            memory: 64Mi
          requests:
            cpu: 25m
            memory: 16Mi
        livenessProbe:
          httpGet:
            path: /metrics
            port: 3000
          initialDelaySeconds: 30
          periodSeconds: 10
          failureThreshold: 5