# Install Spark History Server provider

To install the Spark History Server provider, create a YAML file (called `provider.yml` in this example) with the definition of the provider:

```yaml
# Spark History Server Telemetry Provider
name: SparkHistoryServer
description: Telemetry Provider that enables to import of metrics from Spark History Server instances
dockerImage: 485790562880.dkr.ecr.us-east-2.amazonaws.com/akamas/telemetry-providers/spark-history-server-provider:3.2.0
```

Then you can install the provider using the Akamas CLI:

```bash
akamas install telemetry-provider provider.yml
```

The installed provider is shared with all users of your Akamas installation and can monitor many different systems, by configuring appropriate telemetry provider instances.

## Offline Installation

An offline installation is designed for air-gapped or isolated environments where the Kubernetes cluster cannot directly access public repositories to download Docker images. In such scenarios, all necessary images—including telemetry providers—must be pre-downloaded, re-tagged, and pushed to a private registry that the cluster can access.

> **Note:** The following steps **must be executed from a terminal that has internet access and connectivity to your private registry**. This is required to pull the image from the public repository and then push it to your private registry. Once the images are available in your private registry, your offline environment can use them.

**Spark History Server Telemetry Provider Offline Procedure**

1. **Download and Transfer the Image to Your Private Registry:**

   Use Docker to pull the image from the public repository, re-tag it, and push it to your private registry. For example, if your private registry is `myprivateregistry.com`, execute:

   ```yaml
   # Pull the image from the public repository
   docker pull 485790562880.dkr.ecr.us-east-2.amazonaws.com/akamas/telemetry-providers/spark-history-server-provider:3.2.0

   # Re-tag the image for your private registry
   docker tag 485790562880.dkr.ecr.us-east-2.amazonaws.com/akamas/telemetry-providers/spark-history-server-provider:3.2.0 myprivateregistry.com/akamas/telemetry-providers/spark-history-server-provider:3.2.0

   # Push the image to your private registry
   docker push myprivateregistry.com/akamas/telemetry-providers/spark-history-server-provider:3.2.0
   ```
2. **Create the Updated YAML File:**

   Create a YAML file (e.g., `provider.yml`) with the provider specification, updating the `dockerImage` reference to point to your private registry:

   ```yaml
   # Spark History Server Telemetry Provider
   name: SparkHistoryServer
   description: Telemetry Provider that enables to import of metrics from Spark History Server instances
   dockerImage: myprivateregistry.com/akamas/telemetry-providers/spark-history-server-provider:3.2.0
   ```
3. **Install the Provider Using the Akamas CLI:**

   With the updated YAML file, run the following command to install the provider:

   ```bash
   akamas install telemetry-provider provider.yml
   ```

   This command instructs the Akamas CLI to retrieve the image from your private registry, ensuring that the installation succeeds even in an offline environment.
