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.
$ shc cluster fabric statusMODE BLOCK CIDR LISTEN PORT GRANT PREFIX LOCAL NODE ID NODE SUBNETshc 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:
$ shc cluster fabricThe 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:
$ shc cluster fabric explain cloud:nextcloud hello:nginx --port 80verdict ACCEPTbecause same tenant, declared port: tenant prod -> prod/prod/hello nginx/tcp/80from prod/prod/cloud/nextcloud 10.128.65.11 on node-75600ad6b4bdto prod/prod/hello/nginx 10.128.65.5 on node-75600ad6b4bdflow tcp/80steps...kernel node-286506ff1608 sha256:3c58167d578e33f74050427c96edf2852fe5e6bb6d7efa67f06a1f30c934ff1c, in sync with the compiled rulesetWithout --port it lists what is open between the two ends:
$ 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:
$ shc cluster fabric explain cloud:nextcloud dns:pdns --port 53 --proto udpverdict ACCEPT...flow udp/53...The reach itself, from Nextcloud’s container:
$ 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.
$ 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:
$ shc cluster fabric vips --tenant other --environment prodservices: net: image: nicolaka/netshoot:v0.13 command: ["sleep", "infinity"]$ shc install ~/learn/probe -s probe -t otherinstalling deployment "probe"[probe] Healthy 1/1✔ net healthy✔ installed deployment "probe"$ shc ls -t otherSTACK TENANT ENV APP STATUS NODEprobe 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 80verdict 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.
$ 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:
$ 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/200Three 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.
$ 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.