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

# Overview

> Learn how to deploy additional microservices for specialized Prisme.ai applications such as Custom Code, Crawler, and AI Knowledge

Prisme.ai's architecture includes specialized microservices that support specific applications like Custom Code, Crawler, Search Engine ... This guide explains how to deploy these additional microservices in your self-hosted environment.

<Note>
  **License Requirement**

  The microservices discussed in this guide are available based on your subscription license. Ensure your license includes access to these components before proceeding with deployment.
</Note>

## Access Requirements

<Warning>
  You will need valid GitLab credentials to access the Docker images for these microservices. If you don't have them yet, please contact [support@prisme.ai](mailto:support@prisme.ai) to obtain a GitLab username and token.
</Warning>

These credentials are typically provided as a GitLab Deploy Token with appropriate permissions to pull the required images.

## Deployment Strategy

We will deploy the apps microservices in the same Kubernetes cluster as the core microservices. However, for better resource isolation and management, we recommend using a separate namespace for these additional services.

## Prerequisites

Each microservice has specific requirements that must be fulfilled before deployment. Review the prerequisites for each service you plan to deploy:

<CardGroup cols={2}>
  <Card title="prismeai-crawler" icon="spider" href="../configuration/prismeai-crawler/index.md#installation-prerequisites">
    Web crawling and indexing service
  </Card>

  <Card title="prismeai-functions" icon="code">
    Custom code execution environment
  </Card>

  <Card title="prismeai-searchengine" icon="magnifying-glass">
    Search functionality for crawled content
  </Card>
</CardGroup>

## Deployment Process

Follow these steps to deploy the apps microservices in your Kubernetes cluster:

<Steps>
  <Step title="Retrieve the Helm Charts">
    You have two options for accessing the required Helm charts:

    **Option 1: Download the charts directly**

    ```
    helm repo add prismeai https://helm.prisme.ai/charts
    helm pull prismeai/prismeai-apps
    ls
    ```

    Extract the archive to access the chart files.

    **Option 2: Add as a Helm repository**

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

    Then generate a values file template:

    ```bash theme={null}
    helm show values prismeai/prismeai-apps > ./values.yml
    ```
  </Step>

  <Step title="Configure Values File">
    Edit the `values.yaml` file to include connection details and credentials for external services:

    Key configuration areas include:

    * **Container registry credentials**: Your GitLab access details
    * **Service-specific settings**: Configuration for each microservice
    * **Database configurations**: Connection details for required databases
    * **Resource allocations**: CPU, memory, and storage requirements
    * **Network settings**: Service endpoints and ports

    Refer to each service's documentation for specific configuration requirements.
  </Step>

  <Step title="Create Namespace">
    Create a dedicated namespace for the apps microservices:

    ```bash theme={null}
    kubectl create namespace apps
    ```

    This separation provides better resource isolation and management compared to deploying everything in the default namespace.
  </Step>

  <Step title="Deploy using Helm">
    Choose the appropriate deployment command based on how you retrieved the charts:

    **If you downloaded the charts (Option 1):**

    ```bash theme={null}
    # From the root of the extracted directory
    helm install apps . --namespace apps -f values.yaml
    ```

    **If you added the repo (Option 2):**

    ```bash theme={null}
    helm install apps prismeai/prismeai-apps --namespace apps -f values.yaml
    ```

    The deployment will create all necessary Kubernetes resources in the `apps` namespace.
  </Step>

  <Step title="Verify Deployment">
    Check that all pods are running correctly:

    ```bash theme={null}
    kubectl get pods -n apps
    ```

    Ensure all services show `Running` status and are ready (e.g., `1/1` for readiness).

    You can get more detailed information about any pod with:

    ```bash theme={null}
    kubectl describe pod [pod-name] -n apps
    ```
  </Step>
</Steps>

## Testing the Microservices

After deployment, test each microservice to ensure it's functioning correctly:

<Accordion title="prismeai-crawler and prismeai-searchengine">
  Follow the testing procedures in the [prismeai-crawler documentation](../configuration/prismeai-crawler/index.md#microservice-testing).

  Typical tests include:

  * Creating a crawl job for a test website
  * Verifying content is properly indexed
  * Testing search functionality with simple queries
  * Checking crawler logs for any errors
</Accordion>

<Accordion title="prismeai-functions">
  Refer to the [prismeai-functions testing guide](../configuration/prismeai-functions/index.md#microservice-testing).

  Key validation steps:

  * Executing a simple function through the API
  * Verifying resource limits are properly enforced
  * Testing error handling for invalid code
  * Checking integration with other Prisme.ai components
</Accordion>

<Accordion title="prismeai-llm">
  Use the [prismeai-llm testing procedures](../configuration/prismeai-llm/index.md#microservice-testing) to verify functionality.

  Important tests include:

  * Testing model inference with a simple prompt
  * Verifying token counting functionality
  * Checking integration with supported models
  * Validating logging and monitoring features
</Accordion>

## Troubleshooting Common Issues

<Accordion title="Image Pull Errors">
  **Symptom**: Pods show `ImagePullBackOff` status

  **Possible causes**:

  * Invalid GitLab credentials
  * Incorrect image repository URL
  * Network connectivity issues

  **Resolution steps**:

  1. Verify your GitLab credentials are correct
  2. Check the image repository URL in your values file
  3. Create a Kubernetes secret with your credentials:
     ```bash theme={null}
     kubectl create secret docker-registry gitlab-registry \
       --docker-server=registry.gitlab.com \
       --docker-username=YOUR_USERNAME \
       --docker-password=YOUR_TOKEN \
       --namespace apps
     ```
  4. Update your deployment to use this secret
</Accordion>

<Accordion title="Configuration Errors">
  **Symptom**: Pods start but quickly crash or enter CrashLoopBackOff

  **Possible causes**:

  * Missing or incorrect environment variables
  * Invalid database connection details
  * Insufficient permissions or resources

  **Resolution steps**:

  1. Check pod logs for specific error messages:
     ```bash theme={null}
     kubectl logs [pod-name] -n apps
     ```
  2. Verify database connectivity from within the cluster
  3. Ensure all required environment variables are set
  4. Check resource allocations match the service requirements
</Accordion>

<Accordion title="Service Connectivity Issues">
  **Symptom**: Services start but can't communicate with each other

  **Possible causes**:

  * Incorrect service names or ports
  * Network policies blocking traffic
  * DNS resolution problems

  **Resolution steps**:

  1. Verify service endpoints using:
     ```bash theme={null}
     kubectl get services -n apps
     ```
  2. Test connectivity using a debug pod:
     ```bash theme={null}
     kubectl run debug-pod --rm -it --image=nginx:alpine -- sh
     # Inside the pod
     wget -O- http://service-name.apps.svc.cluster.local:port/health
     ```
  3. Check network policies that might be restricting traffic
  4. Ensure CoreDNS is functioning properly
</Accordion>

## Upgrading Microservices

When new versions of the apps microservices become available:

<Steps>
  <Step title="Update Helm Repository">
    If using the Helm repository approach:

    ```bash theme={null}
    helm repo update
    ```
  </Step>

  <Step title="Check for Changes">
    Review the changes in the new version:

    ```bash theme={null}
    helm show values prismeai/prismeai-apps > ./new-values.yml
    diff values.yaml new-values.yml
    ```

    Update your values file as needed to accommodate any new configuration options.
  </Step>

  <Step title="Perform the Upgrade">
    Upgrade the deployment with:

    ```bash theme={null}
    helm upgrade apps prismeai/prismeai-apps --namespace apps -f values.yaml
    ```

    Or if using the downloaded chart:

    ```bash theme={null}
    helm upgrade apps . --namespace apps -f values.yaml
    ```
  </Step>

  <Step title="Verify Upgrade">
    Check that all pods are running the new version:

    ```bash theme={null}
    kubectl get pods -n apps
    ```

    And verify functionality using the testing procedures mentioned above.
  </Step>
</Steps>

## Next Steps

After successfully deploying the apps microservices:

<CardGroup cols={2}>
  <Card title="Custom Code App" icon="brain" href="/self-hosting/entreprise/functions">
    Set up the use custom code capabilities
  </Card>

  <Card title="Set Up Web Crawling" icon="spider-web" href="/self-hosting/entreprise/crawler-searchengine">
    Configure crawling & search services
  </Card>

  <Card title="Configure LLM Access" icon="microchip-ai" href="/self-hosting/entreprise/local-llm">
    Set up access to various local language models
  </Card>
</CardGroup>

For any issues or questions during the deployment process, contact [support@prisme.ai](mailto:support@prisme.ai) for assistance.
