apiVersion: apps/v1
kind: Deployment
metadata:
  name: migrator
  namespace: openshift-kube-storage-version-migrator
  labels:
    app: migrator
spec:
  replicas: 1
  selector:
    matchLabels:
      app: migrator
  template:
    metadata:
      annotations:
        target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
      labels:
        app: migrator
    spec:
      serviceAccountName: kube-storage-version-migrator-sa
      containers:
      - name: migrator
        image: ${IMAGE}
        command:
          - migrator
          - '--alsologtostderr'
          - '--v=2'
        terminationMessagePolicy: FallbackToLogsOnError
        resources:
            requests:
              cpu: 10m
              memory: 200Mi
        securityContext:
          runAsUser: 1001
      priorityClassName: system-cluster-critical
      tolerations:
        - key: node-role.kubernetes.io/master
          operator: Exists
          effect: NoSchedule
        - key: node.kubernetes.io/unreachable
          operator: Exists
          effect: NoExecute
          tolerationSeconds: 120
        - key: node.kubernetes.io/not-ready
          operator: Exists
          effect: NoExecute
          tolerationSeconds: 120
