kind: Deployment
apiVersion: apps/v1
metadata:
  name: {{ .Values.controller.name }}
  namespace: {{ .Release.Namespace }}
  labels:
    app: scheduler-plugins-controller
spec:
  replicas: {{ .Values.controller.replicaCount }}
  selector:
    matchLabels:
      app: scheduler-plugins-controller
  template:
    metadata:
      labels:
        app: scheduler-plugins-controller
    spec:
      serviceAccountName: {{ .Values.controller.name }}
      containers:
      - name: scheduler-plugins-controller
        image: {{ .Values.controller.image }}
        imagePullPolicy: IfNotPresent
      {{- with .Values.controller.nodeSelector }}
      nodeSelector: {{- toYaml . | nindent 8}}
      {{- end }}
      {{- with .Values.controller.affinity }}
      affinity: {{- toYaml . | nindent 8}}
      {{- end }}
      {{- with .Values.controller.tolerations }}
      tolerations: {{- toYaml . | nindent 8}}
      {{- end }}

---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    component: scheduler
  name: {{ .Values.scheduler.name }}
  namespace: {{ .Release.Namespace }}
spec:
  selector:
    matchLabels:
      component: scheduler
  replicas: {{ .Values.scheduler.replicaCount }}
  template:
    metadata:
      labels:
        component: scheduler
    spec:
      serviceAccountName: {{ .Values.scheduler.name }}
      containers:
      - args:
        - --config=/etc/kubernetes/scheduler-config.yaml
        image: {{ .Values.scheduler.image }}
        imagePullPolicy: IfNotPresent
        livenessProbe:
          httpGet:
            path: /healthz
            port: 10259
            scheme: HTTPS
          initialDelaySeconds: 15
        name: scheduler-plugins-scheduler
        readinessProbe:
          httpGet:
            path: /healthz
            port: 10259
            scheme: HTTPS
        resources:
          requests:
            cpu: '0.1'
        securityContext:
          privileged: false
        volumeMounts:
        - name: scheduler-config
          mountPath: /etc/kubernetes
          readOnly: true
      hostNetwork: false
      hostPID: false
      volumes:
      - name: scheduler-config
        configMap:
          name: scheduler-config
      {{- with .Values.scheduler.nodeSelector }}
      nodeSelector: {{- toYaml . | nindent 8}}
      {{- end }}
      {{- with .Values.scheduler.affinity }}
      affinity: {{- toYaml . | nindent 8}}
      {{- end }}
      {{- with .Values.scheduler.tolerations }}
      tolerations: {{- toYaml . | nindent 8}}
      {{- end }}
      
