I have in Azure a Kubernetes cluster that deploys three Docker containers: a Flask server, a Dask Scheduler and a Dask Worker. This works fine, now I need to deploy N workers instead of one.
This is the yaml file:
apiVersion: apps/v1
kind: Deployment
metadata:
name: img-python
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: cont-python
template:
metadata:
labels:
app: cont-python
spec:
containers:
- name: cont-flask
image: xxx.azurecr.io/myimage:latest
command: ["gunicorn"]
args: ["-t", "7200", "-b", "0.0.0.0:5000", "--reload", "app.front.app:app"]
ports:
- containerPort: 5000
volumeMounts:
- name: volcode
mountPath: /code
- name: cont-scheduler
image: xxx.azurecr.io/myimage:latest
command: ["dask-scheduler"]
ports:
- containerPort: 8786
- containerPort: 8787
- name: cont-worker
image: xxx.azurecr.io/myimage:latest
workingDir: /code
command: ["dask-worker"]
args: ["scheduler:8786"]
volumeMounts:
- name: volcode
mountPath: /code
volumes:
- name: volcode
azureFile:
shareName: py-code
readOnly: false
I looked at the kubectl scale
command however it seems to scale the entire cluster, not only specifically the worker's container.
How to specify the number of workers?