How nishan-soni/k3s-zeroconf works
k3s-zeroconf is a small CLI for discovering local k3s agents and pairing them with a cluster. The main workflow starts an agent that advertises itself over mDNS and waits for a join request; an operator discovers and adds it, after which the agent hands off to k3s. The map includes firewall setup and shared pairing data. Edges are limited to relationships visible in the excerpts; no README was provided.
Main entry points: run.go Agent workflow · discover.go Discover and add · main.go k3z commands · server.go Pairing HTTP server
Components 12
CLI and orchestration
- k3z commands
cmd/main.go
Agent pairing
- Agent workflow
internal/agent/run.go - Pairing HTTP server
internal/agent/server.go - mDNS registration
internal/agent/mdns.go - k3s handoff
internal/agent/k3sagent.go
Discovery and joining
- Discover and add
internal/master/discover.go
Shared protocol
- Pairing data
internal/common/types.go - Network settings
internal/common/constants.go - Outbound IP helper
internal/common/utils.go
Other components
- Operator
- mDNS network
- k3s agent
Connections 18
- Operator → k3z commands: runs commands
cmd/main.go - k3z commands → Agent workflow: starts agent
cmd/main.go - k3z commands → Discover and add: discovers or adds
cmd/main.go - k3z commands → Outbound IP helper: gets address
cmd/main.go - Agent workflow → Pairing HTTP server: starts server
internal/agent/run.go - Agent workflow → mDNS registration: registers agent
internal/agent/run.go - Agent workflow → k3s handoff: hands off flags
internal/agent/run.go - Pairing HTTP server → Pairing data: decodes request
internal/agent/server.go - Pairing HTTP server → Agent workflow: sends join data
internal/agent/run.go - mDNS registration → mDNS network: advertises service
internal/agent/mdns.go - Discover and add → mDNS network: browses or looks up
internal/master/discover.go - Discover and add → Pairing HTTP server: posts join data
internal/master/discover.go - Discover and add → Pairing data: builds join data
internal/master/discover.go - k3s handoff → k3s agent: executes agent
internal/agent/k3sagent.go - mDNS registration → Outbound IP helper: gets address
internal/agent/mdns.go - Agent workflow → Network settings: uses port
- Discover and add → Network settings: uses service settings
internal/master/discover.go - k3s handoff → Network settings: opens configured ports
internal/agent/k3sagent.go