apiVersion: apps/v1
kind: Deployment
metadata:
  name: controller-manager
  namespace: system
spec:
  template:
    spec:
      containers:
      - name: manager
        env:
        - name: KEMAL_ENV
          value: production
        - name: PORT
          value: "3000"
        - name: STRIPE_API_KEY
          valueFrom:
            secretKeyRef:
              name: container-mom-secrets
              key: STRIPE_API_KEY
        - name: CLOUDFLARE_API_TOKEN
          valueFrom:
            secretKeyRef:
              name: container-mom-secrets
              key: CLOUDFLARE_API_TOKEN
        ports:
        - containerPort: 3000
          name: http
        volumeMounts:
        - name: manager-config
          mountPath: /app/config/controller_manager_config.yaml
          subPath: controller_manager_config.yaml
        livenessProbe:
          httpGet:
            path: /health
            port: http
          initialDelaySeconds: 15
          periodSeconds: 20
        readinessProbe:
          httpGet:
            path: /health
            port: http
          initialDelaySeconds: 5
          periodSeconds: 10
      volumes:
      - name: manager-config
        configMap:
          name: manager-config
