apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: kubevirt-scheduler
  name: kubevirt-scheduler
  namespace: cloudplus
spec:
  selector:
    matchLabels:
      app: kubevirt-scheduler
  replicas: 1
  template:
    metadata:
      labels:
        app: kubevirt-scheduler
      name: kubevirt-scheduler
      namespace: cloudplus
    spec:
      tolerations:
        - key: node-role.kubernetes.io/master
          effect: NoSchedule
      nodeSelector:
        node-role.kubernetes.io/master: ""
      containers:
        - command:
          - /usr/local/bin/kubevirt-scheduler
          - --address=0.0.0.0
          - --scheduler-name=kubevirt-scheduler
          - --kubeconfig=/etc/kubernetes/admin.conf
          - --leader-elect=true
          - --port=10253
          - --secure-port=10261
          - --lock-object-namespace=cloudplus
          image: registry.cn-hangzhou.aliyuncs.com/cloudplus-lab/kubevirt-scheduler:v1.14.6
          imagePullPolicy: IfNotPresent
          livenessProbe:
            failureThreshold: 8
            httpGet:
              path: /healthz
              port: 10253
              scheme: HTTP
            initialDelaySeconds: 15
            timeoutSeconds: 15
          name: kubevirt-scheduler
          resources:
            requests:
              cpu: 100m
          volumeMounts:
            - mountPath: /etc/kubernetes/admin.conf
              name: kubeconfig
              readOnly: true
      hostNetwork: true
      volumes:
        - hostPath:
            path: /etc/kubernetes/admin.conf
            type: FileOrCreate
          name: kubeconfig
