Skip to main content

Environment Config File

Instead of passing every flag on the command line, you can supply environment creation options through a YAML config file. Overlock supports both a single explicit config file and layered automatic discovery.


File Discovery (Layered Loading)

When no --config flag is provided, Overlock automatically looks for config files in the current directory and merges them in the following order (later files override earlier ones):

  1. overlock.yaml
  2. .overlock.yaml
  3. .overlock.*.yaml — any files matching this glob, loaded in alphabetical order (e.g. .overlock.dev.yaml, .overlock.ci.yaml)

This layered approach lets you keep a base config in overlock.yaml and override specific values per environment or context in additional files.

Explicit Config File

To use a specific file, pass the --config flag:

overlock env create my-env --config ./my-config.yaml

If the file is not found at the given path, Overlock exits with an error. If the file exists but cannot be parsed, Overlock logs a message and points you to this page.


File Format

The config file is a YAML document. All fields are optional — only set the ones you want to override.

name: my-env
engine: kind
http_port: 80
https_port: 443
context: ""
engine_config: ""
mount: []
providers: []
configurations: []
functions: []
create_admin_service_account: false
admin_service_account_name: ""
cpu: ""
max_reconcile_rate: 1
nodes: []

Field Reference

FieldTypeDefaultDescription
namestringEnvironment name. Used when overlock env create is run without the <name> positional argument. If both are given, the CLI argument wins.
enginestringkindKubernetes engine to use: kind, k3s, k3d, k3s-docker
http_portint80Host port to map for HTTP traffic
https_portint443Host port to map for HTTPS traffic
contextstringKubernetes context name to create or use
engine_configstringPath to an engine-specific config file (e.g. a KinD config YAML)
mountlist of stringsBind mounts in host:container format, e.g. /data:/storage
providerslist of stringsProviders to install at creation time
configurationslist of stringsConfigurations to install at creation time
functionslist of stringsFunctions to install at creation time
create_admin_service_accountboolfalseCreate a cluster-admin service account
admin_service_account_namestringoverlock-adminName for the admin service account
cpustringCPU limit for k3s-docker container nodes (e.g. 2, 0.5, 50%)
max_reconcile_rateint1Max concurrent reconciliations for Crossplane
nodeslist of node objectsNodes to create after the environment is up. Only supported for the k3s-docker engine.

Each entry in nodes accepts the same parameters as overlock env node create:

Node FieldTypeDefaultDescription
namestringName of the node (required)
hoststringRemote host to create the node on via SSH. Omit for a local node.
userstringrootSSH user for the remote host
portint22SSH port for the remote host
keystring~/.ssh/id_rsaPath to the SSH private key
scopeslist of stringsNode scopes, e.g. engine, workloads
taintslist of stringsNode taints in key:value format, e.g. dedicated:gpu
cpustringCPU limit for the node container (e.g. 2, 0.5, 50%)
mountlist of stringsBind mounts in host:container format. Local nodes only.

Examples

Minimal config

engine: k3s-docker
max_reconcile_rate: 5

Naming the environment in the config file

name: my-env
engine: k3s-docker

With name set, overlock env create can be run without the positional argument:

overlock env create

Pre-installing packages

engine: kind
configurations:
- xpkg.upbound.io/devops-toolkit/dot-application:v3.0.31
providers:
- xpkg.upbound.io/crossplane-contrib/provider-helm:v0.19.0

Declaring nodes

Bring up the control plane and its nodes in one overlock env create call:

engine: k3s-docker
nodes:
- name: worker-1
host: 10.0.0.5
user: root
key: ~/.ssh/id_rsa
scopes: [engine, workloads]
taints: [dedicated:gpu]
- name: local-1
scopes: [workloads]

Nodes are created in list order, after the environment itself is up — equivalent to running overlock env node create once per entry. Node creation is only supported for the k3s-docker engine.

Layered config workflow

Keep a base file checked into your project:

# overlock.yaml
engine: kind
max_reconcile_rate: 1

Add a local override that you .gitignore:

# .overlock.local.yaml
max_reconcile_rate: 10
http_port: 8080
https_port: 8443

Overlock merges both files, with .overlock.local.yaml taking precedence.