apiVersion: apps/v1
kind: Deployment
metadata:
  name: celery-beat
  labels:
    deployment: celery-beat
spec:
  replicas: 1
  selector:
    matchLabels:
      pod: celery-beat
  template:
    metadata:
      labels:
        pod: celery-beat
    spec:
      containers:
        - name: celery-beat
          image: backend:1
          command: ["celery", "beat", "--app=backend.celery_app:app", "--loglevel=info"]
          env:
            - name: DJANGO_SETTINGS_MODULE
              value: 'backend.settings.minikube'

            - name: SECRET_KEY
              value: "my-secret-key"

            - name: POSTGRES_NAME
              value: postgres

            - name: POSTGRES_USER
              valueFrom:
                secretKeyRef:
                  name: postgres-credentials
                  key: user

            - name: POSTGRES_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: postgres-credentials
                  key: password