Skip to content

feat(cloudshell): SSH bastion + k3s twin admin surface via cloudshell-fog - #50

Merged
mdheller merged 1 commit into
mainfrom
feat/cloudshell-fog-k3s-twin-surface
Aug 4, 2026
Merged

feat(cloudshell): SSH bastion + k3s twin admin surface via cloudshell-fog#50
mdheller merged 1 commit into
mainfrom
feat/cloudshell-fog-k3s-twin-surface

Conversation

@mdheller

@mdheller mdheller commented Aug 4, 2026

Copy link
Copy Markdown

Summary

TurtleTerm as first-class integration surface for cloudshell-fog — SSH bastion into the sovereign cloud shell with tunnel through to the k3s twin for cluster admin and DevSecOps.

Shell surface

Command Action
csh SSH into cloudshell-fog bastion (interactive, CMD+SHIFT+K)
ktunnel start Open k3s API tunnel: localhost:16443 → k3s-twin:6443
ktunnel stop / ktunnel status Stop or check tunnel
kproxy start SOCKS5 proxy on localhost:1080 via cloudshell for sovereign browsing
k3s get pods -n kube-system kubectl wired to k3s twin — warns if tunnel is down
csh-exec <cmd> Non-interactive remote command on cloudshell
csh-copy src dst scp wrapper with cloudshell host expansion
csh-status All-in-one status view

Config

~/.config/sourceos/cloudshell.yaml:

cloudshell:
  host: cloudshell.sourceos.io
  user: sourceos
  port: 22
  identity: ~/.ssh/id_ed25519_sourceos
k3s_twin:
  port: 6443
  tunnel_local_port: 16443
  kubeconfig: ~/.kube/config-k3s-twin

Or env vars: CLOUDSHELL_HOST, CLOUDSHELL_USER, CLOUDSHELL_PORT, CLOUDSHELL_KEY, CLOUDSHELL_K3S_TUNNEL_PORT, CLOUDSHELL_K3S_KUBECONFIG.

Mesh dashboard

New k3s badge in the status bar: green when k3s-tunnel.pid process is alive, red otherwise. Consistent with Noetica and SearXNG liveness tiles.

Memory mesh integration

  • csh (connect) → emits cloudshell-connect event
  • ktunnel start → emits k3s-tunnel-start event

Test plan

  • csh-status — shows config + tunnel/proxy state
  • csh — interactive SSH session opens to cloudshell-fog
  • ktunnel start → k3s badge in dashboard turns green
  • k3s get nodes — hits k3s twin via tunnel
  • k3s get pods without tunnel → warning printed
  • ktunnel stop → badge turns red
  • kproxy start → curl via SOCKS5 works
  • csh-exec "hostname" — returns cloudshell hostname

…-fog

turtle-ssh-tunnel (new, 419 lines):
- Reads ~/.config/sourceos/cloudshell.yaml (or env vars: CLOUDSHELL_HOST/USER/PORT/KEY)
- connect: os.execvp ssh → replaces process (true interactive session)
- tunnel [start|stop|status]: ssh -N -L {16443}:{k3s-host}:{6443} in background;
  PID → ~/.local/state/sourceos/k3s-tunnel.pid
- proxy [start|stop|status]: SOCKS5 on localhost:1080 via cloudshell-fog;
  PID → cloudshell-proxy.pid
- exec <cmd>: non-interactive remote command
- copy <src> <dst>: scp wrapper with cloudshell host expansion
- Emits mesh events on connect + tunnel-start

turtle-shell-init.zsh:
- csh → SSH into cloudshell-fog bastion (interactive)
- ktunnel [start|stop|status] → k3s API tunnel through bastion
- kproxy [start|stop|status] → SOCKS5 proxy through cloudshell
- k3s <args> → kubectl with KUBECONFIG=~/.kube/config-k3s-twin;
  warns when tunnel PID is dead
- csh-exec / csh-copy / csh-status convenience wrappers

turtleterm.lua:
- CMD+SHIFT+K → csh (CloudShell SSH)
- Palette: cloudshell_ssh / k3s_tunnel / cloudshell_status

turtle-mesh-serve:
- _k3s_tunnel_alive(): reads k3s-tunnel.pid, sends kill -0 to check liveness
- gather_state(): k3s_tunnel_up bool in returned dict
- Dashboard status bar: k3s badge (green=tunnel up / red=down)
@mdheller
mdheller force-pushed the feat/cloudshell-fog-k3s-twin-surface branch from 20cebfe to 84e61fb Compare August 4, 2026 07:55
@mdheller
mdheller merged commit b6ae388 into main Aug 4, 2026
@mdheller
mdheller deleted the feat/cloudshell-fog-k3s-twin-surface branch August 4, 2026 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant