Skip to content
Stackship documentation Svenska

BlueprintsUsers

Template format

Every field of a blueprint template — metadata, managed resources, outputs and the container instance — with the tokens, platform values and repository layout.

Document

A template is one YAML or JSON document. Unknown fields are errors.

Field Required Content
apiVersion No blueprints.stackship.se/v2, which is also what an absent one means
kind No BlueprintTemplate, which is also what an absent one means
metadata Yes How the blueprint appears in the catalog — Metadata
parameters No What the deployer fills in — Parameters
resources No Managed resources to provision — Managed resources
outputs No Values describing the deployed instance — Outputs
instance Yes The container instance to create, with at least one component — Instance

A minimal template:

yaml
apiVersion: blueprints.stackship.se/v2
kind: BlueprintTemplate

metadata:
  slug: hello
  title: Hello
  version: "1.0.0"
  category: Tools
  tags: [example]

parameters:
  - name: ingress_host
    type: String
    label: Public Hostname
    default: "[%name%].{{domain_suffix}}"

instance:
  components:
    - name: web
      computePlan: small
      containers:
        - name: web
          image: docker.io/nginxinc/nginx-unprivileged
          tag: "1.31-alpine"
          ports:
            - name: http
              port: 8080
          probes:
            readiness:
              type: http
              port: http
              path: /
  endpoints:
    - name: web
      component: web
      port: http
      hostname: "[%ingress_host%]"

Metadata

Field Content
slug Required. The blueprint's identifier. In a repository, the directory name is used instead
title Required. The name shown in the catalog
version Shown in the catalog and recorded on every instance deployed from it; 1.0 when absent
description Shown on the card and in the wizard
category Groups the catalog into tabs, for example Databases, Platforms, Tools
tags Search terms and filters. stackship puts the blueprint in the catalog's Spotlight
documentation A URL the wizard links to
icon An inline data: URI, base64-encoded, of type image/svg+xml, image/png, image/webp or image/jpeg, at most 128 KiB decoded. A URL is refused. In a repository, an icon file next to the template is used instead — see Repository layout
hidden true keeps the blueprint out of the catalog listing while it stays deployable by slug. Applies to blueprints read from a repository; a template saved through the API is always listed

Managed resources

Each entry in resources asks the platform to provision a resource before the container instance is created, and to write its connection details into the instance vault. Every field accepts tokens.

Field Content
name The resource's name within the template. The created resource is named <instance>-<name>
type postgres — the only type today. Any other type is refused before the deploy starts
availability Single (the default) or HighAvailable, which provisions three database instances. High Available, HighlyAvailable and HA are read the same way; anything else means one instance
storage Volume size, 10Gi when absent
exposes Connection details to write into the vault: a list of output and vaultKey. The same output may be written under several keys

A postgres resource exposes these outputs:

output Value
connectionString The key=value connection string .NET and Npgsql expect
uri The postgres:// URI most other clients expect
host, port, database, username, password The parts, one at a time

The deploy waits up to five minutes for the database to accept connections before it creates the container instance. A container reads a detail through a secretRef to the instance vault:

yaml
resources:
  - name: db
    type: postgres
    availability: "[%db_availability%]"
    storage: 10Gi
    exposes:
      - output: connectionString
        vaultKey: connectionstring_db
yaml
env:
  - name: ConnectionStrings__Default
    secretRef: { vault: "[%instance_vault%]", key: connectionstring_db }

Outputs

Each entry in outputs has a name, a label, a description, a type — string (the default) or url — a secret flag, and a value with tokens. Outputs are stored with the template, but the portal does not show them anywhere today.

Instance

instance is the container instance to create: components and endpoints, in the shape the Container Instances API accepts. What each setting does is described with container instances — see Create a container instance and Endpoints. The instance's own rules, such as at most 16 components and 0 to 10 replicas, are applied when the deploy creates it.

Level Fields
Component name, condition, replicas (default 1), startupOrder (default 1), computePlan, minComputePlan, cpu, memory, hardened, runAsUser, runAsGroup, identityInjection, initContainers, containers, volumes, scaling
Container, init container name, condition, image, tag (default latest), sourceRef, command, args, env, ports, probes, mounts
env entry name, and value or secretRef (vault, key)
ports entry name, port, protocol (TCP or UDP)
probes readiness, liveness, startup, each with type (tcp, http or exec), port, path, command, initialDelaySeconds, periodSeconds, timeoutSeconds, failureThreshold
mounts entry volume, path, subPath, readOnly
volumes entry name, and one of emptyDir (sizeLimit), persistent (size, tier, storageClass, retainOnDelete — default true, fsGroup) or files (sensitive, content — file name to content)
scaling strategy (Manual, the default, or Hpa) and hpa (minReplicas 1, maxReplicas 3, targetCpuPercent 80 by default)
Endpoint name, condition, component, port (a port name), expose (ingress, the default, or loadBalancer), hostname, paths, ssl, issuer, authGuard
  • sourceRef names a private registry connected to the boundary that the image is pulled through — usually a DeploymentSource parameter, sourceRef: "[%registry%]". Empty means a public image.
  • A container reads a secret through secretRef with vault: "[%instance_vault%]" and the parameter's name, or the vaultKey of a resource output, as key. vault must be exactly "[%instance_vault%]"; a template that names any other vault is rejected.
  • The deployer's Compute step sets computePlan and replicas per component; the template's values are the defaults it shows.
  • minComputePlan is the smallest plan a component runs on. The Compute step disables plans with less CPU or less memory, and the deploy refuses them. Set it for components that fail on a small plan, so a deployer who does not know the sizes cannot pick one.

Conditions

condition on a component, a container, an init container or an endpoint names a Boolean parameter. Unless that parameter is true, the element is left out before anything else is rendered, and an endpoint whose component was left out goes with it. A condition naming a parameter that does not exist counts as off.

Warning

The portal's Compute step sends settings for every component the template declares. When a component's condition leaves it out, a deploy from the portal fails at Create the container instance with The template has no component named '<component>'. Gate containers, init containers or endpoints rather than whole components where you can.

Tokens

[%parameter%] in any string of instance and resources — keys of a files volume included — is replaced at deploy time.

  • [%name%] is the instance name and [%instance_vault%] the instance vault's name. A template that declares parameters with these names is rejected.
  • [%parameter:type:default%] uses default when there is no parameter of that name.
  • [%parameter_urlencoded%] is the parameter's value URL-encoded, for building URIs from generated passwords.
  • Parameter defaults may contain tokens too, such as default: "[%name%].example.com".
  • A token with nothing to fill it is left in place exactly as written.

A token puts the value into the container instance's own settings as plain text, readable by anyone who can read the instance. Pass secrets through secretRef, never as a token in an env value.

Platform values

When the platform reads a template from a repository — the platform catalog or a catalog source — it replaces two values in parameter defaults, output values and endpoint hostnames and issuers:

Value Becomes
{{domain_suffix}} The platform's app domain, apps.example.com
{{cert_issuer}} The certificate issuer the platform was installed with

A template saved through the API is stored as sent: write these values out in full there.

Repository layout

A repository publishes one blueprint per directory, under the folder the source or the platform catalog points at:

text
blueprints/
  my-app/
    template.yaml
    icon.svg
  my-db/
    template.yaml
  • The directory name is the blueprint's slug, whatever metadata.slug says.
  • The icon is the first of icon.svg, icon.png, icon.jpg or icon.webp found next to template.yaml. Without one, metadata.icon is used.
  • Every directory is read as a blueprint. One without a template.yaml, or with one that does not parse, is skipped and the others still load.
  • Submodules are not cloned.