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
|
- spark.executor.memory=1g
|
||||||
- --conf
|
- --conf
|
||||||
- spark.driver.memory=512m
|
- spark.driver.memory=512m
|
||||||
- --conf
|
|
||||||
- spark.eventLog.enabled=true
|
|
||||||
- --conf
|
|
||||||
- spark.eventLog.dir=/spark-events
|
|
||||||
- --class
|
- --class
|
||||||
- de.nowchess.analytics.OpeningBookJob
|
- de.nowchess.analytics.OpeningBookJob
|
||||||
- local:///app/analytics.jar
|
- local:///app/analytics.jar
|
||||||
@@ -69,15 +65,10 @@ spec:
|
|||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: spark-output
|
- name: spark-output
|
||||||
mountPath: /spark-output
|
mountPath: /spark-output
|
||||||
- name: spark-events
|
|
||||||
mountPath: /spark-events
|
|
||||||
volumes:
|
volumes:
|
||||||
- name: spark-output
|
- name: spark-output
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: spark-analytics-output
|
claimName: spark-analytics-output
|
||||||
- name: spark-events
|
|
||||||
persistentVolumeClaim:
|
|
||||||
claimName: spark-events
|
|
||||||
---
|
---
|
||||||
apiVersion: batch/v1
|
apiVersion: batch/v1
|
||||||
kind: CronJob
|
kind: CronJob
|
||||||
@@ -115,10 +106,6 @@ spec:
|
|||||||
- spark.executor.memory=1g
|
- spark.executor.memory=1g
|
||||||
- --conf
|
- --conf
|
||||||
- spark.driver.memory=512m
|
- spark.driver.memory=512m
|
||||||
- --conf
|
|
||||||
- spark.eventLog.enabled=true
|
|
||||||
- --conf
|
|
||||||
- spark.eventLog.dir=/spark-events
|
|
||||||
- --class
|
- --class
|
||||||
- de.nowchess.analytics.PlayerStatsJob
|
- de.nowchess.analytics.PlayerStatsJob
|
||||||
- local:///app/analytics.jar
|
- local:///app/analytics.jar
|
||||||
@@ -149,15 +136,10 @@ spec:
|
|||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: spark-output
|
- name: spark-output
|
||||||
mountPath: /spark-output
|
mountPath: /spark-output
|
||||||
- name: spark-events
|
|
||||||
mountPath: /spark-events
|
|
||||||
volumes:
|
volumes:
|
||||||
- name: spark-output
|
- name: spark-output
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: spark-analytics-output
|
claimName: spark-analytics-output
|
||||||
- name: spark-events
|
|
||||||
persistentVolumeClaim:
|
|
||||||
claimName: spark-events
|
|
||||||
---
|
---
|
||||||
apiVersion: batch/v1
|
apiVersion: batch/v1
|
||||||
kind: CronJob
|
kind: CronJob
|
||||||
@@ -195,10 +177,6 @@ spec:
|
|||||||
- spark.executor.memory=1g
|
- spark.executor.memory=1g
|
||||||
- --conf
|
- --conf
|
||||||
- spark.driver.memory=512m
|
- spark.driver.memory=512m
|
||||||
- --conf
|
|
||||||
- spark.eventLog.enabled=true
|
|
||||||
- --conf
|
|
||||||
- spark.eventLog.dir=/spark-events
|
|
||||||
- --class
|
- --class
|
||||||
- de.nowchess.analytics.PlayerClusteringJob
|
- de.nowchess.analytics.PlayerClusteringJob
|
||||||
- local:///app/analytics.jar
|
- local:///app/analytics.jar
|
||||||
@@ -230,15 +208,10 @@ spec:
|
|||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: spark-output
|
- name: spark-output
|
||||||
mountPath: /spark-output
|
mountPath: /spark-output
|
||||||
- name: spark-events
|
|
||||||
mountPath: /spark-events
|
|
||||||
volumes:
|
volumes:
|
||||||
- name: spark-output
|
- name: spark-output
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: spark-analytics-output
|
claimName: spark-analytics-output
|
||||||
- name: spark-events
|
|
||||||
persistentVolumeClaim:
|
|
||||||
claimName: spark-events
|
|
||||||
---
|
---
|
||||||
apiVersion: batch/v1
|
apiVersion: batch/v1
|
||||||
kind: CronJob
|
kind: CronJob
|
||||||
@@ -276,10 +249,6 @@ spec:
|
|||||||
- spark.executor.memory=1g
|
- spark.executor.memory=1g
|
||||||
- --conf
|
- --conf
|
||||||
- spark.driver.memory=512m
|
- spark.driver.memory=512m
|
||||||
- --conf
|
|
||||||
- spark.eventLog.enabled=true
|
|
||||||
- --conf
|
|
||||||
- spark.eventLog.dir=/spark-events
|
|
||||||
- --class
|
- --class
|
||||||
- de.nowchess.analytics.PlayerGraphJob
|
- de.nowchess.analytics.PlayerGraphJob
|
||||||
- local:///app/analytics.jar
|
- local:///app/analytics.jar
|
||||||
@@ -310,12 +279,7 @@ spec:
|
|||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: spark-output
|
- name: spark-output
|
||||||
mountPath: /spark-output
|
mountPath: /spark-output
|
||||||
- name: spark-events
|
|
||||||
mountPath: /spark-events
|
|
||||||
volumes:
|
volumes:
|
||||||
- name: spark-output
|
- name: spark-output
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: spark-analytics-output
|
claimName: spark-analytics-output
|
||||||
- name: spark-events
|
|
||||||
persistentVolumeClaim:
|
|
||||||
claimName: spark-events
|
|
||||||
|
|||||||
@@ -33,10 +33,6 @@ spec:
|
|||||||
- spark.executor.memory=512m
|
- spark.executor.memory=512m
|
||||||
- --conf
|
- --conf
|
||||||
- spark.driver.memory=512m
|
- spark.driver.memory=512m
|
||||||
- --conf
|
|
||||||
- spark.eventLog.enabled=true
|
|
||||||
- --conf
|
|
||||||
- spark.eventLog.dir=/spark-events
|
|
||||||
- --class
|
- --class
|
||||||
- de.nowchess.analytics.LiveDashboardJob
|
- de.nowchess.analytics.LiveDashboardJob
|
||||||
- local:///app/analytics.jar
|
- local:///app/analytics.jar
|
||||||
@@ -67,12 +63,7 @@ spec:
|
|||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: spark-checkpoint
|
- name: spark-checkpoint
|
||||||
mountPath: /spark-checkpoint
|
mountPath: /spark-checkpoint
|
||||||
- name: spark-events
|
|
||||||
mountPath: /spark-events
|
|
||||||
volumes:
|
volumes:
|
||||||
- name: spark-checkpoint
|
- name: spark-checkpoint
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: spark-streaming-checkpoint
|
claimName: spark-streaming-checkpoint
|
||||||
- name: spark-events
|
|
||||||
persistentVolumeClaim:
|
|
||||||
claimName: spark-events
|
|
||||||
|
|||||||
@@ -31,10 +31,6 @@ patches:
|
|||||||
- spark.executor.memory=1g
|
- spark.executor.memory=1g
|
||||||
- --conf
|
- --conf
|
||||||
- spark.driver.memory=512m
|
- spark.driver.memory=512m
|
||||||
- --conf
|
|
||||||
- spark.eventLog.enabled=true
|
|
||||||
- --conf
|
|
||||||
- spark.eventLog.dir=/spark-events
|
|
||||||
- --class
|
- --class
|
||||||
- de.nowchess.analytics.OpeningBookJob
|
- de.nowchess.analytics.OpeningBookJob
|
||||||
- local:///app/analytics.jar
|
- local:///app/analytics.jar
|
||||||
@@ -65,10 +61,6 @@ patches:
|
|||||||
- spark.executor.memory=1g
|
- spark.executor.memory=1g
|
||||||
- --conf
|
- --conf
|
||||||
- spark.driver.memory=512m
|
- spark.driver.memory=512m
|
||||||
- --conf
|
|
||||||
- spark.eventLog.enabled=true
|
|
||||||
- --conf
|
|
||||||
- spark.eventLog.dir=/spark-events
|
|
||||||
- --class
|
- --class
|
||||||
- de.nowchess.analytics.PlayerStatsJob
|
- de.nowchess.analytics.PlayerStatsJob
|
||||||
- local:///app/analytics.jar
|
- local:///app/analytics.jar
|
||||||
@@ -98,10 +90,6 @@ patches:
|
|||||||
- spark.executor.memory=1g
|
- spark.executor.memory=1g
|
||||||
- --conf
|
- --conf
|
||||||
- spark.driver.memory=512m
|
- spark.driver.memory=512m
|
||||||
- --conf
|
|
||||||
- spark.eventLog.enabled=true
|
|
||||||
- --conf
|
|
||||||
- spark.eventLog.dir=/spark-events
|
|
||||||
- --class
|
- --class
|
||||||
- de.nowchess.analytics.PlayerClusteringJob
|
- de.nowchess.analytics.PlayerClusteringJob
|
||||||
- local:///app/analytics.jar
|
- local:///app/analytics.jar
|
||||||
@@ -132,10 +120,6 @@ patches:
|
|||||||
- spark.executor.memory=1g
|
- spark.executor.memory=1g
|
||||||
- --conf
|
- --conf
|
||||||
- spark.driver.memory=512m
|
- spark.driver.memory=512m
|
||||||
- --conf
|
|
||||||
- spark.eventLog.enabled=true
|
|
||||||
- --conf
|
|
||||||
- spark.eventLog.dir=/spark-events
|
|
||||||
- --class
|
- --class
|
||||||
- de.nowchess.analytics.PlayerGraphJob
|
- de.nowchess.analytics.PlayerGraphJob
|
||||||
- local:///app/analytics.jar
|
- local:///app/analytics.jar
|
||||||
@@ -163,10 +147,6 @@ patches:
|
|||||||
- spark.executor.memory=512m
|
- spark.executor.memory=512m
|
||||||
- --conf
|
- --conf
|
||||||
- spark.driver.memory=512m
|
- spark.driver.memory=512m
|
||||||
- --conf
|
|
||||||
- spark.eventLog.enabled=true
|
|
||||||
- --conf
|
|
||||||
- spark.eventLog.dir=/spark-events
|
|
||||||
- --class
|
- --class
|
||||||
- de.nowchess.analytics.LiveDashboardJob
|
- de.nowchess.analytics.LiveDashboardJob
|
||||||
- local:///app/analytics.jar
|
- local:///app/analytics.jar
|
||||||
|
|||||||
@@ -40,8 +40,7 @@ spec:
|
|||||||
mountPath: /spark-events
|
mountPath: /spark-events
|
||||||
volumes:
|
volumes:
|
||||||
- name: spark-events
|
- name: spark-events
|
||||||
persistentVolumeClaim:
|
emptyDir: {}
|
||||||
claimName: spark-events
|
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
|
|||||||
@@ -42,8 +42,7 @@ spec:
|
|||||||
mountPath: /spark-events
|
mountPath: /spark-events
|
||||||
volumes:
|
volumes:
|
||||||
- name: spark-events
|
- name: spark-events
|
||||||
persistentVolumeClaim:
|
emptyDir: {}
|
||||||
claimName: spark-events
|
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
|
|||||||
@@ -1,18 +1,5 @@
|
|||||||
apiVersion: v1
|
# No cluster-level PVCs needed.
|
||||||
kind: PersistentVolumeClaim
|
# Analytics output and streaming checkpoint PVCs live in spark-analytics/base/pvc.yaml.
|
||||||
metadata:
|
# spark-events PVC removed: local-path provisioner is RWO-only; sharing a single PVC
|
||||||
name: spark-events
|
# across master, workers, and history-server on different nodes causes Multi-Attach errors.
|
||||||
labels:
|
# Event logs now use emptyDir (pod-local, ephemeral) on each pod.
|
||||||
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
|
|
||||||
|
|||||||
@@ -43,5 +43,4 @@ spec:
|
|||||||
mountPath: /spark-events
|
mountPath: /spark-events
|
||||||
volumes:
|
volumes:
|
||||||
- name: spark-events
|
- name: spark-events
|
||||||
persistentVolumeClaim:
|
emptyDir: {}
|
||||||
claimName: spark-events
|
|
||||||
|
|||||||
Reference in New Issue
Block a user