apiVersion: apps/v1
kind: Deployment
metadata:
  name: bookdash-horizon
  namespace: bookdash
  labels:
    app: bookdash
    component: horizon
spec:
  replicas: 1
  selector:
    matchLabels:
      app: bookdash
      component: horizon
  template:
    metadata:
      labels:
        app: bookdash
        component: horizon
    spec:
      containers:
        - name: horizon
          image: bookdash:latest
          command: ["php", "artisan", "horizon"]
          envFrom:
            - configMapRef:
                name: bookdash-config
            - secretRef:
                name: bookdash-secrets
          resources:
            requests:
              cpu: 250m
              memory: 256Mi
            limits:
              cpu: "1"
              memory: 512Mi
          livenessProbe:
            exec:
              command: ["php", "artisan", "horizon:status"]
            initialDelaySeconds: 30
            periodSeconds: 60
