rig major updates
This commit is contained in:
@@ -7,7 +7,8 @@ The ecosystem convention is that scripts are standalone with no shared log libra
|
||||
```
|
||||
built-in defaults in load_config; fill only what nothing else set
|
||||
ctrl/versions.env pinned toolchain + image digests (committed)
|
||||
ctrl/env.d/<profile> addons, registry (OPTIONAL, examples ship as *.env.example)
|
||||
ctrl/env.d/<profile> how this machine reaches the world (OPTIONAL, examples ship as *.env.example)
|
||||
<overlay>/rig.env what runs: addons, namespaces, images (OPTIONAL, lives with the overlay)
|
||||
ctrl/.env machine-local values and secrets (gitignored)
|
||||
the caller's env `make cluster up PROFILE=<name>` (always wins)
|
||||
```
|
||||
@@ -20,11 +21,15 @@ Run from ctrl/.
|
||||
|
||||
Values a user can reasonably override per-invocation. Anything set in the environment when load_config runs is restored after the files are read. NODES is deliberately NOT here: it is read back out of the kind config, so the file is the one place that decides it.
|
||||
|
||||
REGISTRY_PORT and MANIFESTS_DIR were missing here while ctrl/.env set them, so the caller's env silently LOST to the file for those two, breaking the one precedence rule the header states. Both are now listed; the other twelve are unchanged.
|
||||
REGISTRY_PORT and MANIFESTS_DIR were missing here while ctrl/.env set them, so the caller's env silently LOST to the file for those two, breaking the one precedence rule the header states. Both are now listed. OVERLAY joined with overlays, for the same reason: it is chosen per machine or per call.
|
||||
|
||||
## default_cluster_name
|
||||
|
||||
The containing folder's name, reduced to something kind accepts as a cluster name (a DNS label: lowercase alphanumerics and dashes). Run from ctrl/, so the repo root is the parent.
|
||||
The environment's folder name — the overlay's when one is named, else rig's own — reduced to something kind accepts as a cluster name (a DNS label: lowercase alphanumerics and dashes). Run from ctrl/, so rig's folder is the parent.
|
||||
|
||||
## _from_ctrl, _abs_from_ctrl
|
||||
|
||||
Paths in the config are relative to rig's folder (MANIFESTS_DIR, OVERLAY) or to ctrl/ (KIND_CONFIG), or absolute. Scripts run from ctrl/, so `_from_ctrl` turns a rig-relative path into one usable from there, and `_abs_from_ctrl` into an absolute one for consumers outside bash (ports.sh active, the kind config's hostPath entries).
|
||||
|
||||
## derive_port_base
|
||||
|
||||
@@ -38,9 +43,15 @@ RIG_PORTABLE skips the machine-local layer. config_snapshot sets it, so a genera
|
||||
|
||||
A profile is an optional overlay, never a prerequisite. rig assumes no configuration: with no profile named, or no env.d/ at all, it runs on the built-in defaults. What IS an error is naming a profile that does not exist, because a typo must not quietly fall back to something else.
|
||||
|
||||
## load_config: overlays
|
||||
|
||||
An overlay is one folder, outside rig's version control, that holds what runs ([overlay.md](overlay.md)). `OVERLAY` names it; a named overlay that does not exist is an error, like a named profile. With none named, rig's own `examples/starter` is used if it is present — it sets nothing, so a plain rig resolves as it did before overlays — and a rig copied without `examples/` still resolves, with no manifests.
|
||||
|
||||
Its `rig.env` is layered after the profile and before ctrl/.env. It may not set PROFILE or OVERLAY, which are chosen before it loads, and the paths it sets are relative to the overlay (load_config rewrites them as it loads the file), so an overlay can be moved without editing it.
|
||||
|
||||
## load_config: identity follows the folder
|
||||
|
||||
Identity follows the FOLDER, so copying this directory somewhere else and renaming it yields a distinct environment with no further edits. Without this, two copies would share one cluster and `make cluster down` in either would destroy the other's.
|
||||
Identity follows the FOLDER — the overlay's when one is named, else rig's — so copying either somewhere else and renaming it yields a distinct environment with no further edits. Without this, two copies would share one cluster and `make cluster down` in either would destroy the other's. It is also what lets a project carry rig at `<project>/rig/` without every such project's cluster being called `rig`.
|
||||
|
||||
## load_config: host ports
|
||||
|
||||
@@ -48,7 +59,7 @@ Host ports are a single shared namespace, so unlike the cluster name they cannot
|
||||
|
||||
## load_config: MANIFESTS_DIR
|
||||
|
||||
Where the workload's manifests live, repo-root relative. Defaulted here so it is always resolved rather than sometimes-set: it is the seam that lets the real manifests be versioned away from the installer, and a consumer should not have to know whether anyone filled it in. See k8s/README.md.
|
||||
Where the workload's manifests live, relative to rig's folder or absolute: the overlay's `k8s/overlays/dev` unless something names another. It is the seam that lets the real manifests be versioned away from the installer. `none` means rig applies none (the overlay's Tiltfile does). A named folder that does not exist is an error; the old default `ctrl/k8s/overlays/dev`, pinned by older .env files, is ignored while that folder does not exist and reported by `make check`.
|
||||
|
||||
## load_config: NODE_MB
|
||||
|
||||
@@ -60,7 +71,7 @@ It is set here rather than in check.sh because the memory tool and every standal
|
||||
|
||||
Renders the kind config to stdout. sed rather than envsubst: envsubst is gettext-base, absent from a minimal Debian, and Docker is meant to be the only prerequisite. The variable list is explicit so a template cannot quietly start depending on something the caller does not set.
|
||||
|
||||
hostPath entries are resolved by the HOST dockerd, so HOST_WORKDIR must stay a host path even when this runs inside the installer container.
|
||||
hostPath entries are resolved by the HOST dockerd, so HOST_WORKDIR and OVERLAY_DIR must stay host paths even when this runs inside the installer container. `${OVERLAY_DIR}` renders to the overlay's absolute path, for mounting its folders into the nodes.
|
||||
|
||||
## What a standalone kit needs to know
|
||||
|
||||
|
||||
Reference in New Issue
Block a user