apiVersion: v1
kind: ServiceAccount
metadata:
  labels:
    app: ml-pipeline-persistenceagent
  name: ml-pipeline-persistenceagent
  namespace: kubeflow
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
  labels:
    app: ml-pipeline-persistenceagent
  name: ml-pipeline-persistenceagent
rules:
- apiGroups:
  - argoproj.io
  resources:
  - workflows
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - kubeflow.org
  resources:
  - scheduledworkflows
  verbs:
  - get
  - list
  - watch
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
  labels:
    app: ml-pipeline-persistenceagent
  name: ml-pipeline-persistenceagent
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cluster-admin
subjects:
- kind: ServiceAccount
  name: ml-pipeline-persistenceagent
  namespace: kubeflow
---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: ml-pipeline-persistenceagent
  name: ml-pipeline-persistenceagent
  namespace: kubeflow
spec:
  selector:
    matchLabels:
      app: ml-pipeline-persistenceagent
  template:
    metadata:
      labels:
        app: ml-pipeline-persistenceagent
    spec:
      containers:
      - env:
        - name: POD_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        image: gcr.io/ml-pipeline/persistenceagent:0.1.23
        imagePullPolicy: IfNotPresent
        name: ml-pipeline-persistenceagent
      serviceAccountName: ml-pipeline-persistenceagent
