apiVersion: apps/v1
kind: Deployment
metadata:
  name: prefect-agent
  labels:
    app: prefect-agent
spec:
  replicas: 1
  selector:
    matchLabels:
      app: prefect-agent
  template:
    metadata:
      labels:
        app: prefect-agent
    spec:
      imagePullSecrets:
        - name: ""
      containers:
        - name: agent
          image: prefecthq/prefect:latest
          imagePullPolicy: Always
          command: ["/bin/bash", "-c"]
          args: ["prefect agent kubernetes start"]
          env:
            - name: PREFECT__CLOUD__AGENT__AUTH_TOKEN
              value: ""
            - name: PREFECT__CLOUD__API
              value: "https://api.prefect.io"
            - name: NAMESPACE
              value: "default"
            - name: IMAGE_PULL_SECRETS
              value: ""
            - name: PREFECT__CLOUD__AGENT__LABELS
              value: "[]"
            - name: JOB_MEM_REQUEST
              value: ""
            - name: JOB_MEM_LIMIT
              value: ""
            - name: JOB_CPU_REQUEST
              value: ""
            - name: JOB_CPU_LIMIT
              value: ""
            - name: IMAGE_PULL_POLICY
              value: ""
            - name: SERVICE_ACCOUNT_NAME
              value: ""
            - name: PREFECT__BACKEND
              value: "cloud"
            - name: PREFECT__CLOUD__AGENT__AGENT_ADDRESS
              value: "http://:8080"
          resources:
            limits:
              memory: "128Mi"
              cpu: "100m"
          livenessProbe:
            httpGet:
              path: /api/health
              port: 8080
            initialDelaySeconds: 40
            periodSeconds: 40
            failureThreshold: 2
