5 How do I create a blueprint CR for inference with Ollama? #
To create a blueprint custom resource (CR) for inference, define the metadata, blueprint specification, chart repository, and component values in a single manifest file.
5.1 Header and metadata #
The metadata section defines the unique identity and labels for the blueprint.
apiVersion: ai-factory.suse.com/v1alpha1
kind: Blueprint
metadata:
labels:
ai-factory.suse.com/blueprint-name: my-demo-ollama
ai-factory.suse.com/blueprint-version: 1.0.0
name: my-demo-ollama-1-0-0Add a comment block at the beginning of the file summarizing what the blueprint deploys, which models it serves, and any differences from sibling variants.
Because kubectl apply preserves comments in the repository source, this provides essential context for future maintenance.
5.2 Defining the blueprint specification #
The spec section outlines the display metadata and prerequisites.
spec:
source: Custom
displayName: My Demo (Ollama, CPU)
version: 1.0.0
description: |
Deploys a demonstration stack running local models on CPU using Ollama.
This blueprint deploys Ollama in-cluster with persistent storage while maintaining a lightweight resource footprint.
Prerequisites: The SUSE AI Factory operator, the application-collection ClusterRepo and credentials secret, and a default StorageClass. After registering, create an AIWorkload from this blueprint in the Web interface.Provide a concise description that ends with a clear summary of prerequisites. This description is displayed directly to users in the SUSE AI Factory Web interface.
5.3 Selecting a chart repository #
The chartRepo parameter must reference an active SUSE Rancher Prime ClusterRepo resource on the target cluster.
Standard repositories in SUSE AI Factory include:
Repository (chartRepo) | Contents | Pre-registered |
|---|---|---|
| SUSE Application Collection charts ( | Yes, on SUSE AI Factory clusters. |
| SUSE AI charts ( | Yes, on SUSE AI Factory clusters. |
If a chart is not in a pre-registered repository, add a ClusterRepo manifest in clusterrepos/.
For more information, see Chapter 7, How do I manage additional Helm repositories?.
To identify available versions of a chart in the repository:
> kubectl get clusterrepo application-collection \
-o yaml | grep -A2 downloadTime
> helm search repo application-collection/ollama --versions | head5.4 Configuring chart values #
Configure chart values under the values key:
values:
# Pin the service name to prevent Helm release name prefixes
fullnameOverride: ollama
image:
pullPolicy: IfNotPresent
registry: dp.apps.rancher.io
repository: containers/ollama
tag: 0.21.2-11.48
persistentVolume:
enabled: true
accessModes:
- ReadWriteOnce
size: 20Gi
service:
port: 11434
type: ClusterIP
env:
- name: QDRANT_URL
value: http://qdrant:6333Use ClusterIP services and forward local ports with kubectl port-forward during testing.
Define an ingress block only when a component provides a Web user interface that requires external access.
5.5 Adding an Ollama component #
The following configuration defines a standard Ollama component with CPU inference:
- chartName: ollama
chartRepo: application-collection
chartVersion: 1.55.0
values:
fullnameOverride: ollama
image:
pullPolicy: IfNotPresent
registry: dp.apps.rancher.io
repository: containers/ollama
tag: 0.21.2-11.48
ollama:
gpu:
enabled: false 1
draEnabled: false
models:
pull:
- qwen2.5:0.5b
run:
- qwen2.5:0.5b
port: 11434
persistentVolume:
enabled: true
accessModes:
- ReadWriteOnce
size: 20Gi
service:
port: 11434
type: ClusterIPKey considerations for model management:
Models listed under
models.pullare downloaded on initial startup. For demonstrations, lightweight models such asqwen2.5:0.5b,llama3.2:1b, andmoondream:1.8b(vision) initialize quickly.Models listed under
models.runremain in memory. When serving multiple models, configureextraEnvvariables such asOLLAMA_KEEP_ALIVEandOLLAMA_MAX_LOADED_MODELS.Both embeddings and chat endpoints are served by the same service (
http://ollama:11434in-cluster).
Set |
5.6 Operational considerations #
Keep the following operational best practices in mind when constructing blueprints:
Set
fullnameOverride: Always definefullnameOverridewhere supported. Without it, Helm prefixes the service name with the generated release name, which breaks port-forwarding scripts and internal DNS resolution.Pin generated secrets in Airflow: When using Apache Airflow, pin the generated secret keys so that pod templates remain stable across Fleet reconciliation cycles:
# Pin generated secret keys to prevent Fleet reconciliation loops
fernetKey: "Nv3aCd-3agJbJG1QxzKMezX5pJZB4fRpZIrqhdS-MA4="
jwtSecret: "72873f21d1682ddc023f0815344d1cdc0157e59c9c5480bcb430686d6ed466d3"
webserverSecretKey: "bb3ea2e3f0a3ad96a2f440ab3ca4e3406985aaf72182662ebd339f53a7a28a7a"For production environments, reference pre-created Kubernetes secrets rather than hardcoding static secrets in the blueprint definition.
Disable unused sub-charts: When using
LocalExecutorwith Airflow, setredis.enabled: falseandflower.enabled: falseto avoid deploying unnecessary pods that consume cluster resources.
5.7 Verifying the blueprint registration #
Validate and register your blueprint using kubectl:
> kubectl apply --dry-run=server -f my-demo-ollama-1-0-0.yaml
> kubectl apply -f my-demo-ollama-1-0-0.yaml
> kubectl get blueprint my-demo-ollama-1-0-0 -o yaml