# helm_charts_dask-worker-deployment.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: {{ template "dask-distributed.worker-fullname" . }}
  labels:
    app: {{ template "dask-distributed.name" . }}
    heritage: {{ .Release.Service | quote }}
    release: {{ .Release.Name | quote }}
    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    component: "{{ .Release.Name }}-{{ .Values.worker.component }}"
spec:
  replicas: {{ .Values.worker.replicas }}
  strategy:
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: {{ template "dask-distributed.name" . }}
        release: {{ .Release.Name | quote }}
        component: "{{ .Release.Name }}-{{ .Values.worker.component }}"
    spec:
      containers:
        - name: {{ template "dask-distributed.worker-fullname" . }}
          image: "{{ .Values.worker.image }}:{{ .Values.worker.imageTag }}"
          command: ["dask-worker", "{{ template "dask-distributed.scheduler-fullname" . }}:{{ .Values.scheduler.servicePort }}"]
          ports:
            - containerPort: {{ .Values.worker.containerPort }}
          resources:
{{ toYaml .Values.worker.resources | indent 12 }}