我使用以下代码创建了一个集群
from dask_kubernetes import KubeCluster
cluster = KubeCluster.from_yaml('worker.yaml')
cluster.adapt(minimum=1, maximum=10)
使用以下 yaml 代码 ( worker.yaml
):
kind: Pod
metadata:
labels:
foo: bar
spec:
restartPolicy: Never
containers:
- image: daskdev/dask:latest
imagePullPolicy: IfNotPresent
args: [dask-worker, --nthreads, '4', --no-bokeh, --memory-limit, 3GB, --death-timeout, '300']
name: dask
resources:
limits:
cpu: "4"
memory: 3G
requests:
cpu: "2"
memory: 2G
这按预期工作。现在我添加了一个卷挂载,如图所示
kind: Pod
metadata:
labels:
foo: bar
spec:
restartPolicy: Never
containers:
- image: daskdev/dask:latest
imagePullPolicy: IfNotPresent
args: [dask-worker, --nthreads, '4', --no-bokeh, --memory-limit, 3GB, --death-timeout, '300']
name: dask
resources:
limits:
cpu: "4"
memory: 3G
requests:
cpu: "2"
memory: 2G
volumeMounts:
- name: somedata
mountPath: /opt/some/data
volumes:
- name: somedata
azureFile:
secretName: azure-secret
shareName: somedata
readOnly: true
我没有看到已安装卷。但是当我简单地跑
kubectl create -f worker.yaml
我可以看到卷已安装。
是否KubeCluster
支持卷挂载?如果是这样,您如何配置它们?