This is an installation of TrustGraph on Azure using the Kubernetes (AKS) platform.
The full stack includes:
- Its own resource group
- A VNet with dedicated subnets for AKS nodes and AGC
- An AKS cluster with managed identity, workload identity, and the ALB Controller addon for Gateway API support
- Azure Application Gateway for Containers (AGC) providing public HTTPS access via Gateway API
- cert-manager with Let's Encrypt for automated TLS certificate management
- A key vault and storage account for the AI components
- Using AI Foundry, deploys an AI hub and project with Mistral-Large-3
- Deploys a complete TrustGraph stack of resources in AKS
Keys and other configuration for the AI components are configured into TrustGraph using secrets.
This uses Pulumi which is a deployment framework, similar to Terraform but:
- Pulumi has an open source licence
- Pulumi uses general-purposes programming languages, particularly useful because you can use test frameworks to test the infrastructure.
Roadmap to deploy is:
- Prerequisites (one-time)
- Install Pulumi
- Setup Pulumi
- Configure your environment with Azure credentials using
az login - Modify the local configuration to do what you want
- Deploy
- Configure DNS
- Use the system
The following Azure preview features must be registered on your subscription before deploying:
az feature register --namespace "Microsoft.ContainerService" --name "ApplicationLoadBalancerPreview"
az provider register -n Microsoft.ContainerService
You can check registration status with:
az feature show --namespace "Microsoft.ContainerService" --name "ApplicationLoadBalancerPreview" --query "properties.state"
Wait until it shows Registered before deploying.
The following resource providers must also be registered:
az provider register -n Microsoft.ServiceNetworking
az provider register -n Microsoft.ContainerService
Navigate to the Pulumi directory:
cd pulumi
Then:
npm install
You need to tell Pulumi which state to use. You can store this in an S3 bucket, but for experimentation, you can just use local state:
pulumi login --local
If you want to encrypt secrets, you can set a passphrase. If not, you can set the passphrase to the empty string to avoid the password prompts.
export PULUMI_CONFIG_PASSPHRASE=
Pulumi operates in stacks, each stack is a separate deployment. The
git repo contains the configuration for a single stack azure, so you
could:
pulumi stack init azure
and it will use the configuration in Pulumi.azure.yaml.
Standard Azure client configuration e.g. use az login to configure
credentials.
You can edit:
- settings in
Pulumi.STACKNAME.yamle.g. Pulumi.azure.yaml - change
resources.yamlwith whatever you want to deploy. The resources.yaml file was created using the TrustGraph config portal, so you can re-generate your own.
The Pulumi.STACKNAME.yaml configuration file contains settings for:
trustgraph-azure:location- Azure deployment locationtrustgraph-azure:environment- Name of the environment you are deploying, use a name like: dev, prod etc.trustgraph-azure:node-size- The VM size for AKS nodes e.g.Standard_D8s_v5trustgraph-azure:node-count- Number of nodes in the AKS clustertrustgraph-azure:domain- Domain name for TrustGraph UI e.g.azure1.dev.trustgraph.aitrustgraph-azure:grafana-domain- Domain name for Grafana e.g.grafana.azure1.dev.trustgraph.aitrustgraph-azure:letsencrypt-email- Email address for Let's Encrypt certificate notificationstrustgraph-azure:llm-quota- LLM model quota in thousands of tokens-per-minute (TPM). Default:10. Increase if you hit rate limiting under normal usage
pulumi up
Just say yes.
If everything works:
- A file
kube.cfgwill also be created which provides access to the Kubernetes cluster. - A file,
ssh-private.keywill contain a secret SSH login key for the K8s instances. You shouldn't need to use this. - The AGC Frontend FQDN will be output as
agcFrontendFqdn.
To connect to the Kubernetes cluster...
kubectl --kubeconfig kube.cfg -n trustgraph get pods
An error has been observed on creation while creating the Storage Account,
stating "parallel access to resources" which hasn't been diagnosed -
assuming it must be a glitch in Azure. The work-around on deploy errors
is to retry pulumi up - it's a retryable command and will continue from
where it left off.
After deployment, create two CNAME records pointing to the AGC Frontend
FQDN (shown in the agcFrontendFqdn output):
| Record | Type | Target |
|---|---|---|
Your domain value |
CNAME | AGC Frontend FQDN |
Your grafana-domain value |
CNAME | AGC Frontend FQDN |
For example:
azure1.dev.trustgraph.ai CNAME dxdkh0dpeuckfzek.fz11.alb.azure.com
grafana.azure1.dev.trustgraph.ai CNAME dxdkh0dpeuckfzek.fz11.alb.azure.com
Once DNS resolves, cert-manager will automatically provision TLS certificates via Let's Encrypt. This typically takes a few minutes.
Once DNS and TLS are configured, access the services directly:
- TrustGraph UI:
https://<domain> - Grafana:
https://<grafana-domain>
You can also use port-forwarding with the kube.cfg file if needed:
kubectl --kubeconfig kube.cfg -n trustgraph port-forward service/api-gateway 8088:8088
kubectl --kubeconfig kube.cfg -n trustgraph port-forward service/grafana 3000:3000
The IAM bootstrap token and Grafana admin password are auto-generated by Pulumi. After deployment, retrieve them with:
pulumi stack output iamToken --show-secrets
pulumi stack output grafanaPassword --show-secrets
Login to Grafana with username admin and the password from the command
above.
To use the TrustGraph API with authentication:
export TRUSTGRAPH_TOKEN=$(pulumi stack output iamToken --show-secrets)
pulumi destroy
Just say yes.
You may need to increase CPU quota for your node VM family and location. For example, to increase quota for Standard_DSv5 VMs in swedencentral:
az quota update --resource-name "standardDSv5Family" \
--scope "/subscriptions/$(az account show --query id -o tsv)/providers/Microsoft.Compute/locations/swedencentral" \
--limit-object value=20
Adjust the --resource-name and location to match your node-size and
location settings in Pulumi.STACKNAME.yaml.
The Mistral-Large-3 model is deployed with a default quota of 10K
tokens-per-minute (TPM) on GlobalStandard. If you see rate limiting
errors in the text-completion pod logs, increase the quota:
trustgraph-azure:llm-quota: 20Azure may also impose subscription-level quota limits on model deployments. You can check and request increases in the Azure portal under AI Foundry > Quotas.
To use a different model, three things need to change:
-
Deploy the model in Azure — edit
pulumi/ai-models.tsto add or change thecognitiveservices.Deploymentresource. Set thedeploymentName,model.name,model.format, andmodel.versionto match the model from the Azure AI Foundry catalog. If deploying multiple models, maintain adependsOnchain so they deploy sequentially (Azure doesn't handle parallel model deployments well). -
Update
config.json— theazurecomponent'smodelsfield controls which models appear in the TrustGraph UI dropdown. Change thedefaultandenumto match your deployed models:{ "name": "azure", "parameters": { "max-output-tokens": 4096, "models": { "type": "string", "description": "LLM model to use", "default": "your-model-name", "enum": [ { "id": "your-model-name", "description": "Your Model Display Name" } ], "required": true } } }The
idmust match thedeploymentNameinai-models.ts. -
Regenerate
resources.yaml— run the config generator to rebuild the Kubernetes resource definitions:./update-config aks-k8s 2.5.16
Available models can be found in the Azure AI Foundry model catalog.
The config.json file includes an override component that allows
customization of memory settings for various services. Parameters are
merged into the global parameters block.
For example, in config.json:
{
"name": "override",
"parameters": {
"cassandra-heap": "500M",
"cassandra-memory-limit": "2000M",
"cassandra-memory-reservation": "2000M",
"api-gateway-memory-limit": "768M",
"api-gateway-memory-reservation": "768M"
}
}Available parameters include:
cassandra-heap- Cassandra JVM heap sizecassandra-memory-limit- Cassandra container memory limitcassandra-memory-reservation- Cassandra container memory reservationapi-gateway-memory-limit- API gateway container memory limitapi-gateway-memory-reservation- API gateway container memory reservation
After changing memory settings, regenerate resources.yaml:
./update-config aks-k8s 2.5.16