Install and share templates
Install a built-in, community or organization template into a project, save a project as a template, and share or contribute one.
A template is one YAML file that creates a set of services, with the questions to answer at install time. Install one to get running services without wiring each one by hand, or write one so that others can. The template file reference lists every field.
Before you begin
- To install into an existing project, you need the deployer role or higher. To install into a new project, you need the admin role.
- To deploy the installed services, the environment you install into needs a cluster. See Connect a cluster.
Install a template
- Open Templates. The page has three sections: Built-in, which ships with your NebulaCtrl version, Community, and Your organization. Search by name, tag or image and the category pills narrow all three, and the page address keeps both.
- Open a template to read its page, and select Install. A community template, or one from a URL, shows a warning: Written outside NebulaCtrl, so check the images it runs in its source before installing. Read the images and variables it lists first.
- Under the target control, choose New project and enter a Project name, or choose Existing project and pick one.
- Choose an Environment. With None, it only creates the services: no domains and no first deploys.
- With an environment, Deploy after installing is on: the dialog stages each service's first deploy in that environment and applies it, so the services deploy as soon as they are installed. A protected environment answers with an approval request instead. If someone already has other changes staged for that environment, the dialog leaves the first deploys staged so you review everything together. Turn it off to create the services without staging or deploying anything.
- Answer the inputs. A required input must be filled. A secret input shows a masked field.
- To change a service's name in the project, open Advanced: rename services.
- Select Install.
The result lists each service with its deploy state, and each domain. A domain reports its own outcome, so a failed domain does not undo the services.
The install is atomic for the project, services, processes, volumes and variables: one transaction writes all of it or none. A template's variables are written to every environment of the project, and secret(N) draws a separate value for each environment. A service whose slug the project already uses fails the install with a 409 that says which service to rename.
Through the API, and whenever the first deploys are left staged, nothing builds or deploys until you apply the staged change set. The first deploys are staged in the chosen environment, databases first. On a protected environment, applying the change set waits for an approval like any other deploy. See Change sets and approvals.
Verify
If the first deploys were left staged, the services appear on the canvas marked as staged. In the staged bar, select Deploy N changes, where N is the number of staged changes. On a protected environment the button reads Request approval. The review dialog lists what will happen, and the same button applies it. Each service then goes through deployment and becomes healthy.
Install from a URL
A template does not have to be saved anywhere. Select Install from URL on the Templates page, enter the link in Template URL, and select Preview. The console accepts an https:// link whose path ends in .yaml or .yml. A GitHub link of the form https://github.com/OWNER/REPO/blob/REF/PATH works, where REF is one path segment, so a branch name that contains / does not.
NebulaCtrl previews the file and lists its problems. Selecting Install reads the URL again, so the installed content is what the URL serves at that moment.
You can share the same preview as a link:
https://CONTROL_PLANE/ORGANIZATION/templates?install=TEMPLATE_URLCONTROL_PLANE is your control plane's address, ORGANIZATION is your organization's slug, and TEMPLATE_URL is an https:// URL to the YAML file. Opening the link shows the preview. Nothing is saved to your organization.
Update a service from its template
Installing a template from the catalogue records, on every service it creates, which catalogue the template came from (built-in, community or organization), its slug, the service's name in the template and the digest of the version installed. The digest is a SHA-256 of the template file, so the same file has the same digest wherever it came from. NebulaCtrl keeps the installed version's text by digest, so an update can tell what the template's author changed from what you changed, after the catalogue has moved on. A service installed from a URL or from pasted YAML records nothing and is never offered an update.
When the catalogue serves a version with a different digest, the service shows Update available on its canvas card and in its sheet header. The catalogue changes in three ways: a built-in template changes with a NebulaCtrl release, a community template when the hourly refresh reads a new file, and an organization template when you edit or refresh it. The chip shows only in an environment that is behind the catalogue's version, and never in a preview environment, which cannot take an update.
- Select Update available on the card or in the sheet header. Hovering it reads "A newer version of TEMPLATE is available. Open the update to review it."
- Read the dialog, Update SERVICE from its template. Its first sentence names the template. What changes lists the image, process and port changes, new volumes and variables, and variables the new version no longer sets. Kept as you have them lists everything you changed since the install, each marked
kept: you changed this. Not done lists what an update never does, and Also lists notes. The footer sums them, for example "4 changes · 2 kept as you have them". - Answer Asked at update time, if the dialog has it. Only inputs that a variable the update writes uses appear. A required input with no default carries a Required badge, and Stage update stays off until it is filled.
- Select Stage update.
A toast reads "Update staged for SERVICE", the dialog closes and the review dialog opens on the environment's staged changes. Select Dismiss this version instead to hide the notice. If the environment is already at the current version, the dialog says so and only offers Close. If the catalogue no longer has the template, the dialog says there is nothing to update from and the service keeps running as it is.
The update goes into your draft change set for the environment, as one template.update item that records the version you move from, next to variable.set, variable.delete and volume.size items for the rest, each of which you can review and remove. Staging is all or none. Nothing builds or deploys until you apply the change set. On a protected environment, applying it waits for an approval like any other deploy. Applying it deploys the new image once, with the new variables, and ends the notice for that environment. If someone else moved the service to another version after you staged, the apply changes nothing and the dialog says which lines drifted, as for any other staged change.
Variables, volume sizes and releases belong to an environment, so an update is staged and applied one environment at a time. The chip stays until every environment is at the new version.
What an update leaves alone:
- A value you changed. The update compares the version you installed, the new version and your service. It changes a field only when you never touched it, and lists the rest as kept.
- A secret that already exists.
secret(N)values are drawn only for variables the update adds, and every generated secret has at least 32 characters. A variable generated at install, or built from your answers, is kept, because the update cannot tell whether you changed it. - A volume's data. A volume the new version drops is kept, a volume only grows, and a smaller size is refused with a reason that begins
refused: a volume cannot shrink. A mount path is never changed in place. - A database's version. The data needs the version it was created with, so a changed version is refused.
- A tag you deployed yourself. NebulaCtrl does not record which tag a service runs after the install, so the update stages the new image unless you changed the service's image repository. Review shows the change before it runs.
Select Dismiss this version to hide the notice for the version you are looking at. The service keeps running as it is, and a newer version shows its own notice.
A template page shows how many services in your organization were installed from it, for example 3 services installed from this template.
To do the same with the API, GET /api/v1/services/SERVICE_ID/template-update?environmentId=ENVIRONMENT_ID returns the comparison and writes nothing. Each entry has a status: add, change and remove are what staging does, kept is a value you changed, refused is something an update never does, and note is information.
curl -X POST https://CONTROL_PLANE/api/v1/services/SERVICE_ID/template-update \
-H "Authorization: Bearer TOKEN" \
-H "Content-Type: application/json" \
-d '{ "environmentId": "ENVIRONMENT_ID", "answers": {} }'The POST stages the same changes in your draft change set and answers with the draft and what was kept. A missing required answer is a 422 that names it. POST /api/v1/services/SERVICE_ID/template-update/dismiss with { "digest": "TO_DIGEST" } hides that version's notice, and GET /api/v1/projects/PROJECT_ID/template-updates lists which services of a project have an update.
Save a project as a template
To turn something you already run into a template:
- Right-click the project's canvas, or the project in the project list, and select Save as template….
- Under From environment, pick the environment to export. The dialog tags each service as exported, a database, a warning or skipped.
- Select Open in editor, check the file, and select Save template.
The saved template appears under Your organization.
The export covers the services, processes, volumes, variables and domains of the environment. It skips a proxy service, a service built from a private Git connection and a service that pulls through a private registry credential, and warns about each. It does not export environment or project variables, file mounts, release commands or deploy-after lists. A secret variable becomes a required secret input. A domain becomes an input named <SERVICE>_HOSTNAME, or <SERVICE>_<PROCESS>_HOSTNAME when several processes of one service have a domain.
A project that outgrew the template limits is trimmed to fit, and the dialog warns about everything left out. A service past the 20th reads NAME was left out: a template holds at most 20 services; export it into a second template. A name or description that is too long is shortened. If every service is left out, the export fails with nothing to export: every service of PROJECT was left out.
Check the exported file before you share it. An image with no release in the environment is exported as <repository>:latest, so pin its tag.
Write a template
To write a template, open New template on the Templates page, or create a file by hand. The editor shows Checking… and then either each problem as Line N: path: message or ok (NAME, N services). It validates 400 ms after your last keystroke. It does not check the file name against the slug. Run nebula template validate for that, as described in the reference.
Saving from the console stores the YAML you see. A template you save with the API from a URL (POST /api/v1/templates with url) remembers that URL, and its page offers Refresh from URL. A template saved from the console has no URL to refresh.
On an organization template's page, Edit… changes it, Copy install link shares it when it has a URL, and Delete template removes it after a second click.
Contribute a template
Contribute a template to the community catalogue with a pull request:
- Fork
nebulactrl/nebula-templates. - Add
templates/SLUG.yaml, whereSLUGequals the template'sslug. - Run
nebula template validate templates/SLUG.yaml. - Open a pull request.
Every NebulaCtrl installation reads the main branch about once an hour, and Refresh in the Community section reads it sooner. Only templates/SLUG.yaml files count: a file with another extension is ignored. A file that fails validation, is larger than 256 KiB, or has a slug that differs from its file name is skipped silently, as is a template whose slug equals a built-in template's. The built-in template wins.
To turn off the community catalogue, or to read your own fork, set --community-templates or --community-templates-repo on the control plane. See Configuration.
Next steps
- Variables explains the variables a template writes.
- Import from Docker Compose creates services from a Compose file instead.
- Describe a project in Git keeps a project's services and databases in a
nebula.toml.
Import a Docker Compose file
Review a repository's Compose files in four steps and stage their services, databases, secrets and wiring in one change set.
Configure a service from its repository
Add a nebula.toml to a service's build context so each build reads its processes, variables and build settings from Git, and see the console follow it.