apiVersion: apps/v1
kind: Deployment

metadata:
  namespace: singouins-dev
  name: sep-backend-ws
  labels:
    tier: sep-backend
spec:
  replicas: 1
  selector:
    matchLabels:
      app: ws
      tier: sep-backend
  strategy:
    type: Recreate
  template:
    metadata:
      annotations:
        prometheus.io/scrape: "false"
        prometheus.io/port: "5000"
      labels:
        app: ws
        tier: sep-backend
    spec:
      restartPolicy: Always

      containers:
      - name: sep-backend-ws
        image: lordslair/ws:latest
        imagePullPolicy: Always
        resources:
          limits:
            memory: 64Mi
            cpu: 100m
          requests:
            memory: 32Mi
            cpu: 50m

        env:
        # WebSocket env vars
        - name: SEP_WSS_HOST
          value: '0.0.0.0'
        - name: SEP_WSS_PORT
          value: '5000'
        - name: PYTHONUNBUFFERED
          value: 'True'
        # App variables
        - name: SEP_REDIS_DB
          valueFrom:
            secretKeyRef:
              name: sep-backend-redis-secret
              key: redis-base
        - name: SEP_REDIS_SLEEP
          value: '1.0' # NEEDS to be a float
