apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: spark-worker
  labels:
    app: spark-worker
spec:
  selector:
    matchLabels:
      name: spark-worker
  template:
    metadata:
      labels:
        name: spark-worker
    spec:
      restartPolicy: Always
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
              - matchExpressions:
                - key: kubernetes.io/arch
                  operator: In
                  values:
                  - arm64
      containers:
        - name: spark-worker
          image: diegofpsouza/bigdata_spark:0.0.1
          imagePullPolicy: Always
          env:
            - name: SPARK_MODE
              value: worker
