apiVersion: apps/v1
kind: Deployment
metadata:
  name: cluster-node-tuning-operator
  namespace: openshift-cluster-node-tuning-operator
spec:
  replicas: 1
  selector:
    matchLabels:
      name: cluster-node-tuning-operator
  template:
    metadata:
      labels:
        name: cluster-node-tuning-operator
    spec:
      serviceAccountName: cluster-node-tuning-operator
      nodeSelector:
        node-role.kubernetes.io/master: ""
      priorityClassName: "system-cluster-critical"
      tolerations:
      - key: node-role.kubernetes.io/master  # Just tolerate NoSchedule taint on master node. If there are other conditions like disk-pressure etc, let's not schedule the control-plane pods onto that node.
        operator: Exists
        effect: "NoSchedule"
      - key: "node.kubernetes.io/unreachable"
        operator: "Exists"
        effect: "NoExecute"
        tolerationSeconds: 120 # Evict pods within 2 mins.
      - key: "node.kubernetes.io/not-ready"
        operator: "Exists"
        effect: "NoExecute"
        tolerationSeconds: 120 # Evict pods within 2 mins.
      containers:
        - name: cluster-node-tuning-operator
          image: registry.svc.ci.openshift.org/openshift/origin-v4.0:cluster-node-tuning-operator
          command:
          - cluster-node-tuning-operator
          args:
          - "-v=1"
          env:
          - name: RELEASE_VERSION
            value: "0.0.1-snapshot"
          - name: WATCH_NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
          - name: POD_NAME
            valueFrom:
              fieldRef:
                fieldPath: metadata.name
          - name: OPERATOR_NAME
            value: "node-tuning"
          - name: RESYNC_PERIOD
            value: "600"
          - name: CLUSTER_NODE_TUNED_IMAGE
            value: registry.svc.ci.openshift.org/openshift/origin-v4.0:cluster-node-tuned
          imagePullPolicy: IfNotPresent
          terminationMessagePolicy: FallbackToLogsOnError
          resources:
            requests:
              cpu: 10m
              memory: 20Mi
