Building apps
This guide explains how to package apps that work on every n5i distribution. An app is a directory of YAML files that describe its containers, its metadata in the app store, and optionally files to generate at install time. n5i turns these files into Kubernetes objects, so you don't need to write Kubernetes manifests yourself.
App structure
An app is a directory named after the app's ID. The ID must be unique within an app store, and it is used in hostnames and Kubernetes namespaces, so keep it short, lowercase and use only letters, digits and -.
linkstack/
├── app.yml # or app.yml.jinja: containers, services, ingress, secrets
├── metadata.yml # or metadata.yml.jinja: permissions, volumes, settings, UI entries
├── store-metadata.yml # name, description, version and other app store information
├── custom.yml # optional, or custom.yml.jinja: extra Kubernetes objects
├── _tera/ # optional: JavaScript helpers for templates
│ └── helpers.js
└── data/ # optional: files preloaded into volumes
└── <volume-id>/
└── config.yml.n5i_jinja| File | Required | Purpose |
|---|---|---|
app.yml | yes | The app definition: containers, services, ingress, secrets and network policies. |
metadata.yml | yes | Developer metadata: permissions, volumes, settings, dependencies, dashboard menu entries. |
store-metadata.yml | with metadata.yml version 2 | Store metadata: what users see in the app store. |
custom.yml | no | Arbitrary Kubernetes objects (requires admin permissions to install). |
_tera/*.js | no | JavaScript functions for templates. |
data/ | no | Files that are copied into the app's volumes on installation. |
Any of app.yml, metadata.yml and custom.yml can be a template instead: name it app.yml.jinja (and so on), and n5i renders it with Tera before parsing it.
If a directory does not contain both app.yml and metadata.yml, n5i asks the installed runtime plugins whether they can handle it. This is how other app formats can be supported.
Example app
This guide uses LinkStack, a self-hosted link page, as an example. Create a directory for the app:
mkdir linkstack
cd linkstackThen continue with building a basic app.