apiVersion: apps/v1
kind: Deployment
metadata:
  name: bookdash-scheduler
  namespace: bookdash
  labels:
    app: bookdash
    component: scheduler
spec:
  replicas: 1
  selector:
    matchLabels:
      app: bookdash
      component: scheduler
  template:
    metadata:
      labels:
        app: bookdash
        component: scheduler
    spec:
      containers:
        - name: scheduler
          image: bookdash:latest
          command: ["/bin/sh", "-c", "while true; do php artisan schedule:run --verbose --no-interaction; sleep 60; done"]
          envFrom:
            - configMapRef:
                name: bookdash-config
            - secretRef:
                name: bookdash-secrets
          resources:
            requests:
              cpu: 100m
              memory: 128Mi
            limits:
              cpu: 500m
              memory: 256Mi
