fix(spark): replace shared spark-events PVC with emptyDir to fix Multi-Attach error
local-path provisioner is RWO-only; attaching a single PVC to master, two workers, history-server, and streaming pod on separate nodes causes Multi-Attach errors. Each pod now gets its own ephemeral emptyDir for /spark-events. Event logging confs removed from CronJobs and streaming Deployment (logs are pod-local and do not persist across restarts). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -34,10 +34,6 @@ spec:
|
||||
- spark.executor.memory=1g
|
||||
- --conf
|
||||
- spark.driver.memory=512m
|
||||
- --conf
|
||||
- spark.eventLog.enabled=true
|
||||
- --conf
|
||||
- spark.eventLog.dir=/spark-events
|
||||
- --class
|
||||
- de.nowchess.analytics.OpeningBookJob
|
||||
- local:///app/analytics.jar
|
||||
@@ -69,15 +65,10 @@ spec:
|
||||
volumeMounts:
|
||||
- name: spark-output
|
||||
mountPath: /spark-output
|
||||
- name: spark-events
|
||||
mountPath: /spark-events
|
||||
volumes:
|
||||
- name: spark-output
|
||||
persistentVolumeClaim:
|
||||
claimName: spark-analytics-output
|
||||
- name: spark-events
|
||||
persistentVolumeClaim:
|
||||
claimName: spark-events
|
||||
---
|
||||
apiVersion: batch/v1
|
||||
kind: CronJob
|
||||
@@ -115,10 +106,6 @@ spec:
|
||||
- spark.executor.memory=1g
|
||||
- --conf
|
||||
- spark.driver.memory=512m
|
||||
- --conf
|
||||
- spark.eventLog.enabled=true
|
||||
- --conf
|
||||
- spark.eventLog.dir=/spark-events
|
||||
- --class
|
||||
- de.nowchess.analytics.PlayerStatsJob
|
||||
- local:///app/analytics.jar
|
||||
@@ -149,15 +136,10 @@ spec:
|
||||
volumeMounts:
|
||||
- name: spark-output
|
||||
mountPath: /spark-output
|
||||
- name: spark-events
|
||||
mountPath: /spark-events
|
||||
volumes:
|
||||
- name: spark-output
|
||||
persistentVolumeClaim:
|
||||
claimName: spark-analytics-output
|
||||
- name: spark-events
|
||||
persistentVolumeClaim:
|
||||
claimName: spark-events
|
||||
---
|
||||
apiVersion: batch/v1
|
||||
kind: CronJob
|
||||
@@ -195,10 +177,6 @@ spec:
|
||||
- spark.executor.memory=1g
|
||||
- --conf
|
||||
- spark.driver.memory=512m
|
||||
- --conf
|
||||
- spark.eventLog.enabled=true
|
||||
- --conf
|
||||
- spark.eventLog.dir=/spark-events
|
||||
- --class
|
||||
- de.nowchess.analytics.PlayerClusteringJob
|
||||
- local:///app/analytics.jar
|
||||
@@ -230,15 +208,10 @@ spec:
|
||||
volumeMounts:
|
||||
- name: spark-output
|
||||
mountPath: /spark-output
|
||||
- name: spark-events
|
||||
mountPath: /spark-events
|
||||
volumes:
|
||||
- name: spark-output
|
||||
persistentVolumeClaim:
|
||||
claimName: spark-analytics-output
|
||||
- name: spark-events
|
||||
persistentVolumeClaim:
|
||||
claimName: spark-events
|
||||
---
|
||||
apiVersion: batch/v1
|
||||
kind: CronJob
|
||||
@@ -276,10 +249,6 @@ spec:
|
||||
- spark.executor.memory=1g
|
||||
- --conf
|
||||
- spark.driver.memory=512m
|
||||
- --conf
|
||||
- spark.eventLog.enabled=true
|
||||
- --conf
|
||||
- spark.eventLog.dir=/spark-events
|
||||
- --class
|
||||
- de.nowchess.analytics.PlayerGraphJob
|
||||
- local:///app/analytics.jar
|
||||
@@ -310,12 +279,7 @@ spec:
|
||||
volumeMounts:
|
||||
- name: spark-output
|
||||
mountPath: /spark-output
|
||||
- name: spark-events
|
||||
mountPath: /spark-events
|
||||
volumes:
|
||||
- name: spark-output
|
||||
persistentVolumeClaim:
|
||||
claimName: spark-analytics-output
|
||||
- name: spark-events
|
||||
persistentVolumeClaim:
|
||||
claimName: spark-events
|
||||
|
||||
@@ -33,10 +33,6 @@ spec:
|
||||
- spark.executor.memory=512m
|
||||
- --conf
|
||||
- spark.driver.memory=512m
|
||||
- --conf
|
||||
- spark.eventLog.enabled=true
|
||||
- --conf
|
||||
- spark.eventLog.dir=/spark-events
|
||||
- --class
|
||||
- de.nowchess.analytics.LiveDashboardJob
|
||||
- local:///app/analytics.jar
|
||||
@@ -67,12 +63,7 @@ spec:
|
||||
volumeMounts:
|
||||
- name: spark-checkpoint
|
||||
mountPath: /spark-checkpoint
|
||||
- name: spark-events
|
||||
mountPath: /spark-events
|
||||
volumes:
|
||||
- name: spark-checkpoint
|
||||
persistentVolumeClaim:
|
||||
claimName: spark-streaming-checkpoint
|
||||
- name: spark-events
|
||||
persistentVolumeClaim:
|
||||
claimName: spark-events
|
||||
|
||||
@@ -31,10 +31,6 @@ patches:
|
||||
- spark.executor.memory=1g
|
||||
- --conf
|
||||
- spark.driver.memory=512m
|
||||
- --conf
|
||||
- spark.eventLog.enabled=true
|
||||
- --conf
|
||||
- spark.eventLog.dir=/spark-events
|
||||
- --class
|
||||
- de.nowchess.analytics.OpeningBookJob
|
||||
- local:///app/analytics.jar
|
||||
@@ -65,10 +61,6 @@ patches:
|
||||
- spark.executor.memory=1g
|
||||
- --conf
|
||||
- spark.driver.memory=512m
|
||||
- --conf
|
||||
- spark.eventLog.enabled=true
|
||||
- --conf
|
||||
- spark.eventLog.dir=/spark-events
|
||||
- --class
|
||||
- de.nowchess.analytics.PlayerStatsJob
|
||||
- local:///app/analytics.jar
|
||||
@@ -98,10 +90,6 @@ patches:
|
||||
- spark.executor.memory=1g
|
||||
- --conf
|
||||
- spark.driver.memory=512m
|
||||
- --conf
|
||||
- spark.eventLog.enabled=true
|
||||
- --conf
|
||||
- spark.eventLog.dir=/spark-events
|
||||
- --class
|
||||
- de.nowchess.analytics.PlayerClusteringJob
|
||||
- local:///app/analytics.jar
|
||||
@@ -132,10 +120,6 @@ patches:
|
||||
- spark.executor.memory=1g
|
||||
- --conf
|
||||
- spark.driver.memory=512m
|
||||
- --conf
|
||||
- spark.eventLog.enabled=true
|
||||
- --conf
|
||||
- spark.eventLog.dir=/spark-events
|
||||
- --class
|
||||
- de.nowchess.analytics.PlayerGraphJob
|
||||
- local:///app/analytics.jar
|
||||
@@ -163,10 +147,6 @@ patches:
|
||||
- spark.executor.memory=512m
|
||||
- --conf
|
||||
- spark.driver.memory=512m
|
||||
- --conf
|
||||
- spark.eventLog.enabled=true
|
||||
- --conf
|
||||
- spark.eventLog.dir=/spark-events
|
||||
- --class
|
||||
- de.nowchess.analytics.LiveDashboardJob
|
||||
- local:///app/analytics.jar
|
||||
|
||||
@@ -40,8 +40,7 @@ spec:
|
||||
mountPath: /spark-events
|
||||
volumes:
|
||||
- name: spark-events
|
||||
persistentVolumeClaim:
|
||||
claimName: spark-events
|
||||
emptyDir: {}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
|
||||
@@ -42,8 +42,7 @@ spec:
|
||||
mountPath: /spark-events
|
||||
volumes:
|
||||
- name: spark-events
|
||||
persistentVolumeClaim:
|
||||
claimName: spark-events
|
||||
emptyDir: {}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
|
||||
@@ -1,18 +1,5 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: spark-events
|
||||
labels:
|
||||
app.kubernetes.io/name: spark-cluster
|
||||
app.kubernetes.io/part-of: nowchess
|
||||
spec:
|
||||
# ReadWriteOnce for k3d/local-path compatibility.
|
||||
# NOTE: k3d uses the local-path provisioner which only supports RWO.
|
||||
# For production with multiple concurrent writers (workers + history server),
|
||||
# replace with a RWX-capable storage class such as NFS or Longhorn and
|
||||
# change accessModes to [ReadWriteMany].
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 5Gi
|
||||
# No cluster-level PVCs needed.
|
||||
# Analytics output and streaming checkpoint PVCs live in spark-analytics/base/pvc.yaml.
|
||||
# spark-events PVC removed: local-path provisioner is RWO-only; sharing a single PVC
|
||||
# across master, workers, and history-server on different nodes causes Multi-Attach errors.
|
||||
# Event logs now use emptyDir (pod-local, ephemeral) on each pod.
|
||||
|
||||
@@ -43,5 +43,4 @@ spec:
|
||||
mountPath: /spark-events
|
||||
volumes:
|
||||
- name: spark-events
|
||||
persistentVolumeClaim:
|
||||
claimName: spark-events
|
||||
emptyDir: {}
|
||||
|
||||
Reference in New Issue
Block a user