cocoon-net

Installation

Prebuilt binary

VER=$(curl -sI https://github.com/cocoonstack/cocoon-net/releases/latest | awk -F'/v' 'tolower($0) ~ /^location:/ {print $NF}' | tr -d '\r')
curl -sL "https://github.com/cocoonstack/cocoon-net/releases/download/v${VER}/cocoon-net_${VER}_Linux_x86_64.tar.gz" | tar xz
sudo install -m 0755 cocoon-net /usr/local/bin/

Build from source

git clone https://github.com/cocoonstack/cocoon-net.git
cd cocoon-net
make build

Usage

cocoon-net runs in two phases: a one-time provisioning command, then a long-lived daemon. See Architecture for how they fit together.

# 1. provision cloud networking (or `adopt` an already-provisioned node)
sudo cocoon-net init \
  --platform gke \
  --node-name cocoon-pool \
  --subnet 172.20.100.0/24 \
  --pool-size 140

# 2. run the DHCP server + node networking as a daemon
sudo cocoon-net daemon

# inspect pool state
cocoon-net status

# remove cloud networking resources (also deletes pool.json + leases.json)
sudo cocoon-net teardown

Platform-specific init/adopt walkthroughs, prerequisites, and troubleshooting live in GKE and Volcengine. Every flag and environment variable is documented in Configuration.

adopt – bring an existing node under management

For nodes whose cloud networking was already provisioned by hand:

sudo cocoon-net adopt \
  --platform gke \
  --node-name cocoon-pool \
  --subnet 172.20.0.0/24

Systemd unit

[Unit]
Description=cocoon-net VPC networking daemon
After=network-online.target
Wants=network-online.target

[Service]
ExecStart=/usr/local/bin/cocoon-net daemon
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target

Building from source and running tests: see Development in the README.