> 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

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**, **Keycloak**, **Keymanager** and the **Istio** gateway.
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 repository <https://openg2p.github.io/openg2p-helm/rancher> is added.
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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
