@gapi/gcli 1.8.248 → 1.8.250

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README-CLI.md CHANGED
@@ -33,7 +33,7 @@ Commands:
33
33
  mq-trigger:create [options] Run a lambda for every message on a RabbitMQ queue
34
34
  mq-trigger:update [options] Change a message-queue trigger (same flags as create)
35
35
  mq-trigger:delete [options] Delete a message-queue trigger
36
- cluster:create [options] Provision a private Talos cluster for a project (runs in the background - takes several minutes; use --wait to block)
36
+ cluster:create [options] Provision a private Talos cluster, or with --virtual a virtual cluster, for a project (runs in the background; use --wait to block)
37
37
  cluster:apply [options] Make a private cluster match the `cluster:` section of lambforge.yaml: creates it if missing, then applies topology, workers, control planes, load balancer and autoscaling
38
38
  cluster:list [options] List every private cluster this project has (it may have several - dev/stage/prod, ...)
39
39
  cluster:teardown [options] Tear down one of a project's clusters (runs in the background - use --wait to block)
@@ -47,7 +47,7 @@ Commands:
47
47
  cluster:autoscale [options] Change the worker autoscaling policy - only the flags you pass change
48
48
  cluster:multi-node [options] Convert a single-node cluster to dedicated worker nodes (required for autoscaling)
49
49
  cluster:single-node [options] Convert a multi-node cluster back to a single node (removes the worker nodes)
50
- cluster:load-balancer [options] Add or remove the cluster's load balancer (billed per hour while enabled)
50
+ cluster:load-balancer [options] Add or remove the cluster's load balancer (billed per hour while enabled). On a virtual cluster this is its dedicated LB - its own IP; the platform subdomain keeps working either way
51
51
  rabbitmq:create [options] Provision a RabbitMQ broker for a project (a project may have several)
52
52
  rabbitmq:list [options] List every RabbitMQ broker for a project
53
53
  rabbitmq:delete [options] Delete a RabbitMQ broker
@@ -594,7 +594,7 @@ Options:
594
594
  --- Subcommand: cluster:create ---
595
595
  Usage: gcli cluster:create [options]
596
596
 
597
- Provision a private Talos cluster for a project (runs in the background - takes several minutes; use --wait to block)
597
+ Provision a private Talos cluster, or with --virtual a virtual cluster, for a project (runs in the background; use --wait to block)
598
598
 
599
599
  Options:
600
600
  -p, --project <project>
@@ -605,6 +605,14 @@ Options:
605
605
  -l, --location <location>
606
606
  --workers <workers> Worker count (ignored when --singleNode)
607
607
  --singleNode Control plane carries the workload too
608
+ --virtual A virtual cluster (own Kubernetes API + Fission,
609
+ no servers, ~2 minutes) instead of a private Talos
610
+ cluster
611
+ --host <host> With --virtual: name of a private cluster of this
612
+ project to run on (default: the shared cluster)
613
+ --dedicated-lb With --virtual: give its router its own load
614
+ balancer IP (billed per hour); without it lambdas
615
+ are served on the platform subdomain
608
616
  --wait Block until the cluster is ready (or errors)
609
617
  -h, --help display help for command
610
618
  
@@ -770,7 +778,7 @@ Options:
770
778
  --- Subcommand: cluster:load-balancer ---
771
779
  Usage: gcli cluster:load-balancer [options]
772
780
 
773
- Add or remove the cluster's load balancer (billed per hour while enabled)
781
+ Add or remove the cluster's load balancer (billed per hour while enabled). On a virtual cluster this is its dedicated LB - its own IP; the platform subdomain keeps working either way
774
782
 
775
783
  Options:
776
784
  -p, --project <project>
package/README.md CHANGED
@@ -57,7 +57,7 @@ Create the token in the dashboard (Project → CI/CD) with only the permissions
57
57
  | RabbitMQ: read / install / uninstall | `rabbitmq:list`, `rabbitmq:create`, `rabbitmq:delete` |
58
58
  | Queue triggers: read / manage | `mq-trigger:list`, `mq-trigger:create/update/delete` |
59
59
  | Plugins: read / install | `plugin:list/installed`, `plugin:install/uninstall` |
60
- | Clusters: read / scale / create / tear down / kubeconfig | `cluster:list/status/health/scale-events/cost`, `cluster:scale/autoscale/multi-node/single-node/load-balancer/apply`, `cluster:create/apply`, `cluster:teardown`, `cluster:kubeconfig` |
60
+ | Clusters: read / scale / create / tear down / kubeconfig | `cluster:list/status/health/scale-events/cost`, `cluster:scale/autoscale/multi-node/single-node/load-balancer/apply`, `cluster:create/apply`, `cluster:teardown`, `cluster:kubeconfig`, `cluster:attach/nodes/pause/resume/detach` (your own machines, admin) |
61
61
 
62
62
  A token can also be limited to some lambdas (lambda, schedule and queue-trigger commands). Typical tokens: *Deploy only* (`lambda:update`), or *DevOps (clusters)* for an infra repo that runs `gcli cluster:apply`. A command the token may not run fails with `ci-token-missing-scope: <operation> needs <permission>`. `runner:*` and `project:list` are personal and not available to CI tokens.
63
63
 
@@ -150,6 +150,12 @@ gcli cluster:health --cluster '<clusterId>' # latest agent report, per no
150
150
  gcli cluster:scale-events --cluster '<clusterId>' # manual + autoscaler history
151
151
  gcli cluster:cost # month-to-date + monthly estimate
152
152
 
153
+ # Attach a machine you own (booted from the Talos ISO, on this network) as an
154
+ # extra worker - its install disk is WIPED (feature self-managed-nodes, admin)
155
+ gcli cluster:attach --cluster '<clusterId>' --node-ip 192.168.1.50 --name home-1 --disk /dev/nvme0n1 [--pool home] [--reserved]
156
+ gcli cluster:nodes --cluster '<clusterId>'
157
+ gcli cluster:detach --cluster '<clusterId>' --name home-1
158
+
153
159
  # Worker nodes (1-10, billed per node-hour) and control planes (1, 3 or 5)
154
160
  gcli cluster:scale --cluster '<clusterId>' --workers 3 --wait
155
161
  gcli cluster:scale:control-planes --cluster '<clusterId>' --count 3 --wait
@@ -217,12 +223,22 @@ A virtual cluster has its own Kubernetes API and Fission but no servers: it
217
223
  runs in one namespace of the shared Lambforge cluster, or of one of your
218
224
  private clusters, and is ready in about two minutes. Everything else
219
225
  (environments, lambdas, `--clusterName`, `cluster:kubeconfig`,
220
- `cluster:teardown`) works the same as for a private cluster; scaling and
221
- load balancer commands don't apply.
226
+ `cluster:teardown`) works the same as for a private cluster; scaling
227
+ commands don't apply.
228
+
229
+ Its lambdas are served on a platform subdomain (`https://vc-<id>.lambforge.com`,
230
+ shown in the `router` column of `cluster:list`) at no extra cost. A
231
+ **dedicated load balancer** gives its router an IP of its own, billed per
232
+ started hour like any load balancer; the subdomain keeps working.
233
+ `cluster:kubeconfig` gives you admin access through
234
+ `https://k-<id>.lambforge.com` (the `api` column).
222
235
 
223
236
  ```bash
224
237
  gcli cluster:create --virtual --name dev # on the shared cluster
225
238
  gcli cluster:create --virtual --name stage --host prod # on your private cluster "prod"
239
+ gcli cluster:create --virtual --name demo --dedicated-lb # with its own IP
240
+ gcli cluster:load-balancer --cluster <id> --enable # add the dedicated LB later
241
+ gcli cluster:load-balancer --cluster <id> --disable # release it (subdomain stays)
226
242
  ```
227
243
 
228
244
  ```yaml
@@ -230,8 +246,13 @@ cluster:
230
246
  name: dev
231
247
  provider: vcluster
232
248
  host: prod # optional - omitted = the shared cluster
249
+ loadBalancer: true # optional - dedicated LB; cluster:apply adds/removes it
233
250
  ```
234
251
 
252
+ `cluster:apply` creates the virtual cluster (with the load balancer if set)
253
+ and later adds or removes the dedicated load balancer when `loadBalancer`
254
+ changes; removing it is skipped unless you pass `--yes`.
255
+
235
256
  ### RabbitMQ Brokers
236
257
 
237
258
  A project may have several RabbitMQ brokers, each optionally scoped to one of its private clusters.
@@ -0,0 +1,23 @@
1
+ ## 2026-10-28 - virtual-clusters: cluster:create --dedicated-lb, loadBalancer for virtual clusters, cluster:list URLs
2
+
3
+ **Feature:** virtual-clusters · **Type:** feat
4
+
5
+ - `cluster:create --virtual --dedicated-lb` -> provisionProjectVirtualCluster
6
+ `dedicatedLoadBalancer`; `lambforge.yaml` `loadBalancer: true` on a
7
+ `provider: vcluster` cluster is now accepted (no longer in
8
+ VIRTUAL_UNSUPPORTED): created with it, later added/removed by
9
+ `cluster:apply` (removal = destructive, `--yes`).
10
+ - `cluster:load-balancer` help explains the virtual case (dedicated LB, the
11
+ subdomain stays) - the backend already handles vClusters.
12
+ - `cluster:list`: type, router (lambda URL), api, loadBalancer columns;
13
+ `ClusterFragment` + `routerUrl withLoadBalancer loadBalancerIp`.
14
+ - README virtual-clusters section, README-CLI regenerated (it was also
15
+ missing --virtual/--host), public docs gcli page + What's new.
16
+ - **Test:** `npx jest --coverage=false test/cluster-apply` (plan: create
17
+ with LB in one step, add, destructive remove; command: spec ->
18
+ `dedicatedLoadBalancer: true`).
19
+ - **Debug:** `gcli cluster:apply --dry-run` prints the planned LB step;
20
+ `cluster:list` shows `loadBalancer` pending while the re-apply runs.
21
+ - **Verification:** 119/119 tests, tsc clean, eslint clean; built CLI shows
22
+ `--dedicated-lb` in `cluster:create --help`. Not run against a live
23
+ server (gcli is logged into production).
@@ -0,0 +1,30 @@
1
+ ## 2026-10-30 - self-managed-nodes: cluster:attach probes the machine with talosctl get version (maintenance mode refuses talosctl version)
2
+
3
+ **Feature:** self-managed-nodes · **Type:** feat
4
+
5
+ - **`cluster:attach` / `cluster:nodes` / `cluster:detach`** (built 2026-10-29,
6
+ first recorded here): attach your own machine to a Talos cluster.
7
+ `src/commands/cluster/attach.ts`, `nodes.ts`, `detach.ts`,
8
+ `helpers/attach.ts`.
9
+ - **Fix:** the machine probe now runs
10
+ `talosctl -n <ip> get version --insecure -o yaml` and reads `spec.version`.
11
+ It used `talosctl version --insecure`, which a machine in maintenance mode
12
+ refuses ("API is not implemented in maintenance mode"), so attach always
13
+ failed with "No Talos installer answers".
14
+ - **`--disk` is now required** (checked after the disk list is shown):
15
+ without it Talos used the disk in the cluster's worker.yaml, a Hetzner
16
+ `/dev/sda`, which on the first real machine was the boot USB stick.
17
+ - **`cluster:nodes` lists every node** (Hetzner control planes + workers and
18
+ attached machines, columns node / role / source / status ...), like the
19
+ dashboard's Nodes card. New **`cluster:pause` / `cluster:resume --name`**
20
+ (`pause.ts`, `setClusterNodePaused`).
21
+ - **Reset hint fixed:** it said `talosctl reset --insecure`, which a joined
22
+ machine refuses, and a plain reset wipes the boot loader too (it left the
23
+ first real machine unbootable). It now wipes only STATE + EPHEMERAL with the
24
+ cluster's talosconfig.
25
+ - **Test:** `npx jest test/cluster-attach --coverage=false`.
26
+ - **Debug:** run the probe by hand against the machine's LAN IP; see
27
+ `docs/features/self-managed-nodes.md`.
28
+ - **Verification:** live on cluster 6ae44580678d8012d02aee58: `cluster:nodes` listed the control plane (94.130.96.226) and home-1; pause showed `ready, paused`, resume cleared it; pausing the control plane was refused. Full gcli suite 123/123. Earlier: 4/4 specs pass, tsc + eslint clean, build ok. The new
29
+ probe was run against a real machine in maintenance mode (Talos v1.12.7)
30
+ and its output parses to `v1.12.7`; `get disks --insecure` also answers.
@@ -37,3 +37,4 @@ Outline (drop sections that don't apply):
37
37
  | `ci-token-scopes` | [ci-token-scopes.md](ci-token-scopes.md) | Which permission each command needs; `mq-trigger:*` commands; canonical doc in graphql-server |
38
38
  | `workflows` | [workflows.md](workflows.md) | `workflow:*` commands incl. AI drafts (`workflow:generate`); canonical doc in graphql-server-lambdas |
39
39
  | `virtual-clusters` | [virtual-clusters.md](virtual-clusters.md) | cluster:create --virtual, provider: vcluster (slice; canonical in graphql-server-functions) |
40
+ | `self-managed-nodes` | [self-managed-nodes.md](self-managed-nodes.md) | `cluster:attach/nodes/detach` - your own machine as a Talos worker (slice; canonical in graphql-server-functions) |
@@ -0,0 +1,44 @@
1
+ # Self-managed nodes - gcli slice
2
+
3
+ **Status:** built 2026-10-29, uncommitted, ADMIN only. Feature slug
4
+ `self-managed-nodes`. Canonical doc: graphql-server-functions
5
+ `docs/features/self-managed-nodes.md`; design and later phases: graphql-server
6
+ `docs/plans/14-self-managed-nodes.md`.
7
+
8
+ A machine you own, booted from the Talos ISO, joins one of the platform's
9
+ Talos clusters as an extra worker over KubeSpan.
10
+
11
+ ## Commands
12
+
13
+ | Command | What it does |
14
+ |---|---|
15
+ | `cluster:attach --cluster <id> --node-ip <lan-ip> --name home-1 --disk /dev/x [--pool p] [--reserved] [--yes] [--no-wait] [--timeout m]` | Probes the machine, shows its disks, refuses to go on without `--disk` (the cluster default is a Hetzner `/dev/sda`, often the boot USB stick at home), asks before the wipe, gets the join config (`clusterNodeJoinConfig`), applies it with `talosctl apply-config --insecure` from a 0600 temp file, waits until `ready` |
16
+ | `cluster:nodes --cluster <id>` | Every node: Hetzner control planes + workers and attached machines, with role, source (hetzner / own), status (`, paused` when cordoned) - the dashboard's Nodes card list |
17
+ | `cluster:pause` / `cluster:resume --cluster <id> --name home-1` | Cordon / uncordon an attached machine: paused, nothing new runs there and running work stays. Hetzner nodes are refused |
18
+ | `cluster:detach --cluster <id> --name home-1` | Drain + remove (Hetzner nodes are refused server-side); prints the reset command |
19
+
20
+ `--cluster` is the cluster's Mongo id; `--project <p> --clusterName <name>`
21
+ works instead.
22
+
23
+ ## Files
24
+
25
+ - `src/commands/cluster/attach.ts`, `nodes.ts`, `pause.ts` (`pause` / `resume`), `detach.ts`; pure helpers in
26
+ `helpers/attach.ts` (`parseAttachOptions`, `serverTalosVersion`,
27
+ `nodeRow`, `resetHint`); registration in `src/commands/cluster/index.ts`.
28
+ - Client: `clusterAttachInfo`, `clusterNodeJoinConfig`, `clusterNodes`,
29
+ `detachClusterNode`, `setClusterNodePaused` in `src/services/gql-client.ts`. `clusterNodes(id, includeCloud)`: `cluster:nodes` passes `true`, the attach wait loop `false`.
30
+ - **Reset hint** (after detach / a failed join): `talosctl --talosconfig <cluster talosconfig> -n <ip> -e <ip> reset --graceful=false --reboot --system-labels-to-wipe STATE --system-labels-to-wipe EPHEMERAL`. A joined machine refuses `--insecure`, and a plain reset also wipes the boot loader.
31
+
32
+ ## Test
33
+
34
+ `npx jest test/cluster-attach --coverage=false`. Manual: boot a machine from
35
+ the ISO, run `cluster:attach` from the same LAN.
36
+
37
+ ## Debug
38
+
39
+ - **"No Talos installer answers"**: gcli runs
40
+ `talosctl -n <ip> get version --insecure -o yaml` (12 x 5 s). Run it by
41
+ hand. `talosctl version --insecure` is NOT usable: maintenance mode
42
+ answers it with "API is not implemented in maintenance mode" (seen on the
43
+ machine console as `Unimplemented [/machine.MachineService/Version]`).
44
+ - Needs `talosctl` on PATH and the machine on port 50000 of the same network.
@@ -1,6 +1,6 @@
1
1
  # Virtual clusters (slice)
2
2
 
3
- **Status:** built and tested end to end on minikube 2026-10-28, not deployed. Feature slug `virtual-clusters`.
3
+ **Status:** in production since 2026-10-28 (shared cluster host, subdomain routing, dedicated LB add-on, token kubeconfig). Feature slug `virtual-clusters`.
4
4
  Canonical doc (how it works, test, debug, limits):
5
5
  [`graphql-server-functions/docs/features/virtual-clusters.md`](../../../../../graphql-server-functions/docs/features/virtual-clusters.md).
6
6
 
@@ -9,4 +9,18 @@ cluster or one of the project's private clusters, `provider: 'vcluster'`.
9
9
 
10
10
  ## This repo
11
11
 
12
- `gcli cluster:create --virtual [--host <private-cluster>]`; in `lambforge.yaml`: `cluster: { name: dev, provider: vcluster, host: prod }` for `cluster:create` / `cluster:apply` (no host = shared cluster; node settings are rejected). Code: `src/commands/cluster/helpers/virtual-cluster.ts`, `helpers/plan.ts`. Test: `npx jest --coverage=false test/cluster-apply`.
12
+ - `gcli cluster:create --virtual [--host <private-cluster>] [--dedicated-lb]`;
13
+ in `lambforge.yaml`: `cluster: { name: dev, provider: vcluster, host: prod,
14
+ loadBalancer: true }` for `cluster:create` / `cluster:apply` (no host =
15
+ shared cluster; node settings are rejected).
16
+ - `loadBalancer` on a virtual cluster = its **dedicated** LB (own IP,
17
+ billed). `cluster:apply` creates with it in one step, later adds/removes it
18
+ (removal is destructive -> needs `--yes`); `cluster:load-balancer
19
+ --enable|--disable` does the same by hand (the backend routes
20
+ enable/disableLoadBalancerProjectCluster to the vCluster re-apply).
21
+ - `cluster:list` columns: `type`, `router` (lambda base URL, the
22
+ `vc-<id>` subdomain), `api` (endpoint - `k-<id>` for vClusters on the
23
+ shared host), `loadBalancer` (IP / pending / off). `ClusterFragment`
24
+ selects `routerUrl withLoadBalancer loadBalancerIp`.
25
+ - Code: `src/commands/cluster/helpers/virtual-cluster.ts`, `helpers/plan.ts`,
26
+ `create.ts`, `apply.ts`, `list.ts`. Test: `npx jest --coverage=false test/cluster-apply`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gapi/gcli",
3
- "version": "1.8.248",
3
+ "version": "1.8.250",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/Stradivario/gapi.git"