fix: co-locate analytics driver pods with spark-worker for RWO PVC access
do-block-storage only supports ReadWriteOnce. Executor tasks failed with `Mkdirs failed` because the executor ran on the spark-worker node which had no mount of the spark-analytics-output PVC. - Mount spark-analytics-output PVC on spark-worker pod at /spark-output - Add podAffinity to all 11 analytics CronJob driver pods to schedule on the same node as spark-worker, ensuring the RWO PVC is accessible by both driver and executor Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -230,6 +230,13 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
serviceAccountName: spark-analytics
|
serviceAccountName: spark-analytics
|
||||||
restartPolicy: OnFailure
|
restartPolicy: OnFailure
|
||||||
|
affinity:
|
||||||
|
podAffinity:
|
||||||
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- labelSelector:
|
||||||
|
matchLabels:
|
||||||
|
app.kubernetes.io/name: spark-worker
|
||||||
|
topologyKey: kubernetes.io/hostname
|
||||||
securityContext:
|
securityContext:
|
||||||
fsGroup: 185
|
fsGroup: 185
|
||||||
imagePullSecrets:
|
imagePullSecrets:
|
||||||
@@ -314,6 +321,13 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
serviceAccountName: spark-analytics
|
serviceAccountName: spark-analytics
|
||||||
restartPolicy: OnFailure
|
restartPolicy: OnFailure
|
||||||
|
affinity:
|
||||||
|
podAffinity:
|
||||||
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- labelSelector:
|
||||||
|
matchLabels:
|
||||||
|
app.kubernetes.io/name: spark-worker
|
||||||
|
topologyKey: kubernetes.io/hostname
|
||||||
securityContext:
|
securityContext:
|
||||||
fsGroup: 185
|
fsGroup: 185
|
||||||
imagePullSecrets:
|
imagePullSecrets:
|
||||||
@@ -397,6 +411,13 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
serviceAccountName: spark-analytics
|
serviceAccountName: spark-analytics
|
||||||
restartPolicy: OnFailure
|
restartPolicy: OnFailure
|
||||||
|
affinity:
|
||||||
|
podAffinity:
|
||||||
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- labelSelector:
|
||||||
|
matchLabels:
|
||||||
|
app.kubernetes.io/name: spark-worker
|
||||||
|
topologyKey: kubernetes.io/hostname
|
||||||
securityContext:
|
securityContext:
|
||||||
fsGroup: 185
|
fsGroup: 185
|
||||||
imagePullSecrets:
|
imagePullSecrets:
|
||||||
@@ -481,6 +502,13 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
serviceAccountName: spark-analytics
|
serviceAccountName: spark-analytics
|
||||||
restartPolicy: OnFailure
|
restartPolicy: OnFailure
|
||||||
|
affinity:
|
||||||
|
podAffinity:
|
||||||
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- labelSelector:
|
||||||
|
matchLabels:
|
||||||
|
app.kubernetes.io/name: spark-worker
|
||||||
|
topologyKey: kubernetes.io/hostname
|
||||||
securityContext:
|
securityContext:
|
||||||
fsGroup: 185
|
fsGroup: 185
|
||||||
imagePullSecrets:
|
imagePullSecrets:
|
||||||
@@ -564,6 +592,13 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
serviceAccountName: spark-analytics
|
serviceAccountName: spark-analytics
|
||||||
restartPolicy: OnFailure
|
restartPolicy: OnFailure
|
||||||
|
affinity:
|
||||||
|
podAffinity:
|
||||||
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- labelSelector:
|
||||||
|
matchLabels:
|
||||||
|
app.kubernetes.io/name: spark-worker
|
||||||
|
topologyKey: kubernetes.io/hostname
|
||||||
securityContext:
|
securityContext:
|
||||||
fsGroup: 185
|
fsGroup: 185
|
||||||
imagePullSecrets:
|
imagePullSecrets:
|
||||||
@@ -647,6 +682,13 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
serviceAccountName: spark-analytics
|
serviceAccountName: spark-analytics
|
||||||
restartPolicy: OnFailure
|
restartPolicy: OnFailure
|
||||||
|
affinity:
|
||||||
|
podAffinity:
|
||||||
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- labelSelector:
|
||||||
|
matchLabels:
|
||||||
|
app.kubernetes.io/name: spark-worker
|
||||||
|
topologyKey: kubernetes.io/hostname
|
||||||
securityContext:
|
securityContext:
|
||||||
fsGroup: 185
|
fsGroup: 185
|
||||||
imagePullSecrets:
|
imagePullSecrets:
|
||||||
@@ -730,6 +772,13 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
serviceAccountName: spark-analytics
|
serviceAccountName: spark-analytics
|
||||||
restartPolicy: OnFailure
|
restartPolicy: OnFailure
|
||||||
|
affinity:
|
||||||
|
podAffinity:
|
||||||
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- labelSelector:
|
||||||
|
matchLabels:
|
||||||
|
app.kubernetes.io/name: spark-worker
|
||||||
|
topologyKey: kubernetes.io/hostname
|
||||||
securityContext:
|
securityContext:
|
||||||
fsGroup: 185
|
fsGroup: 185
|
||||||
imagePullSecrets:
|
imagePullSecrets:
|
||||||
@@ -813,6 +862,13 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
serviceAccountName: spark-analytics
|
serviceAccountName: spark-analytics
|
||||||
restartPolicy: OnFailure
|
restartPolicy: OnFailure
|
||||||
|
affinity:
|
||||||
|
podAffinity:
|
||||||
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- labelSelector:
|
||||||
|
matchLabels:
|
||||||
|
app.kubernetes.io/name: spark-worker
|
||||||
|
topologyKey: kubernetes.io/hostname
|
||||||
securityContext:
|
securityContext:
|
||||||
fsGroup: 185
|
fsGroup: 185
|
||||||
imagePullSecrets:
|
imagePullSecrets:
|
||||||
@@ -896,6 +952,13 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
serviceAccountName: spark-analytics
|
serviceAccountName: spark-analytics
|
||||||
restartPolicy: OnFailure
|
restartPolicy: OnFailure
|
||||||
|
affinity:
|
||||||
|
podAffinity:
|
||||||
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- labelSelector:
|
||||||
|
matchLabels:
|
||||||
|
app.kubernetes.io/name: spark-worker
|
||||||
|
topologyKey: kubernetes.io/hostname
|
||||||
securityContext:
|
securityContext:
|
||||||
fsGroup: 185
|
fsGroup: 185
|
||||||
imagePullSecrets:
|
imagePullSecrets:
|
||||||
@@ -978,6 +1041,13 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
serviceAccountName: spark-analytics
|
serviceAccountName: spark-analytics
|
||||||
restartPolicy: OnFailure
|
restartPolicy: OnFailure
|
||||||
|
affinity:
|
||||||
|
podAffinity:
|
||||||
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- labelSelector:
|
||||||
|
matchLabels:
|
||||||
|
app.kubernetes.io/name: spark-worker
|
||||||
|
topologyKey: kubernetes.io/hostname
|
||||||
securityContext:
|
securityContext:
|
||||||
fsGroup: 185
|
fsGroup: 185
|
||||||
imagePullSecrets:
|
imagePullSecrets:
|
||||||
@@ -1061,6 +1131,13 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
serviceAccountName: spark-analytics
|
serviceAccountName: spark-analytics
|
||||||
restartPolicy: OnFailure
|
restartPolicy: OnFailure
|
||||||
|
affinity:
|
||||||
|
podAffinity:
|
||||||
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
- labelSelector:
|
||||||
|
matchLabels:
|
||||||
|
app.kubernetes.io/name: spark-worker
|
||||||
|
topologyKey: kubernetes.io/hostname
|
||||||
securityContext:
|
securityContext:
|
||||||
fsGroup: 185
|
fsGroup: 185
|
||||||
imagePullSecrets:
|
imagePullSecrets:
|
||||||
|
|||||||
@@ -41,6 +41,11 @@ spec:
|
|||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: spark-events
|
- name: spark-events
|
||||||
mountPath: /spark-events
|
mountPath: /spark-events
|
||||||
|
- name: spark-output
|
||||||
|
mountPath: /spark-output
|
||||||
volumes:
|
volumes:
|
||||||
- name: spark-events
|
- name: spark-events
|
||||||
emptyDir: {}
|
emptyDir: {}
|
||||||
|
- name: spark-output
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: spark-analytics-output
|
||||||
|
|||||||
Reference in New Issue
Block a user