apiVersion: apps/v1beta2
kind: Deployment
metadata:
  name: {{ template "dask.fullname" . }}-scheduler
  labels:
    app: {{ template "dask.name" . }}
    heritage: {{ .Release.Service | quote }}
    release: {{ .Release.Name | quote }}
    chart: {{ template "dask.chart" . }}
    component: scheduler
spec:
  replicas: {{ .Values.scheduler.replicas }}
  selector:
    matchLabels:
      app: {{ template "dask.name" . }}
      release: {{ .Release.Name | quote }}
      component: scheduler
  strategy:
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: {{ template "dask.name" . }}
        release: {{ .Release.Name | quote }}
        component: scheduler
    spec:
      containers:
        - name: {{ template "dask.fullname" . }}-scheduler
          image: "{{ .Values.scheduler.image.repository }}:{{ .Values.scheduler.image.tag }}"
          imagePullPolicy: {{ .Values.scheduler.image.pullPolicy }}
          args:
            - dask-scheduler
            - --port
            - "{{ .Values.scheduler.servicePort }}"
            - --bokeh-port
            - "8787"
          ports:
            - containerPort: 8786
            - containerPort: 8787
          resources:
{{ toYaml .Values.scheduler.resources | indent 12 }}
          env:
{{ toYaml .Values.scheduler.env | indent 12 }}
