unifai

by startxfr

Helm chartv21.3.414App 0.1.77GPL-3.0-or-laterVerified publisher

Deploy the UnifAI multi-agent AI platform on OpenShift or Kubernetes, by installing the UnifAI operator and a UnifaiStack resource

About this chart

UnifAI Helm chart

Deploy UnifAI, a multi-agent AI platform with a built-in RAG pipeline, on OpenShift or Kubernetes, with Helm or ArgoCD.

This chart installs two things :

  • the UnifAI operator (cluster-wide), with its custom resource definitions ;
  • one UnifaiStack resource, from which the operator deploys the whole platform in the release namespace : web interface, backend, multi-agent engine, RAG services, identity service, and their datastores (MongoDB, Qdrant, RabbitMQ, Redis, Temporal).

It deploys UnifAI release v0.1.77 ; every UnifAI image is pinned by digest.

Requirements

OpenShift (validated)Kubernetes (experimental)
VersionKubernetes 1.30 or later (OpenShift 4.17 or later)Kubernetes 1.30 or later
Architecturelinux/amd64 nodeslinux/amd64 nodes
Storagea ReadWriteOnce class and a ReadWriteMany classa ReadWriteOnce class and a ReadWriteMany class
Identitya Keycloak deployed by the operator, or your ownyour own Keycloak realm (see Identity)
PublicationRoutes, created by the operatorIngresses, created by this chart, and a TLS Secret
Rightscluster administrator (the operator is cluster-wide)cluster administrator

UnifAI has no mode without single sign-on : a Keycloak realm is always required.

Install the operator once per cluster. To deploy UnifAI in several namespaces, install this chart again with operator.enabled=false.

Quick start on OpenShift

helm repo add unifai https://helm-repository.readthedocs.io/en/latest/repos/stable/
helm repo update

helm install unifai unifai/unifai \
  --namespace unifai --create-namespace \
  --set stack.spec.storage.className=<ReadWriteOnce class> \
  --set stack.spec.storage.sharedClassName=<ReadWriteMany class>

Leave the two storage settings out to use the default class of the cluster ; it must then support ReadWriteMany.

The operator deploys the platform in the background. Follow it until the phase is Ready :

oc -n unifai get unifaistack unifai -w

Then get the address of the web interface and the password of the admin user :

oc -n unifai get unifaistack unifai -o jsonpath='{.status.endpoints.ui}{"\n"}'
oc -n unifai get secret unifai-generated -o jsonpath='{.data.keycloak-admin-password}' | base64 -d

With these defaults the operator also deploys Keycloak (Red Hat build of Keycloak, installed through the OpenShift operator catalog) and creates the unifai realm and the admin user.

Quick start on Kubernetes (experimental)

The operator is developed and released for OpenShift. On plain Kubernetes it has only been run on throwaway kind clusters by its own test suite, without anything reaching it from outside. This path works around what Kubernetes lacks ; treat it as a starting point and test it on your cluster.

  1. Have a Keycloak realm ready, with a confidential client whose redirect URIs allow https://unifai-ui-<namespace>.<domain>/* and https://unifai-identity-<namespace>.<domain>/*.

  2. Create the namespace, the client secret and a TLS Secret valid for both hosts :

    kubectl create namespace unifai
    kubectl -n unifai create secret generic unifai-oidc --from-literal=client-secret=<client secret>
    kubectl -n unifai create secret tls unifai-tls --cert=<certificate> --key=<private key>
    
  3. Copy values-kubernetes.yaml, set your domain, Keycloak address, storage classes and Ingress class, then install :

    helm repo add unifai https://helm-repository.readthedocs.io/en/latest/repos/stable/
    helm install unifai unifai/unifai --namespace unifai -f values-kubernetes.yaml
    

What that values file does, and why :

SettingReason
exposure.type: ingressthe operator only creates OpenShift Routes ; the chart creates Ingresses instead
exposure.ingress.installRouteCRD: truethe operator fails if the Route API does not exist ; a schema-less definition satisfies it
exposure.domainthe operator cannot discover a domain outside OpenShift
exposure.ingress.tlsSecretNameUnifAI only generates https:// addresses
stack.spec.identity.externalthe managed Keycloak needs the OpenShift operator catalog
stack.spec.exposure.networkPolicy: falsethe default network policies only admit the OpenShift router
uiAnnotations (backend protocol HTTPS)the web interface serves HTTPS on its internal port

Known limits on Kubernetes : scheduled backups do not run (their jobs rely on the user identifier OpenShift assigns), and the example Ingress annotations are for ingress-nginx.

Values files

Example values files shipped with the chart, to use with helm install -f <file> :

  • kubernetes : Example values for a plain Kubernetes cluster (experimental, see README) (see values-kubernetes.yaml)
  • openshift : Example values for OpenShift : Routes, a Keycloak managed by the operator, explicit storage classes (see values-openshift.yaml)
  • examples/argocd/ : 4 example manifest(s) (see the ArgoCD or usage sections)
helm install unifai startx/unifai -f https://raw.githubusercontent.com/startxfr/helm-repository/master/charts/unifai/values-kubernetes.yaml

Deploy with ArgoCD

Use two Applications, so that the operator is in place before the stack and removed after it. The manifests are in examples/argocd :

kubectl apply -k https://github.com/startxfr/helm-repository/charts/unifai/examples/argocd
# Operator : cluster-wide, installed once
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: unifai-operator
  namespace: openshift-gitops
  annotations:
    argocd.argoproj.io/sync-wave: "5"
  finalizers:
    - resources-finalizer.argocd.argoproj.io
spec:
  project: unifai
  destination:
    server: https://kubernetes.default.svc
    namespace: unifai-operator
  source:
    repoURL: https://sx-helm-repository-prod.s3.eu-west-3.amazonaws.com/stable
    chart: unifai
    targetRevision: 21.3.414
    helm:
      values: |
        stack:
          enabled: false
  syncPolicy:
    automated:
      prune: true
      selfHeal: true
    syncOptions:
      - CreateNamespace=true
      - ServerSideApply=true
---
# Platform : one per namespace
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: unifai-stack
  namespace: openshift-gitops
  annotations:
    argocd.argoproj.io/sync-wave: "10"
  finalizers:
    - resources-finalizer.argocd.argoproj.io
spec:
  project: unifai
  destination:
    server: https://kubernetes.default.svc
    namespace: unifai
  source:
    repoURL: https://sx-helm-repository-prod.s3.eu-west-3.amazonaws.com/stable
    chart: unifai
    targetRevision: 21.3.414
    helm:
      # The definitions belong to the operator Application
      skipCrds: true
      values: |
        operator:
          enabled: false
        stack:
          spec:
            storage:
              className: gp3-csi
              sharedClassName: nfs
  syncPolicy:
    automated:
      prune: true
      selfHeal: true
    syncOptions:
      - CreateNamespace=true

Delete unifai-stack first and wait for it to disappear before deleting unifai-operator : the operator is what removes the platform.

Do not name an Application after a UnifAI component (unifai-ui, unifai-rag, unifai-mongodb...) : the operator uses those names for its own releases in the namespace.

With exposure.type=ingress, set exposure.ingress.createUiServingCert=false and provide the unifai-ui-tls Secret yourself (for example with cert-manager) : ArgoCD cannot keep a generated certificate stable.

Configuration

Chart settings

KeyDefaultDescription
operator.enabledtrueinstall the operator ; false when it already runs on the cluster
operator.imagepinned digestoperator image
operator.imagePullPolicyIfNotPresentpull policy of the operator
operator.imagePullSecrets[]pull secrets of the operator
operator.resources50m / 192Mi, limit 1Giresources of the operator
operator.nodeSelector, tolerationsemptyscheduling of the operator
operator.userRolestruecreate the unifai-view, unifai-edit and unifai-admin ClusterRoles
operator.metrics.serviceMonitorfalsecreate a ServiceMonitor (requires the prometheus-operator definitions)
stack.enabledtruecreate the UnifaiStack
stack.specsee belowcontent of the UnifaiStack, passed as is to the operator
exposure.typerouteroute, ingress or none
exposure.domainemptydomain of the published hosts ; required with ingress
exposure.ingress.classNameemptyIngress class
exposure.ingress.annotations{}annotations of both Ingresses
exposure.ingress.uiAnnotations{}annotations of the web interface Ingress
exposure.ingress.tlsSecretNameemptyTLS Secret of the Ingresses ; required with ingress
exposure.ingress.installRouteCRDfalseinstall a schema-less Route definition ; never on OpenShift
exposure.ingress.createUiServingCerttruegenerate the internal certificate of the web interface (unifai-ui-tls)
project.enabledfalsecreate the namespace with the optional project sub-chart

The context block only sets descriptive labels on the objects this chart creates.

Platform settings (stack.spec)

stack.spec is the specification of the UnifaiStack resource. The full reference is on the cluster :

kubectl explain unifaistack.spec --recursive

The settings most installs need :

KeyDefaultDescription
profiledevdev (small requests, no autoscaling) or prod
version, imagesv0.1.77, digestsUnifAI images ; change them together when upgrading
identity.adminUsers[admin]Keycloak users granted the administrator role
identity.keycloak{}Keycloak deployed by the operator (OpenShift only)
identity.externalnot setyour own Keycloak ; replaces identity.keycloak
storage.classNamecluster defaultclass of the database volumes
storage.sharedClassNamecluster defaultclass of the shared volumes ; must support ReadWriteMany
storage.sizes

Deploy unifai with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has unifai on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartunifai is pinned at v21.3.414 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply