Skip to content

Create a template source

Enterprise

Create an ArenaTemplateSource so the dashboard’s New project gallery has templates to list. See Arena templates for how the controller discovers templates inside the source.

  • Enterprise features enabled (enterprise.enabled=true, which defaults to false).
  • Workspace content storage, which the chart always configures. An arena-controller started without --workspace-content-path puts every source in phase: Error, and it never syncs.
  • A workspace namespace to put the source in. A template source belongs to one workspace, and the gallery lists only the current workspace’s sources.
  • For a private repository: the credentials to give it.
  1. Save the manifest, replacing the namespace and URL with your own (the values shown are illustrative):

    apiVersion: omnia.altairalabs.ai/v1alpha1
    kind: ArenaTemplateSource
    metadata:
    name: company-templates
    namespace: workspace-ns
    spec:
    type: git
    syncInterval: 30m
    templatesPath: templates/
    git:
    url: https://github.com/acme/arena-templates
    ref:
    branch: main

    ref accepts branch, tag or commit. syncInterval defaults to 1h and templatesPath to templates/.

  2. Apply it:

    Terminal window
    kubectl apply -f company-templates.yaml

For oci and configmap sources, see the ArenaTemplateSource reference.

For a private repository, put the credentials in a Secret in the source’s namespace and reference it from spec.git.secretRef. To fetch through a Connection instead, use spec.git.connectionRef; see the reference for its rules.

  1. Create the Secret. For HTTPS, use username and password keys (the token below is a placeholder):

    apiVersion: v1
    kind: Secret
    metadata:
    name: git-credentials
    namespace: workspace-ns
    stringData:
    username: git-user
    password: <personal-access-token>

    For SSH, use identity and known_hosts keys:

    apiVersion: v1
    kind: Secret
    metadata:
    name: git-ssh-credentials
    namespace: workspace-ns
    stringData:
    identity: |
    -----BEGIN OPENSSH PRIVATE KEY-----
    ...
    -----END OPENSSH PRIVATE KEY-----
    known_hosts: |
    github.com ssh-rsa AAAAB3NzaC1yc2...
  2. Reference it from the source. For an SSH Secret, use an ssh:// URL:

    spec:
    git:
    url: https://github.com/acme/private-templates
    ref:
    tag: v2.0.0
    secretRef:
    name: git-credentials

Template files use Go template syntax to reference the variables declared in template.yaml:

config.arena.yaml
name: {{ .agentName }}
provider:
type: {{ .provider }}
temperature: {{ .temperature }}

Only files marked render: true are rendered. See the template.yaml format for the variable types.

Add the community templates to another workspace

Section titled “Add the community templates to another workspace”

With enterprise.enabled=true and defaultWorkspace.enabled=true, the operator installs a community templates source in the default workspace, in its omnia-resources release. Set enterprise.communityTemplates.enabled=false for an air-gapped cluster. Its name, URL, branch, templatesPath, syncInterval and timeout come from enterprise.communityTemplates.*.

Any other workspace that wants the community templates needs this resource in its own namespace:

apiVersion: omnia.altairalabs.ai/v1alpha1
kind: ArenaTemplateSource
metadata:
name: community-templates
namespace: workspace-ns
spec:
type: git
git:
url: https://github.com/AltairaLabs/promptkit-templates.git
ref:
branch: main
templatesPath: ""
syncInterval: 1h
timeout: 2m
  1. List the sources in the namespace:

    Terminal window
    kubectl get arenatemplatesource -n workspace-ns

    PHASE shows Ready and TEMPLATES shows a number greater than zero once the source has fetched and found at least one template.yaml.

  2. Open the dashboard’s New project page. The gallery lists the templates under “Start something new”. The gallery reads only sources in Ready.

Read the cause:

Terminal window
kubectl get arenatemplatesource company-templates -n workspace-ns -o jsonpath='{.status.message}'

A missing Secret, wrong credentials or an unreachable URL all appear here. Confirm the Secret is in the source’s namespace and has the keys the auth method needs. When workspace content storage is disabled, status.message is empty; read the message on the Ready condition instead.

Either no template.yaml sits under templatesPath, or each one is missing metadata.name, which makes the controller skip it. When templatesPath is left at its default and no templates/ directory exists, the controller scans from the source root, so templates kept elsewhere are not found. Check the path against the repository layout.

A templatesPath you set that does not exist in the source is an error: the phase is Error and status.message reads templatesPath "<path>" not found in source.

A change in the repository does not show up

Section titled “A change in the repository does not show up”

The controller checks for a new revision every syncInterval. Wait for the interval, or lower it.