Files
Janis Eccarius f2d13efcd7 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>
2026-06-21 16:06:51 +02:00

52 lines
1.3 KiB
YAML
Executable File

apiVersion: apps/v1
kind: Deployment
metadata:
name: spark-worker
labels:
app.kubernetes.io/name: spark-worker
app.kubernetes.io/part-of: nowchess
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: spark-worker
template:
metadata:
labels:
app.kubernetes.io/name: spark-worker
app.kubernetes.io/part-of: nowchess
spec:
containers:
- name: spark-worker
image: apache/spark:4.0.3-scala2.13-java17-ubuntu
command:
- /opt/spark/bin/spark-class
- org.apache.spark.deploy.worker.Worker
- spark://spark-master:7077
env:
- name: SPARK_WORKER_CORES
value: "2"
- name: SPARK_WORKER_MEMORY
value: "512m"
ports:
- name: webui
containerPort: 8081
resources:
requests:
cpu: 100m
memory: 256Mi
limits:
cpu: 500m
memory: 1Gi
volumeMounts:
- name: spark-events
mountPath: /spark-events
- name: spark-output
mountPath: /spark-output
volumes:
- name: spark-events
emptyDir: {}
- name: spark-output
persistentVolumeClaim:
claimName: spark-analytics-output