unifai
by startxfr
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
UnifaiStackresource, 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) | |
|---|---|---|
| Version | Kubernetes 1.30 or later (OpenShift 4.17 or later) | Kubernetes 1.30 or later |
| Architecture | linux/amd64 nodes | linux/amd64 nodes |
| Storage | a ReadWriteOnce class and a ReadWriteMany class | a ReadWriteOnce class and a ReadWriteMany class |
| Identity | a Keycloak deployed by the operator, or your own | your own Keycloak realm (see Identity) |
| Publication | Routes, created by the operator | Ingresses, created by this chart, and a TLS Secret |
| Rights | cluster 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.
-
Have a Keycloak realm ready, with a confidential client whose redirect URIs allow
https://unifai-ui-<namespace>.<domain>/*andhttps://unifai-identity-<namespace>.<domain>/*. -
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> -
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 :
| Setting | Reason |
|---|---|
exposure.type: ingress | the operator only creates OpenShift Routes ; the chart creates Ingresses instead |
exposure.ingress.installRouteCRD: true | the operator fails if the Route API does not exist ; a schema-less definition satisfies it |
exposure.domain | the operator cannot discover a domain outside OpenShift |
exposure.ingress.tlsSecretName | UnifAI only generates https:// addresses |
stack.spec.identity.external | the managed Keycloak needs the OpenShift operator catalog |
stack.spec.exposure.networkPolicy: false | the 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
| Key | Default | Description |
|---|---|---|
operator.enabled | true | install the operator ; false when it already runs on the cluster |
operator.image | pinned digest | operator image |
operator.imagePullPolicy | IfNotPresent | pull policy of the operator |
operator.imagePullSecrets | [] | pull secrets of the operator |
operator.resources | 50m / 192Mi, limit 1Gi | resources of the operator |
operator.nodeSelector, tolerations | empty | scheduling of the operator |
operator.userRoles | true | create the unifai-view, unifai-edit and unifai-admin ClusterRoles |
operator.metrics.serviceMonitor | false | create a ServiceMonitor (requires the prometheus-operator definitions) |
stack.enabled | true | create the UnifaiStack |
stack.spec | see below | content of the UnifaiStack, passed as is to the operator |
exposure.type | route | route, ingress or none |
exposure.domain | empty | domain of the published hosts ; required with ingress |
exposure.ingress.className | empty | Ingress class |
exposure.ingress.annotations | {} | annotations of both Ingresses |
exposure.ingress.uiAnnotations | {} | annotations of the web interface Ingress |
exposure.ingress.tlsSecretName | empty | TLS Secret of the Ingresses ; required with ingress |
exposure.ingress.installRouteCRD | false | install a schema-less Route definition ; never on OpenShift |
exposure.ingress.createUiServingCert | true | generate the internal certificate of the web interface (unifai-ui-tls) |
project.enabled | false | create 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 :
| Key | Default | Description |
|---|---|---|
profile | dev | dev (small requests, no autoscaling) or prod |
version, images | v0.1.77, digests | UnifAI 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.external | not set | your own Keycloak ; replaces identity.keycloak |
storage.className | cluster default | class of the database volumes |
storage.sharedClassName | cluster default | class 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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartunifai is pinned at v21.3.414 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- 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