How one Ilum console runs Spark on several clusters
A cluster in Ilum is where Spark runs: a Kubernetes namespace, a Hadoop cluster with YARN, or threads inside ilum-core. Every job names one, and its driver reports back to the same ilum-core.
One ilum-core.
Four places for Spark.
--master k8s://https://kubernetes.default.svc · k8s://<Url> · yarn · local[6]
Where does this job run?
One ilum-core and every place a cluster can send Spark to. Pick one for the road of a job there and back, the fields that decide where the driver runs, and the limits.
the Kubernetes cluster Ilum runs in
ilum-grpc.default.svc.cluster.local:9999gRPCilum-objectstorage.default.svc.cluster.local:9000S3ilum-hive-metastore.default.svc.cluster.local:9083Thriftilum-marquez.default.svc.cluster.local:9555HTTP
Dashed: a route through your network that the install does not create.
The road of one job
Pick where the job runs
What the form asksdecides where the driver runs
- Url
- https://kubernetes.default.svc (decides where the driver runs)
- Namespace
- default, the release namespace (decides where the driver runs)
- Service Account Name
- <release>-ilum-core-spark (decides where the driver runs)
- CaCert, ClientCert, ClientKey
- none, ilum-core uses its pod account
- Spark Storage
- s3a://ilum-files
- Metastore, Presets
- default (Hive), delta
- Url
- its API server, required (decides where the driver runs)
- Namespace
- where its Spark pods go (decides where the driver runs)
- Service Account Name
- who the driver is there (decides where the driver runs)
- CaCert, ClientCert, ClientKey
- files, how spark-submit signs in
- Username, Password
- only for the calls of ilum-core
- Resource Quota, Limit Ranges
- caps for the namespace
- Yarn fields
- none, the form has no section for Yarn
- Spark Storage
- an HDFS storage, required (decides where the driver runs)
- core-site.xml, hdfs-site.xml, yarn-site.xml
- uploaded on that storage, yarn-site.xml names the ResourceManager (decides where the driver runs)
- Hadoop Username
- hadoop when empty
- Kerberos Principal, Key Tab, KRB5
- for a kerberized cluster
- Threads
- 1 to 20, 6 unless you move the slider
- Spark Storage
- required here too
- Where
- no field, always the ilum-core container (decides where the driver runs)
Metrics tab, at one moment
CPU used0.36 of 8 cores
Memory requested7.9 of 29.3 GB
What it does not do
- A job stays on the cluster it was sent to. To run it somewhere else, send it again with another clusterName.
- Delete it and the Clusters page offers Restore Default Cluster, which builds it again from the Helm values.
- Its namespace and service account are yours to create. ilum-core makes missing ones on its own cluster, not here.
- Resource Quota and Limit Ranges are applied on Ilum's own cluster, not on this one.
- The live Spark UI does not reach a driver here. Read the run in the History Server once it ends.
- Spark Image, namespace, service account and quotas are Kubernetes settings. A Yarn cluster keeps none of them.
- Yarn is set up from its configuration files: core-site.xml, hdfs-site.xml and yarn-site.xml. In the console they belong to the HDFS storage, and the cluster form has no field for them.
- Metrics come from the ResourceManager's node reports and logs from the NodeManagers, not from Kubernetes.
- It shares the CPU and memory of the ilum-core container, which suits it to testing.
- The Metrics tab has no figures for it.
More: a Spark job inside its namespace, what a metastore holds, moving a YARN estate to Kubernetes.
Step by step
Step 1 of 8. your terminal → ilum-core
The chart creates the default cluster
When ilum-core starts and finds no cluster named default, it creates one: type Kubernetes, the API of the cluster it runs in, the namespace of the release, and the storage, metastore and preset of the chart. A request with clusterName=default sends its work there.
Nothing else about it is special. It can be edited, cloned and deleted like any cluster, and more clusters sit beside it in the same list.
curl "http://localhost:9888/api/v1/cluster"Spark pods after this step
none
- your terminal ilum-core · HTTP · GET /api/v1/cluster
- Created at start
- ilum-core.kubernetes.initClusterOnStartup is true, so ilum-core creates the cluster default when it starts and finds none.
- Where its values come from
- ilum-core.kubernetes.defaultCluster: Spark properties, environment variables, Scala version, presets, image, namespace and service account.
- The API
- ilum-core.kubernetes.api.url, https://kubernetes.default.svc: the API server of the cluster Ilum is installed in, seen from inside.
- The namespace
- Empty in the values, which means the namespace of the release.
- No certificates
- The default cluster carries none. ilum-core runs under the Spark service account of the chart, and spark-submit inside it signs in as that pod.
- The preset delta
- Attached by the chart. It sets the image ilum/spark:4.1.2-delta and the Delta Lake catalog, and because presets are merged after the image field, its image is the one jobs run on.
- Your edits stay
- ilum-core.kubernetes.upgradeClusterOnStartup is false. Set it to true and every start rewrites the cluster default from the Helm values.
Step 2 of 8. your terminal → ilum-core · ilum-core → Kubernetes API
ilum-core checks that it can reach the cluster
Saving a cluster, from the form or with a request, starts with a call to its Kubernetes API with the URL and credentials of the form: list the pods of its namespace. When that fails, nothing is saved. From then on ilum-core watches the pods of the cluster through the same API.
The form of the console and POST /api/v1/cluster end in the same save. A Kubernetes cluster is saved with its URL, its credentials and its namespace, a Yarn cluster with nothing of its own but an HDFS storage.
Spark pods after this step
none
- your terminal ilum-core · HTTP · POST /api/v1/cluster
- ilum-core Kubernetes API · list pods in the namespace
- The check
- ilum-core lists the pods of the namespace with the URL, the certificates or the user and password of the form. A failure answers "Unable to validate k8s cluster with given parameters".
- Yarn
- A Yarn cluster is checked by asking its ResourceManager for the list of applications.
- One namespace per cluster
- Two clusters may point at the same Kubernetes API with different namespaces. The same namespace on the same API is refused.
- A missing namespace
- Is created with a service account and a role binding, through the connection ilum-core has to its own cluster. On another cluster create them yourself.
- Quota and limit ranges
- The Resource Quota and the two Limit Ranges of the form become resource-quota-<clusterId> and limit-range-<clusterId> in the namespace, created through that same connection.
- Watching
- Once saved, the cluster gets a pod watcher in ilum-core. That is how a driver that dies before it reports is noticed.
Step 3 of 8. ilum-core → ilum-minio
The Spark storage gets what every job needs
Before the cluster is saved, ilum-core copies its own job jars, the Python entrypoints and the OpenLineage agent into the cluster's Spark bucket. A driver loads them from there, wherever it runs.
The Spark storage is one of the storages attached to the cluster, picked in the form. Every storage attached is configured in every job on the cluster, so a job can read and write all of them.
Spark pods after this step
none
- ilum-core ilum-minio · S3 · ilum/default/ilum-job.jar …
- Where
- <Spark bucket>/ilum/default/, on the cluster default s3a://ilum-files/ilum/default/ilum-job.jar and its neighbours.
- On every save
- The files are copied again whenever the cluster is saved, so an edit refreshes them too.
- Your files
- Jars and files sent with a job go to <Spark bucket>/ilum/<job, service or schedule id>, which ilum-core also sets as spark.kubernetes.file.upload.path.
- Every storage
- The Spark settings of each attached storage are added to every job, not only those of the Spark storage.
- Required
- Every cluster needs a Spark storage. For a Yarn cluster it has to be HDFS.
Step 4 of 8. your terminal → ilum-core
A job names its cluster
The request carries the name of the cluster in clusterName. A service and a schedule name theirs when they are created, and every job they start runs there.
A job stays where it was sent. The update requests of a service and of a schedule have no clusterName, so to run the same work on another cluster you create it there.
Spark pods after this step
none
- your terminal ilum-core · HTTP · POST /api/v1/job/submit
- In a request
- clusterName=default names it.
- A cluster that does not exist
- Is answered with 404.
- Fixed once created
- The schedule update request takes the cron, the class, the configuration and the memory settings, and no cluster.
- Deleting a cluster
- Is refused while a service on it is active or a schedule enabled.
Step 5 of 8. on the cluster
The cluster's settings become the job's
ilum-core builds the Spark configuration in layers: the memory defaults of the cluster, its image, namespace and service account, its presets, its own Spark properties, its storages and its metastore. The job's own settings are merged last and win.
The layers are maps merged in order, so a later layer wins a key it shares with an earlier one. Lists such as listeners and Java options are joined instead.
Spark pods after this step
none
- The order on Kubernetes
- Memory defaults, then image, namespace and service account, presets, the Default Application Config, labels, certificates, the upload path and the storages.
- Presets
- Merged before the Default Application Config, so the cluster's own property wins a conflict.
- Metastore
- Hive sets spark.sql.catalogImplementation to hive, spark.hadoop.hive.metastore.uris and the warehouse directory. Nessie sets an Iceberg catalog. Without one the catalog is in-memory. DuckLake catalogs are not offered.
- Then the job
- The job's presets and its own configuration come last, so a job can override anything its cluster sets.
- Editing a cluster
- Reaches the jobs launched after the edit. The console warns that running jobs and SQL sessions need a restart.
Step 6 of 8. ilum-core → Kubernetes API
spark-submit goes to the cluster's API
ilum-core runs spark-submit in cluster mode with the master the cluster defines, here the Kubernetes API it runs on. The API creates the driver pod in the cluster's namespace, under the cluster's service account.
The master is what makes the type: k8s:// and the URL for Kubernetes, yarn for Yarn, local and a number of threads for Local. Kubernetes and Yarn run the driver in cluster mode, away from ilum-core. Local runs it in client mode, inside.
Spark pods after this step
job-<jobId>-<hash>-driverPending
- ilum-core Kubernetes API · create the driver pod
- Kubernetes
- k8s://<Url>, deploy mode cluster.
- Certificates
- ilum-core writes the CA certificate, client certificate and key of the cluster to files and passes them as spark.kubernetes.authenticate.submission.caCertFile, clientCertFile and clientKeyFile.
- User and password
- Go to the client ilum-core uses itself: the check, logs, pod watching and metrics. spark-submit gets the certificates only.
- It does not wait
- spark-submit returns once the driver pod exists: spark.kubernetes.submission.waitAppCompletion is false.
- Labels
- Driver and executor pods carry ilum.jobId and ilum.clusterName. On Yarn the same values are application tags.
- spark-submit in a pod
- With ilum-core.externalSparkSubmit.enabled it runs in a pod of its own in the namespace of Ilum instead. A Local cluster always runs it inside ilum-core.
Step 7 of 8. driver → ilum-minio · driver → ilum-core
The driver reports back to ilum-core
The driver loads the job jar from the Spark storage and reports to ilum-core over gRPC on port 9999. The chart gives every driver the same address, a service name of this cluster, so a driver on another cluster needs a route back to it.
Every address a driver is given back to the platform is a service name of the cluster Ilum runs in: gRPC on port 9999, the object storage for event logs, the Hive Metastore and Marquez. On the cluster default they resolve by themselves. Anywhere else they need a route. How those services talk to each other is drawn on the Ilum architecture page.
Spark pods after this step
job-<jobId>-<hash>-driverRunning
- driver ilum-minio · S3 · s3a://ilum-files/ilum/default/
- driver ilum-core · gRPC · job state
- The address
- ilum-core.grpc.job.host, ilum-grpc.<release namespace>.svc.cluster.local. One value for the whole install, the same for the drivers of every cluster.
- How it travels
- Not as a Spark property. ilum-core passes it as the argument of its entrypoint, encoded with the rest of the job parameters.
- Event logs
- Go to the storage of the chart, not to the Spark storage of the cluster, so the History Server finds the runs of every cluster in one place.
- Kafka instead
- With ilum-core.communication.type kafka, drivers and ilum-core exchange events through Kafka topics instead of gRPC.
Step 8 of 8. ilum-core → Kubernetes API
The Metrics tab asks the cluster
The console asks ilum-core, and ilum-core asks the cluster's API: the capacity of its nodes, the requests of the pods in its namespace and their usage from the Kubernetes Metrics Server. Without the Metrics Server the tab shows no figures.
The tab shows two gauges, CPU and memory, each with Used, Requested and Available. The cluster list shows the same figures for every cluster at once.
Spark pods after this step
job-<jobId>-<hash>-driverRunning
- ilum-core Kubernetes API · nodes, pods, pod metrics
- Available
- The capacity of all nodes of the cluster.
- Requested and Used
- Count the pods of the cluster's namespace: their requests while Running or Pending, and their usage from metrics.k8s.io.
- Without the Metrics Server
- The tab says "Ensure the Kubernetes Metrics Server is installed."
- Yarn
- Its metrics come from the ResourceManager's node reports. No Metrics Server is involved.
- Local
- Reports no figures.
What a cluster carries to its jobs
Beyond where Spark runs, a cluster is a set of defaults. These fields of the form apply to every job, service and schedule on it.
- Scala Version
- Scala 2.13 for Spark 4, or 2.12 for Spark 3.5. Ilum picks the build of its own jars to match.
- Spark Image
- spark.kubernetes.container.image, a Kubernetes setting. Presets and the Default Application Config can override it.
- Metastore
- The catalog the jobs see. Without one it is in-memory.
- Default Application Config
- Spark properties attached to every job run on the cluster.
- Presets
- Named sets of Spark properties shared between clusters, services, schedules and jobs. The chart brings delta and iceberg.
- Storages and Spark Storage
- Picked from the storages defined in the console. The Spark storage holds the files of the jobs.
- Memory
- Default executors, cores and memory of driver and executors, and dynamic allocation.
- Environment Variables
- Set for the spark-submit process ilum-core starts for each job, and so for the driver of a Local cluster, which is that process. The chart uses it on the cluster default to keep spark-submit small with SPARK_SUBMIT_OPTS.
Getting the default cluster back
The cluster default is the one a fresh install runs everything on, the examples included. Deleting it is allowed, and so is building it again.
- Restore Default Cluster
- When the list of clusters is empty, the Clusters page offers this button. It creates default again from the Helm values.
- Only when it is missing
- The request behind the button is refused while a cluster named default exists.
- Or restart ilum-core
- A restart does the same when the cluster is missing.
- While it is being deleted
- New work for the cluster default is refused until its resources are cleared.
Running on another Kubernetes cluster
ilum-core needs to reach the API of the other cluster, and the drivers there need a way back. Both are set up by hand.
- Credentials
- A client key and certificate for a user of the remote cluster, signed by its API, with the CA certificate beside them. Binding that user to cluster-admin is the simplest, and in production it gets a role with only the permissions Ilum needs.
- The driver's account
- The driver creates its executors, so its service account needs the right to create pods in the namespace.
- The way back
- ilum-core, its gRPC service and the object storage become LoadBalancer services, and the remote cluster gets Services with the same names that point at them.
- The namespace
- The Spark pods run in a namespace named like the release namespace of Ilum, because the addresses the drivers get carry it.
- Catalog and lineage
- The Hive Metastore, Marquez and the History Server work across clusters once they are exposed. Prometheus and Loki stay with one cluster.
- Spark UI
- ilum-ui proxies the live Spark UI to the driver's service by its name in the cluster Ilum runs in. For a job on another cluster, read it in the History Server once it ends.
- Schedules
- The CronJob of a schedule lives with Ilum, whatever cluster the schedule runs on. At every tick it calls ilum-core, which starts the job on the cluster of the schedule.
Run it on your own cluster
The cluster default exists on every install after two commands. A second cluster takes the form on the Clusters page. The Community license is free.
Install Ilum CommunityClusters and storages ↗Add a remote cluster ↗Architecture ↗
helm repo add ilum https://charts.ilum.cloudhelm install ilum ilum/ilum