spark-operator

by joaquinito2051

Helm chartv2.2.9App 2.2.1

A Helm chart for Spark on Kubernetes operator.

About this chart

spark-operator

A Helm chart for Spark on Kubernetes operator.

Homepage: https://github.com/kubeflow/spark-operator

Introduction

This chart bootstraps a Kubernetes Operator for Apache Spark deployment using the Helm package manager.

Prerequisites

  • Helm >= 3
  • Kubernetes >= 1.16

Previous Helm Chart

The previous spark-operator Helm chart hosted at helm/charts has been moved to this repository in accordance with the Deprecation timeline. Note that a few things have changed between this version and the old version:

  • This repository only supports Helm chart installations using Helm 3+ since the apiVersion on the chart has been marked as v2.
  • Previous versions of the Helm chart have not been migrated, and the version has been set to 1.0.0 at the onset. If you are looking for old versions of the chart, it's best to run helm pull incubator/sparkoperator --version <your-version> until you are ready to move to this repository's version.
  • Several configuration properties have been changed, carefully review the values section below to make sure you're aligned with the new values.

Usage

Add Helm Repo

helm repo add spark-operator https://kubeflow.github.io/spark-operator

helm repo update

See helm repo for command documentation.

Install the chart

helm install [RELEASE_NAME] spark-operator/spark-operator

For example, if you want to create a release with name spark-operator in the spark-operator namespace:

helm install spark-operator spark-operator/spark-operator \
    --namespace spark-operator \
    --create-namespace

Note that by passing the --create-namespace flag to the helm install command, helm will create the release namespace if it does not exist.

See helm install for command documentation.

Upgrade the chart

helm upgrade [RELEASE_NAME] spark-operator/spark-operator [flags]

See helm upgrade for command documentation.

Uninstall the chart

helm uninstall [RELEASE_NAME]

This removes all the Kubernetes resources associated with the chart and deletes the release, except for the crds, those will have to be removed manually.

See helm uninstall for command documentation.

Values

KeyTypeDefaultDescription
nameOverridestring""String to partially override release name.
fullnameOverridestring""String to fully override release name.
commonLabelsobject{}Common labels to add to the resources.
image.registrystring"ghcr.io"Image registry.
image.repositorystring"kubeflow/spark-operator/controller"Image repository.
image.tagstringIf not set, the chart appVersion will be used.Image tag.
image.pullPolicystring"IfNotPresent"Image pull policy.
image.pullSecretslist[]Image pull secrets for private image registry.
controller.replicasint1Number of replicas of controller.
controller.leaderElection.enablebooltrueSpecifies whether to enable leader election for controller.
controller.workersint10Reconcile concurrency, higher values might increase memory usage.
controller.logLevelstring"info"Configure the verbosity of logging, can be one of debug, info, error.
controller.driverPodCreationGracePeriodstring"10s"Grace period after a successful spark-submit when driver pod not found errors will be retried. Useful if the driver pod can take some time to be created.
controller.maxTrackedExecutorPerAppint1000Specifies the maximum number of Executor pods that can be tracked by the controller per SparkApplication.
controller.uiService.enablebooltrueSpecifies whether to create service for Spark web UI.
controller.uiIngress.enableboolfalseSpecifies whether to create ingress for Spark web UI. controller.uiService.enable must be true to enable ingress.
controller.uiIngress.urlFormatstring""Ingress URL format. Required if controller.uiIngress.enable is true.
controller.uiIngress.ingressClassNamestring""Optionally set the ingressClassName.
controller.uiIngress.tlslist[]Optionally set default TLS configuration for the Spark UI's ingress. ingressTLS in the SparkApplication spec overrides this.
controller.uiIngress.annotationsobject{}Optionally set default ingress annotations for the Spark UI's ingress. ingressAnnotations in the SparkApplication spec overrides this.
controller.batchScheduler.enableboolfalseSpecifies whether to enable batch scheduler for spark jobs scheduling. If enabled, users can specify batch scheduler name in spark application.
controller.batchScheduler.kubeSchedulerNameslist[]Specifies a list of kube-scheduler names for scheduling Spark pods.
controller.batchScheduler.defaultstring""Default batch scheduler to be used if not specified by the user. If specified, this value must be either "volcano" or "yunikorn". Specifying any other value will cause the controller to error on startup.
controller.serviceAccount.createbooltrueSpecifies whether to create a service account for the controller.
controller.serviceAccount.namestring""Optional name for the controller service account.
controller.serviceAccount.annotationsobject{}Extra annotations for the controller service account.
controller.serviceAccount.automountServiceAccountTokenbooltrueAuto-mount service account token to the controller pods.
controller.rbac.createbooltrueSpecifies whether to create RBAC resources for the controller.
controller.rbac.annotationsobject{}Extra annotations for the controller RBAC resources.
controller.labelsobject{}Extra labels for controller pods.
controller.annotationsobject{}Extra annotations for controller pods.
controller.volumeslist[{"emptyDir":{"sizeLimit":"1Gi"},"name":"tmp"}]Volumes for controller pods.
controller.nodeSelectorobject{}Node selector for controller pods.
controller.affinityobject{}Affinity for controller pods.
controller.tolerationslist[]List of node taints to tolerate for controller pods.
controller.priorityClassNamestring""Priority class for controller pods.
controller.podSecurityContextobject{"fsGroup":185}Security context for controller pods.
controller.topologySpreadConstraintslist[]Topology spread constraints rely on node labels to identify the topology domain(s) that each Node is in. Ref: Pod Topology Spread Constraints. The labelSelector field in topology spread constraint will be set to the selector labels for controller pods if not specified.
controller.envlist[]Environment variables for controller containers.
controller.envFromlist[]Environment variable sources for controller containers.
controller.volumeMountslist[{"mountPath":"/tmp","name":"tmp","readOnly":false}]Volume mounts for controller containers.
controller.resourcesobject{}Pod resource requests and limits for controller containers. Note, that each job submission will spawn a JVM within the controller pods using "/usr/local/openjdk-11/bin/java -Xmx128m". Kubernetes may kill these Java processes at will to enforce resource limits. When that happens, you will see the following error: 'failed to run spark-submit for SparkApplication [...]: signal: killed' - when this happens, you may want to increase memory limits.
controller.securityContextobject{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"privileged":false,"readOnlyRootFilesystem":true,"runAsNonRoot":true,"seccompProfile":{"type":"RuntimeDefault"}}Security context for controller containers.
controller.sidecarslist[]Sidecar containers for controller pods.
controller.podDisruptionBudget.enableboolfalseSpecifies whether to create pod disruption budget for controller. Ref: Specifying a Disruption Budget for your Application
controller.podDisruptionBudget.minAvailableint1The number of pods that must be available. Require controller.replicas to be greater than 1
controller.pprof.enableboolfalseSpecifies whether to enable pprof.
controller.pprof.portint6060Specifies pprof port.
controller.pprof.portNamestring"pprof"Specifies pprof service port name.
controller.workqueueRateLimiter.bucketQPSint50Specifies the average rate of items process by the workqueue rate limiter.
controller.workqueueRateLimiter.bucketSizeint500Specifies the maximum number of items that can be in the workqueue at any given time.
controller.workqueueRateLimiter.maxDelay.enablebooltrueSpecifies whether to enable max delay for the workqueue rate limiter. This is useful to avoid losing events when the workqueue is full.
controller.workqueueRateLimiter.maxDelay.durationstring"6h"Specifies the maximum delay duration for the workqueue rate limiter.
webhook.enablebooltrueSpecifies whether to enable webhook.
webhook.replicasint1Number of replicas of webhook server.
webhook.leaderElection.enablebooltrueSpecifies whether to enable leader election for webhook.
webhook.logLevelstring"info"Configure the verbosity of logging, can be one of debug, info, error.
webhook.portint9443Specifies webhook port.
webhook.portNamestring"webhook"Specifies webhook service port name.
webhook.failurePolicystring"Fail"Specifies how unrecognized errors are handled. Available options are Ignore or Fail.
webhook.timeoutSecondsint10Specifies the timeout seconds of the webhook, the value must be between 1 and 30.
webhook.resourceQuotaEnforcement.enableboolfalseSpecifies whether to enable the ResourceQuota enforcement for SparkApplication resources.
webhook.serviceAccount.createbooltrueSpecifies whether to create a service account for the webhook.
webhook.serviceAccount.namestring""Optional name for the webhook service account.
webhook.serviceAccount.annotationsobject{}Extra annotations for the webhook service account.
webhook.serviceAccount.automountServiceAccountTokenbooltrueAuto-mount service account token to the webhook pods.
webhook.rbac.createbooltrueSpecifies whether to create RBAC resources for the webhook.
webhook.rbac.annotationsobject{}Extra annotations for the webhook RBAC resources.
webhook.labelsobject{}Extra labels for webhook pods.
webhook.annotationsobject{}Extra annotations for webhook pods.
webhook.sidecarslist[]Sidecar containers for webhook pods.
webhook.volumeslist[{"emptyDir":{"sizeLimit":"500Mi"},"name":"serving-certs"}]Volumes for webhook pods.
webhook.nodeSelectorobject{}Node selector for webhook pods.
webhook.affinityobject{}Affinity for webhook pods.
webhook.tolerationslist[]List of node taints to tolerate for webhook pods.
webhook.priorityClassNamestring""Priority class for webhook pods.
webhook.podSecurityContextobject{"fsGroup":185}Security context for webhook pods.
webhook.topologySpreadConstraintslist[]Topology spread constraints rely on node labels to identify the topology domain(s) that each Node is in. Ref: Pod Topology Spread Constraints. The labelSelector field in topology spread constraint will be set to the selector labels for webhook pods if not specified.
webhook.envlist[]Environment variables for webhook containers.
webhook.envFromlist[]Environment variable sources for webhook containers.
webhook.volumeMountslist[{"mountPath":"/etc/k8s-webhook-server/serving-certs","name":"serving-certs","readOnly":false,"subPath":"serving-certs"}]Volume mounts for webhook containers.
webhook.resourcesobject{}Pod resource requests and limits for webhook pods.
webhook.securityContextobject{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"privileged":false,"readOnlyRootFilesystem":true,"runAsNonRoot":true,"seccompProfile":{"type":"RuntimeDefault"}}Security context for webhook containers.
webhook.podDisruptionBudget.enableboolfalseSpecifies whether to create pod disruption budget for webhook. Ref: Specifying a Disruption Budget for your Application
webhook.podDisruptionBudget.minAvailableint1The number of pods that must be available. Require webhook.replicas to be greater than 1
spark.jobNamespaceslist["default"]List of namespaces where to run spark jobs. If empty string is included, all namespaces will be allowed. Make sure the namespaces have alre

Deploy spark-operator with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has spark-operator on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartspark-operator is pinned at v2.2.9 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply