> For the complete documentation index, see [llms.txt](https://docs.openg2p.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.openg2p.org/products/spar/deployment.md).

# Deployment

Deploying OpenG2P SPAR on Kubernetes using Helm charts.

SPAR is deployed over Kubernetes infrastructure that offers **production-grade** deployment along with powerful security, access control and operational features. Learn more about the deployment architecture [here](/operations/deployment/openg2p-deployment-model.md).

Deployment is **largely automated**. Once the cluster and environment are in place, the entire SPAR subsystem — the Mapper Partner API, the Beneficiary Portal API, the PostgreSQL database/role and the Keycloak client — installs from a **single Helm chart** (`spar`) via the Rancher UI. No manual database, Keycloak or post-install configuration is required.

## Deployment steps

1. [Infrastructure setup](/operations/deployment/infrastructure-setup.md)
2. [Environment creation](/operations/deployment/infrastructure-setup/environment-setup-multi-node.md)
3. [SPAR installation](#spar-installation)

## SPAR installation

After steps 1 and 2, Rancher is up and running, so it is recommended to deploy SPAR from the **Rancher UI**.

### Prerequisites

1. Infrastructure and environment are created as given above. The **commons** environment provides the shared services SPAR depends on — **PostgreSQL** and the **Istio** gateway. SPAR verifies partner signatures **in-process**, so it needs **no runtime key service**.
2. You have full admin rights to the cluster and the Rancher UI.

### Installation

1. Login to the Rancher console.
2. Select the cluster and namespace (environment).
3. Under **Apps → Repositories**, make sure the **OpenG2P charts** repository is added: `https://openg2p.github.io/openg2p-helm`.
4. Under **Apps → Charts**, refresh all repositories.
5. To show moving (pre-release) versions, click your user avatar (top-right) → **Preferences** → enable **Include Prerelease Versions**.
6. Select the **"OpenG2P SPAR"** chart.
7. Select the version (*3-digit versions denote frozen releases; versions with a `-develop` tag are moving versions*).
8. On Install Step 1:
   1. select the namespace;
   2. give the installation a name — `spar` recommended (the database and role are derived from this name);
   3. select **Customize Helm options before install**;
   4. Next.
9. On the **Helm Options** page, disable the `wait` flag, then **Install**.
10. Wait for all pods to come up successfully (`Running` / `Completed`).

### Post install check

With the default hostnames shown (namespace `trial`):

1. Open `https://spar.<namespace>.openg2p.org/api/mapper/docs` — the SPAR Mapper Partner API Swagger UI should load.
2. Open `https://beneficiary.<namespace>.openg2p.org/api/bene-portal/docs` — the Beneficiary Portal API Swagger UI should load.

{% hint style="info" %}
The bare API base path (e.g. `/api/mapper/`) returns a 404 by design — there is no route there. Use `/docs`, or a specific endpoint.
{% endhint %}

## Reference

* [Helm Chart](/products/spar/deployment/helm-charts.md) — what the chart contains, all parameters, and the command-line install option (for advanced / developer use).
* [Keycloak Client](/products/spar/deployment/keycloak-client.md) — why the OIDC client is required and how it is created.
* [Domain Names and Certificates](/products/spar/deployment/domain-names-and-certificates.md)
* [Teardown / Uninstall](/products/spar/deployment/teardown.md) — completely remove a release.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.openg2p.org/products/spar/deployment.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
