@gapi/gcli 1.8.249 → 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.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
@@ -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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gapi/gcli",
3
- "version": "1.8.249",
3
+ "version": "1.8.250",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/Stradivario/gapi.git"