> ## Documentation Index
> Fetch the complete documentation index at: https://prismeai-docs-next.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploying Prisme.ai with Helm on Kubernetes

> Complete guide for deploying Prisme.ai on Kubernetes using Helm charts.

Helm simplifies managing Kubernetes applications, offering powerful templating and lifecycle management. This guide details how to deploy and manage Prisme.ai using Helm charts effectively.

***

## Prerequisites

Before deploying Prisme.ai with Helm, ensure:

* Kubernetes cluster (version 1.26+) ready.
* Helm (version 3+) installed and configured.
* Basic familiarity with Kubernetes commands (`kubectl`).

***

## Step-by-Step Helm Deployment

<Steps>
  <Step title="Add Helm Repository">
    Add the official Prisme.ai Helm repository:

    ```bash theme={null}
    helm repo add prismeai https://helm.prisme.ai/charts
    helm repo update
    ```
  </Step>

  <Step title="Prepare the Configuration (`values.yaml`)">
    Download and customize the Helm chart configuration:

    ```bash theme={null}
    helm show values prismeai/prismeai-core > values.yaml
    ```

    Customize `values.yaml` with your specific settings:

    * Database connections (MongoDB, Redis, Elasticsearch)
    * Object storage configurations (S3-compatible storage, Azure Blob, GCS)
    * Ingress settings, SSL certificates
  </Step>

  <Step title="Create Kubernetes Namespace">
    Create a dedicated namespace for Prisme.ai:

    ```bash theme={null}
    kubectl create namespace prisme-ai
    ```
  </Step>

  <Step title="Install Prisme.ai via Helm">
    Deploy Prisme.ai using Helm into your cluster:

    ```bash theme={null}
    helm install prisme-core prismeai/prismeai-core \
      --namespace prisme-ai -f values.yaml
    ```
  </Step>

  <Step title="Verify the Deployment">
    Check pod status and ensure all components are running correctly:

    ```bash theme={null}
    kubectl get pods -n prisme-ai
    kubectl logs deployment/api-gateway -n prisme-ai
    ```
  </Step>
</Steps>

***

## Configuration

### PostgreSQL

Compared to the MongoDB values, there are only 3 places to update for PostgreSQL, all of which are indicated by a comment including "postgresql":

#### Database permissions

**Key:** `global.storage.permissions`

The `driver` must be set to `postgresql`, and the authentication URL including username and password must be provided in `url` (not recommended for production) or ideally in a `url` key (configurable via `secretKeys.url`) of the `existingSecret`.

Example URL: `postgres://user:password@your-cluster.company.net:20184/permissions?sslmode=require`

<Note>
  The `sslmode=require` option is required to enforce SSL connection.
</Note>

#### Database users

**Key:** `prismeai-api-gateway.storage.users`

Same configuration structure as `global.storage.permissions` - set the `driver` to `postgresql` and configure the connection URL.

#### Database collections

**Key:** `prismeai-runtime.storage.collections`

Same configuration structure as above - set the `driver` to `postgresql` and configure the connection URL.

***

## Helm Best Practices

<CardGroup cols={2}>
  <Card title="Version Control" icon="code-branch">
    * Version your `values.yaml` using Git for better tracking.
    * Regularly upgrade Helm releases to latest stable charts.
  </Card>

  <Card title="Secrets Management" icon="key">
    * Store sensitive configurations securely using Kubernetes Secrets or external secret management solutions (e.g., HashiCorp Vault, AWS Secrets Manager).
  </Card>

  <Card title="Resource Optimization" icon="cogs">
    * Define clear resource requests and limits in your Helm chart configuration.
    * Regularly review and optimize these values according to observed resource usage.
  </Card>

  <Card title="Monitoring & Alerts" icon="chart-line">
    * Integrate Helm deployments with Prometheus & Grafana Operator.
    * Configure alerts for critical components of Prisme.ai.
  </Card>
</CardGroup>

### Security Context configuration

The platform supports [Security Contexts](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/)
out of the box for every pod.

For each pod except `prismeai-functions` which runs its own isolation layer, you may uncomment or customize the following helm values snippet :

```yaml theme={null}
  securityContext:
    runAsUser: 1000
  containerSecurityContext:
    allowPrivilegeEscalation: false
    privileged: false
    capabilities:
      drop:
        - ALL
```

* The `securityContext` from these values applies to the Deployment `spec.spec.securityContext`
* The `containerSecurityContext` from these values applies to the Deployment `spec.spec.containers.securityContext`
* Each section follows the same reference documentation for [Security Contexts](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/)
* Finally you may apply `securityContext` and `containerSecurityContext` to `prismeai-functions`, while being informed that this pod runs a root service which forks isolated execution environments, each with their own unix user.

***

## Common Helm Commands

<AccordionGroup>
  <Accordion title="Useful Helm Commands">
    * **Update repository**:
      ```bash theme={null}
      helm repo update
      ```
    * **List releases**:
      ```bash theme={null}
      helm list -n prisme-ai
      ```
    * **Upgrade release**:
      ```bash theme={null}
      helm upgrade prisme-core prismeai/prismeai-core -n prisme-ai -f values.yaml
      ```
    * **Rollback**:
      ```bash theme={null}
      helm rollback prisme-core [revision] -n prisme-ai
      ```
    * **Delete release**:
      ```bash theme={null}
      helm uninstall prisme-core -n prisme-ai
      ```
  </Accordion>

  <Accordion title="Troubleshooting Helm Releases">
    * **Check release history**:
      ```bash theme={null}
      helm history prisme-core -n prisme-ai
      ```
    * **Debug issues**:
      ```bash theme={null}
      kubectl describe pod <pod-name> -n prisme-ai
      kubectl logs <pod-name> -n prisme-ai
      ```
  </Accordion>
</AccordionGroup>

***

## Next Steps

<CardGroup cols={2}>
  <Card title="High Availability Setup" icon="cloud" href="/self-hosting/kubernetes/high-availability">
    Configure high availability on Kubernetes
  </Card>

  <Card title="Prometheus & Grafana" icon="chart-column" href="/self-hosting/kubernetes/prometheus-grafana-operator">
    Set up monitoring with Prometheus & Grafana
  </Card>

  <Card title="Product Configuration" icon="store" href="/self-hosting/configuration/products-installation">
    Configure Prisme.ai AI products
  </Card>

  <Card title="Install from scratch (v27)" icon="rocket" href="/self-hosting/operations/install-v27">
    Fresh-install walkthrough.
  </Card>

  <Card title="Migration v27" icon="arrow-right-arrow-left" href="/self-hosting/operations/migration-v27">
    Migrate an existing instance to v27.
  </Card>

  <Card title="Operations & Maintenance" icon="tools" href="/self-hosting/operations/scaling">
    Manage operations efficiently
  </Card>
</CardGroup>
