example_spark_kubernetes_spark_pi.yaml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #
  2. # Copyright 2017 Google LLC
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # https://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. apiVersion: 'sparkoperator.k8s.io/v1beta2'
  16. kind: SparkApplication
  17. metadata:
  18. name: "spark-pi-{{ ds }}-{{ task_instance.try_number }}"
  19. namespace: spark-operator
  20. spec:
  21. type: Scala
  22. mode: cluster
  23. image: 'registry.cn-hangzhou.aliyuncs.com/sxtest/spark:v3.1.1'
  24. imagePullPolicy: Always
  25. mainClass: org.apache.spark.examples.SparkPi
  26. mainApplicationFile: 'local:///opt/spark/examples/jars/spark-examples_2.12-3.1.1.jar'
  27. sparkVersion: '3.1.1'
  28. restartPolicy:
  29. type: Never
  30. volumes:
  31. - name: 'test-volume'
  32. hostPath:
  33. path: '/tmp'
  34. type: Directory
  35. driver:
  36. cores: 1
  37. coreLimit: '1200m'
  38. memory: '512m'
  39. labels:
  40. version: 3.1.1
  41. serviceAccount: spark
  42. volumeMounts:
  43. - name: 'test-volume'
  44. mountPath: '/tmp'
  45. executor:
  46. cores: 1
  47. instances: 1
  48. memory: '512m'
  49. labels:
  50. version: 3.1.1
  51. volumeMounts:
  52. - name: 'test-volume'
  53. mountPath: '/tmp'