---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: ltd-keeper-api
spec:
  replicas: 2
  selector:
    matchLabels:
      name: ltd-keeper-api
  template:
    metadata:
      labels:
        name: ltd-keeper-api
    spec:
      containers:
        - name: app
          imagePullPolicy: 'Always'
          image: 'ghcr.io/lsst-sqre/ltd-keeper:latest'
          ports:
            - containerPort: 3031
              name: ltd-keeper-uwsgi
          envFrom:
            - configMapRef:
                name: ltd-keeper

---
# Deployment of celery workers for keeper
apiVersion: apps/v1
kind: Deployment
metadata:
  name: ltd-keeper-worker
spec:
  replicas: 2
  selector:
    matchLabels:
      name: ltd-keeper-worker
  template:
    metadata:
      labels:
        name: ltd-keeper-worker
    spec:
      containers:
        - name: app
          imagePullPolicy: 'Always'
          image: 'ghcr.io/lsst-sqre/ltd-keeper:latest'
          command: ['/bin/bash']
          args: ['-c', '/home/appuser/run-celery-worker.bash']
          envFrom:
            - configMapRef:
                name: ltd-keeper

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: ltd-keeper-api
spec:
  replicas: 1
  selector:
    matchLabels:
      name: ltd-keeper-api
  template:
    metadata:
      labels:
        name: ltd-keeper-api
    spec:
      containers:
        - name: app
          imagePullPolicy: 'Always'
          image: 'ghcr.io/lsst-sqre/ltd-keeper:latest'
          ports:
            - containerPort: 3031
              name: ltd-keeper-uwsgi
          envFrom:
            - configMapRef:
                name: ltd-keeper

---
# Deployment of celery workers for keeper
apiVersion: apps/v1
kind: Deployment
metadata:
  name: ltd-keeper-worker
spec:
  replicas: 1
  selector:
    matchLabels:
      name: ltd-keeper-worker
  template:
    metadata:
      labels:
        name: ltd-keeper-worker
    spec:
      containers:
        - name: app
          imagePullPolicy: 'Always'
          image: 'ghcr.io/lsst-sqre/ltd-keeper:latest'
          command: ['/bin/bash']
          args: ['-c', '/home/appuser/run-celery-worker.bash']
          envFrom:
            - configMapRef:
                name: ltd-keeper

Reduce default replica factor to 1
Reduce default replica factor to 1
