Components¶
The seventeen built-in components of the kikx registry, generated from GET /api/registry. Components and fields are also printed by kikx list.
Every field value is a string. Every template also receives name, namespace and labels, described in Registry item format. Output paths are relative to the target directory and are rendered with the same context as the file content.
Fields with a format are checked before rendering, and their value is normalised: ip takes one IPv4 or IPv6 address, and cidr takes a range in CIDR notation that starts on its boundary (10.10.0.0/16, not 10.10.0.5/16). An invalid value fails rendering with an error that suggests the corrected value. An empty value is not checked.
A reference resolves to a built-in when the part after its last / equals a built-in name. See Registry item format.
With the CLI, you set a field with --set <field>=<value> on kikx add, using the names in the field tables. In the web app, each component is an entry in the builder’s catalog, under one of its stages, and its fields are a form. The In the app note under each component gives the stage, the entry and the form fields as they are labelled in the app. See The web app.
Summary¶
Reference |
Title |
Description |
Output paths |
|---|---|---|---|
Deployment |
Pods running one container image. |
|
|
Service |
A stable address for pods. |
|
|
Ingress |
Routes HTTP traffic to a service. |
|
|
DigitalOcean Droplet |
Terraform for one or more DigitalOcean droplets. |
|
|
Hetzner Cloud Server |
Terraform for one or more Hetzner Cloud servers. |
|
|
AWS EC2 Instance |
Terraform for one or more AWS EC2 instances. |
|
|
Google Compute Engine Instance |
Terraform for one or more Google Compute Engine instances. |
|
|
Scaleway Instance |
Terraform for one or more Scaleway instances with public IPs. |
|
|
Linode Instance |
Terraform for one or more Linode instances. |
|
|
Kubernetes Bootstrap |
Installs containerd, kubelet, kubeadm and kubectl on target hosts. |
|
|
Inventory |
Hosts, groups, nesting and shared vars for servers you already have. |
|
|
Group vars |
Variables for one inventory group. |
|
|
Common role |
A starter host-hygiene role: base packages, timezone, swap, a templated motd. |
|
|
Role skeleton |
An empty role (tasks, defaults, handlers, meta) to fill in. |
|
|
Playbook |
One or more plays, each running roles on an inventory group. |
|
|
Site playbook |
The entry point that imports your playbooks in order. |
|
|
Ansible config |
ansible.cfg pointing Ansible at your inventory and roles, so playbooks in subfolders find them. |
|
k8s/deployment¶
Property |
Value |
|---|---|
Title |
Deployment |
Description |
Pods running one container image. |
Output paths |
|
Template fallbacks |
|
Field |
Required |
Default |
Example |
Options |
Description |
|---|---|---|---|---|---|
|
yes |
|
|||
|
no |
|
|||
|
no |
|
In the app: Deploy > Deployment. Fields: Name, Image, Port, Replicas, Namespace (empty uses the project’s default namespace) and Labels (Add label).
k8s/service¶
Property |
Value |
|---|---|
Title |
Service |
Description |
A stable address for pods. |
Output paths |
|
Template fallbacks |
|
Field |
Required |
Default |
Example |
Options |
Description |
|---|---|---|---|---|---|
|
no |
|
|||
|
no |
Container port; defaults to the service port. |
In the app: Deploy > Service. Fields: Name, Port, Target port, Namespace and Labels.
k8s/ingress¶
Property |
Value |
|---|---|
Title |
Ingress |
Description |
Routes HTTP traffic to a service. |
Output paths |
|
Template fallbacks |
|
Field |
Required |
Default |
Example |
Options |
Description |
|---|---|---|---|---|---|
|
no |
|
|||
|
no |
|
|||
|
no |
Backend service; defaults to the ingress name. |
|||
|
no |
|
In the app: Deploy > Ingress. Fields: Name, Host, Port, Path, Backend service (suggests the services in the project), Namespace and Labels.
terraform/digitalocean¶
Property |
Value |
|---|---|
Title |
DigitalOcean Droplet |
Description |
Terraform for one or more DigitalOcean droplets. |
Output paths |
|
Template fallbacks |
Declares variable |
Field |
Required |
Default |
Example |
Options |
Description |
|---|---|---|---|---|---|
|
yes |
|
|||
|
yes |
|
|||
|
yes |
|
|
Any image slug the provider accepts; the list is a shortcut. |
|
|
no |
|
|||
|
no |
|
Format |
In the app: Provision > Cloud server, then choose DigitalOcean Droplet in Provider. Fields: Name, Region, Size, OS image (with the options above as suggestions), Count and Private network.
terraform/hetzner¶
Property |
Value |
|---|---|
Title |
Hetzner Cloud Server |
Description |
Terraform for one or more Hetzner Cloud servers. |
Output paths |
|
Template fallbacks |
Declares variable |
Field |
Required |
Default |
Example |
Options |
Description |
|---|---|---|---|---|---|
|
yes |
|
|||
|
yes |
|
|||
|
yes |
|
|
Any image slug the provider accepts; the list is a shortcut. |
|
|
no |
|
|||
|
no |
|
Format |
||
|
no |
|
|
Network zone of the private network; it must contain the server location. |
In the app: Provision > Cloud server, then choose Hetzner Cloud Server in Provider. Fields: Name, Region, Size, OS image (with the options above as suggestions), Count, Private network and Network zone.
terraform/aws¶
Property |
Value |
|---|---|
Title |
AWS EC2 Instance |
Description |
Terraform for one or more AWS EC2 instances. |
Output paths |
|
Template fallbacks |
Declares an |
Field |
Required |
Default |
Example |
Options |
Description |
|---|---|---|---|---|---|
|
yes |
|
|||
|
yes |
|
|||
|
yes |
|
|
Any image slug the provider accepts; the list is a shortcut. |
|
|
no |
|
|||
|
no |
|
Format |
||
|
no |
|
AWS account that publishes the image; 099720109477 is Canonical. |
In the app: Provision > Cloud server, then choose AWS EC2 Instance in Provider. Fields: Name, Region, Size, OS image (with the options above as suggestions), Count, Private network and Image owner.
terraform/google¶
Property |
Value |
|---|---|
Title |
Google Compute Engine Instance |
Description |
Terraform for one or more Google Compute Engine instances. |
Output paths |
|
Template fallbacks |
Declares a |
Field |
Required |
Default |
Example |
Options |
Description |
|---|---|---|---|---|---|
|
yes |
|
|||
|
yes |
|
|||
|
yes |
|
|
Any image slug the provider accepts; the list is a shortcut. |
|
|
no |
|
|||
|
no |
|
Format |
||
|
yes |
|
In the app: Provision > Cloud server, then choose Google Compute Engine Instance in Provider. Fields: Name, Region, Size, OS image (with the options above as suggestions), Count, Private network and Project.
terraform/scaleway¶
Property |
Value |
|---|---|
Title |
Scaleway Instance |
Description |
Terraform for one or more Scaleway instances with public IPs. |
Output paths |
|
Template fallbacks |
Requires the |
Field |
Required |
Default |
Example |
Options |
Description |
|---|---|---|---|---|---|
|
yes |
|
|||
|
yes |
|
|||
|
yes |
|
|
Any image slug the provider accepts; the list is a shortcut. |
|
|
no |
|
|||
|
no |
|
Format |
In the app: Provision > Cloud server, then choose Scaleway Instance in Provider. Fields: Name, Region, Size, OS image (with the options above as suggestions), Count and Private network.
terraform/linode¶
Property |
Value |
|---|---|
Title |
Linode Instance |
Description |
Terraform for one or more Linode instances. |
Output paths |
|
Template fallbacks |
Requires the |
Field |
Required |
Default |
Example |
Options |
Description |
|---|---|---|---|---|---|
|
yes |
|
|||
|
yes |
|
|||
|
yes |
|
|
Any image slug the provider accepts; the list is a shortcut. |
|
|
no |
|
|||
|
no |
|
Format |
In the app: Provision > Cloud server, then choose Linode Instance in Provider. Fields: Name, Region, Size, OS image (with the options above as suggestions), Count and Private network.
ansible/k8s-bootstrap¶
Property |
Value |
|---|---|
Title |
Kubernetes Bootstrap |
Description |
Installs containerd, kubelet, kubeadm and kubectl on target hosts. |
Output paths |
|
Template fallbacks |
Installs |
Field |
Required |
Default |
Example |
Options |
Description |
|---|---|---|---|---|---|
|
yes |
An inventory group, or all. |
|||
|
yes |
|
In the app: Configure > Show more > Kubernetes Bootstrap. Fields: Name, Hosts (suggests all and the inventory groups) and Kubernetes version.
ansible/inventory¶
Property |
Value |
|---|---|
Title |
Inventory |
Description |
Hosts, groups, nesting and shared vars for servers you already have. |
Output paths |
|
JSON-valued fields |
Field |
Required |
Default |
Example |
Options |
Description |
|---|---|---|---|---|---|
|
yes |
||||
|
no |
|
SSH user written for hosts that don’t set one (null on a host omits it). |
||
|
no |
|
SSH port written for hosts that don’t set one (null on a host omits it). |
In the app: Inventory > Inventory. Fields: Name, then Hosts with one row per host (Host name, Address, Groups, and under Connection & host vars: SSH user, SSH port, SSH key file and Host vars), then Groups with Group name, Child groups and Group vars. Import inventory.ini fills both from an existing file. The app builds hosts for you and has no fields for default_user and default_port: leave SSH user and SSH port empty on a host to inherit them from a group’s vars. See Import an existing Ansible inventory.
ansible/group-vars¶
Property |
Value |
|---|---|
Title |
Group vars |
Description |
Variables for one inventory group. |
Output paths |
|
Template fallbacks |
|
JSON-valued fields |
Field |
Required |
Default |
Example |
Options |
Description |
|---|---|---|---|---|---|
|
yes |
||||
|
no |
JSON map of simple key/value pairs. |
|||
|
no |
Raw YAML body, written as-is. |
|||
|
no |
|
|
In the app: Inventory > Group vars. Fields: Group (suggests the inventory groups), Folder layout (ticked writes the dir layout) and Variables, edited as Key / value (vars) or YAML (yaml). The component takes its name from the group. See Manage group vars as YAML or a folder.
ansible/common-role¶
Property |
Value |
|---|---|
Title |
Common role |
Description |
A starter host-hygiene role: base packages, timezone, swap, a templated motd. |
Output paths |
|
Template fallbacks |
|
Field |
Required |
Default |
Example |
Options |
Description |
|---|---|---|---|---|---|
|
no |
|
In the app: Configure > Show more > Common role. Fields: Name and Timezone.
ansible/role¶
Property |
Value |
|---|---|
Title |
Role skeleton |
Description |
An empty role (tasks, defaults, handlers, meta) to fill in. |
Output paths |
|
Template fallbacks |
|
Field |
Required |
Default |
Example |
Options |
Description |
|---|---|---|---|---|---|
|
no |
|
In the app: Configure > Role skeleton. Fields: Name and Description. Checks can also create role skeletons for the roles your playbooks use; see Scaffold the roles your playbooks use.
ansible/playbook¶
Property |
Value |
|---|---|
Title |
Playbook |
Description |
One or more plays, each running roles on an inventory group. |
Output paths |
|
Template fallbacks |
|
JSON-valued fields |
Field |
Required |
Default |
Example |
Options |
Description |
|---|---|---|---|---|---|
|
no |
||||
|
no |
||||
|
no |
JSON list of plays: name, hosts, become, tags, roles, pre_tasks, post_tasks. |
|||
|
no |
|
Where the file goes. Leave empty for the project root. |
In the app: Configure > Playbook. Fields: Name, Folder, then one card per play under Plays (Add play): Name, Runs on (hosts), Roles, in the order they run, Role conditions (when:), Pre-tasks & post-tasks, Tags (optional) and Run as root (become). The app always writes plays; it doesn’t use the legacy hosts and roles fields. See Write a multi-play playbook with role conditions.
ansible/site¶
Property |
Value |
|---|---|
Title |
Site playbook |
Description |
The entry point that imports your playbooks in order. |
Output paths |
|
JSON-valued fields |
Field |
Required |
Default |
Example |
Options |
Description |
|---|---|---|---|---|---|
|
yes |
In the app: Configure > Site playbook. Fields: Name, then Imports, in run order: one row per import with Import name and Playbook path. Click a playbook next to from this project:, or Add all, to add rows for the project’s playbooks; Add path adds an empty row. See Wire playbooks together with a site playbook.
ansible/config¶
Property |
Value |
|---|---|
Title |
Ansible config |
Description |
ansible.cfg pointing Ansible at your inventory and roles, so playbooks in subfolders find them. |
Output paths |
|
Template fallbacks |
|
Field |
Required |
Default |
Example |
Options |
Description |
|---|---|---|---|---|---|
|
no |
|
|||
|
no |
|
In the app: Configure > Show more > Ansible config. Fields: Name, Inventory file and Roles path.
Example: inventory=platform-inventory.ini writes ansible.cfg:
[defaults]
inventory = platform-inventory.ini
roles_path = roles
Ansible reads ansible.cfg from the directory it is run in. From the output directory, ansible-playbook site.yml then uses that inventory without -i, and finds roles in roles/ even for playbooks in a subfolder such as playbooks/.
JSON field shapes¶
A field value whose first non-whitespace character is [ or { and that parses as JSON is passed to the template as a list or map. Any other value, including invalid JSON, is passed as a string. Object keys are iterated in alphabetical order.
hosts¶
Field of ansible/inventory. A JSON array of group objects, written in array order.
Key |
Type |
Written as |
|---|---|---|
|
string |
Section name |
|
array of host objects |
|
|
array of strings |
|
|
object |
|
Host object:
Key |
Type |
Written as |
|---|---|---|
|
string |
First token of the host line |
|
string |
|
|
string or |
|
|
number, string or |
|
|
string |
|
|
object |
|
A host listed under several groups is written in each of those groups.
Missing, null and empty¶
|
Written |
|---|---|
key missing |
|
|
nothing |
non-empty value |
|
ansible_port follows the same rules with default_port.
Example value:
[
{"group": "web", "members": [
{"name": "web-01", "ansible_host": "192.0.2.10"},
{"name": "web-02", "ansible_host": "192.0.2.11", "ansible_user": null, "ansible_port": null},
{"name": "web-03", "ansible_host": "192.0.2.12", "ansible_user": "deploy", "ansible_port": 2222,
"ssh_key_file": "~/.ssh/id_ed25519", "vars": {"http_port": 8080}}
], "vars": {"ntp": "pool.ntp.org"}},
{"group": "db", "members": [{"name": "db-01", "ansible_host": "198.51.100.5", "ansible_user": ""}]},
{"group": "platform", "children": ["web", "db"], "vars": {"env": "prod"}}
]
Output with the default default_user and default_port:
[web]
web-01 ansible_host=192.0.2.10 ansible_user=root ansible_port=22
web-02 ansible_host=192.0.2.11
web-03 ansible_host=192.0.2.12 ansible_user=deploy ansible_port=2222 ansible_ssh_private_key_file=~/.ssh/id_ed25519 http_port=8080
[web:vars]
ntp=pool.ntp.org
[db]
db-01 ansible_host=198.51.100.5 ansible_port=22
[platform:children]
web
db
[platform:vars]
env=prod
vars, yaml and layout¶
Fields of ansible/group-vars.
Field |
Shape |
Written as |
|---|---|---|
|
JSON object |
One |
|
string |
Written as is, with leading and trailing whitespace trimmed. When non-empty, |
|
|
|
The path uses the group field, not the component name.
Example: group=db, vars={"pg_version":16,"pg_port":5432} writes group_vars/db.yml:
pg_port: 5432
pg_version: 16
plays¶
Field of ansible/playbook. A JSON array of play objects, written in order and separated by a blank line.
Key |
Type |
Default |
Written as |
|---|---|---|---|
|
string |
component name |
|
|
string |
|
|
|
boolean |
|
|
|
array of strings |
|
|
|
string of YAML tasks |
|
|
|
array of role entries |
|
|
|
string of YAML tasks |
|
Role entry:
Form |
Written as |
|---|---|
|
|
|
|
|
|
Example value, with component name data and folder=playbooks:
[
{"name": "Data tier", "hosts": "db", "become": false, "tags": ["data", "db"],
"roles": ["common", {"role": "postgres", "when": "inventory_hostname == groups[\"db\"][0]"}],
"pre_tasks": "- name: Wait\n ansible.builtin.wait_for_connection:\n",
"post_tasks": "- name: Done\n ansible.builtin.debug:\n msg: ok\n"},
{"hosts": "web", "roles": ["nginx"]}
]
Output, playbooks/data.yml:
- name: Data tier
hosts: db
tags: [data, db]
pre_tasks:
- name: Wait
ansible.builtin.wait_for_connection:
roles:
- common
- role: postgres
when: inventory_hostname == groups["db"][0]
post_tasks:
- name: Done
ansible.builtin.debug:
msg: ok
- name: data
hosts: web
become: true
roles:
- nginx
Legacy hosts and roles¶
Fields of ansible/playbook, used when plays is missing or empty. They produce one play named after the component, with become: true.
Field |
Shape |
|---|---|
|
string |
|
JSON array of role names |
Example: component name legacy, hosts=web, roles=["common","nginx"] writes legacy.yml:
- name: legacy
hosts: web
become: true
roles:
- common
- nginx
plays covers everything this form does, plus names, tags, role conditions and several plays per file. Prefer it for new playbooks.
playbooks¶
Field of ansible/site. A JSON array of objects, written in order.
Key |
Type |
Written as |
|---|---|---|
|
string |
|
|
string |
|
Example: [{"name":"Data","path":"playbooks/data.yml"},{"name":"Legacy","path":"legacy.yml"}] writes:
- name: Data
import_playbook: playbooks/data.yml
- name: Legacy
import_playbook: legacy.yml