Skip to content
SHC Docs

The fabric and its policy

Containers on different nodes reach each other over the fabric: a WireGuard device named shc0 on every node. Each node takes /26 chunks of the fabric range, and every container is a routed /32 from its node’s chunks on a link of its own, whatever its tenant. shc cluster fabric status is this node’s view of it.

home01
$ shc cluster fabric status
MODE BLOCK CIDR LISTEN PORT GRANT PREFIX LOCAL NODE ID NODE SUBNET
shc 10.0.0.0/8 10.128.0.0/10 4243 20 node-58c0a3a3fbef 10.128.16.0/20
┌─ ranges ─────────────────────────────┐
│ NAME PREFIX │
│ deployment networks 10.64.0.0/10 │
│ fabric 10.128.0.0/10 │
│ mesh addresses 10.192.0.0/11 │
│ service VIPs 10.224.0.0/11 │
└──────────────────────────────────────┘
...

shc cluster fabric typed with no subcommand prints the same status:

explained, not walked: it prints what shc cluster fabric status printed above
$ shc cluster fabric

The first line is the address plan: the deployment networks, the fabric, the mesh and the VIPs each have a block. Under it the output names the device with its key and peers, each node’s chunks, and every pinned service address. A replica’s address on the fabric is its pin. Policy on the fabric is per deployment. Inside one deployment everything is open. Inside one tenant, another deployment reaches a service on the ports its compose file declares. Across tenants nothing is reached. shc cluster fabric explain judges one flow against the compiled policy and shows the rule that decided it:

home01
$ shc cluster fabric explain cloud:nextcloud hello:nginx --port 80
verdict ACCEPT
because same tenant, declared port: tenant prod -> prod/prod/hello nginx/tcp/80
from prod/prod/cloud/nextcloud 10.128.65.11 on node-75600ad6b4bd
to prod/prod/hello/nginx 10.128.65.5 on node-75600ad6b4bd
flow tcp/80
steps
...
kernel node-286506ff1608 sha256:3c58167d578e33f74050427c96edf2852fe5e6bb6d7efa67f06a1f30c934ff1c, in sync with the compiled ruleset

Without --port it lists what is open between the two ends:

home01
$ shc cluster fabric explain cloud:nextcloud hello:nginx
...

Port 80 is open because nginx declares it; nothing else is. --proto judges a UDP flow the same way; dns declares 53 over UDP:

home01
$ shc cluster fabric explain cloud:nextcloud dns:pdns --port 53 --proto udp
verdict ACCEPT
...
flow udp/53
...

The reach itself, from Nextcloud’s container:

home01
$ shc exec -s cloud -S nextcloud -- curl -s http://nginx.hello.prod.prod.shc.internal/
<!doctype html>
<title>hello again</title>
<p>Hello again from SHC.</p>

Now a second tenant. shc tenant add makes its tree and its Keycloak realm; --no-admin skips the admin user this page does not need, and prod stays the selected tenant. It needs a licence that includes tenancy, which shc license status lists among its features.

home01
$ shc tenant add other --no-admin
...

Give it one container with dig and curl in it. -t names the tenant on any command, and the --target-tenant and --target-environment of an explain name the far end’s. shc cluster fabric vips narrows to one tenant the same way, and --environment to one environment:

explained, not walked: prod is the only environment the tenants here use and the default, so the flag would change nothing
$ shc cluster fabric vips --tenant other --environment prod
~/learn/probe/compose.yaml
services:
net:
image: nicolaka/netshoot:v0.13
command: ["sleep", "infinity"]
home01
$ shc install ~/learn/probe -s probe -t other
installing deployment "probe"
[probe] Healthy 1/1
✔ net healthy
✔ installed deployment "probe"
$ shc ls -t other
STACK TENANT ENV APP STATUS NODE
probe other prod /root/learn/probe running far01
$ shc cluster fabric vips --tenant other
...
$ shc cluster fabric explain probe:net hello:nginx -t other --target-tenant prod --target-environment prod --port 80
verdict DROP
...

The policy drops it. From inside the container the refusal comes even earlier: the node’s DNS answers a container only the names of its own tenant, so prod’s services do not exist for it.

home01
$ shc exec -s probe -t other -S net -- dig +noall +comments nginx.hello.prod.prod.shc.internal
...

A routed hostname is a public name and resolves for everyone, but site’s route is LAN-only and the allowlist knows which tenant a container’s address belongs to. The other tenant is refused at the edge with 403. The same tenant is let through to the next middleware, the login gate, whose 401 asks for a session:

home01
$ shc exec -s probe -t other -S net -- curl -sk -o /dev/null -w '%{http_code}\n' --max-time 5 https://site.learn.test/
403
$ shc exec -s cloud -S nextcloud -- curl -sk -o /dev/null -w '%{http_code}\n' --max-time 5 https://site.learn.test/
200

Three doors, three refusals: the fabric drops the packet, the resolver withholds the name, and the edge rejects the address. A plug does not change this. It hands a consumer connection details, and a cross-tenant plug is refused at install. Remove the probe and the tenant.

home01
$ shc uninstall probe -t other -y
...
$ shc tenant rm other -y
...

other is gone. Keep web, hello, site, www, dns and the connection.

Next: The mesh under it all.