apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: ml-pipeline-persistenceagent
  name: ml-pipeline-persistenceagent
spec:
  selector:
    matchLabels:
      app: ml-pipeline-persistenceagent
  template:
    metadata:
      labels:
        app: ml-pipeline-persistenceagent
      annotations:
        cluster-autoscaler.kubernetes.io/safe-to-evict: "true"
    spec:
      containers:
      - env:
          - name: NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
          - name: TTL_SECONDS_AFTER_WORKFLOW_FINISH
            value: "86400"
          - name: NUM_WORKERS
            value: "2"
          - name: LOG_LEVEL
            value: "info"
        image: gcr.io/ml-pipeline/persistenceagent:dummy
        imagePullPolicy: IfNotPresent
        name: ml-pipeline-persistenceagent
        resources:
          requests:
            cpu: 120m
            memory: 500Mi
        volumeMounts:
          - mountPath: /var/run/secrets/kubeflow/tokens
            name: persistenceagent-sa-token
      serviceAccountName: ml-pipeline-persistenceagent
      volumes:
        - name: persistenceagent-sa-token
          projected:
            sources:
              - serviceAccountToken:
                  path: persistenceagent-sa-token
                  expirationSeconds: 3600
                  audience: pipelines.kubeflow.org
