diff --git a/README.md b/README.md index 6907480..183bea7 100644 --- a/README.md +++ b/README.md @@ -45,14 +45,171 @@ The plugin uses a CNI configuration file (`10-mycelium.conflist`) that specifies 2. **DEL Operation**: Cleans up the host-side veth interface when containers are destroyed. -## Testing +## Usage with Kubernetes + +### 1. Setup Mycelium on all nodes + +First, install Mycelium on all Kubernetes nodes: -Start Mycelium daemon first: ```bash -sudo mycelium --peers tcp://188.40.132.242:9651 tcp://136.243.47.186:9651 +# Download and install Mycelium +MYCELIUM_VERSION="v0.5.6" +wget https://github.com/threefoldtech/mycelium/releases/download/${MYCELIUM_VERSION}/mycelium-x86_64-unknown-linux-musl.tar.gz +tar xf mycelium-x86_64-unknown-linux-musl.tar.gz +sudo cp mycelium /usr/local/bin/ + +# Create systemd service +sudo tee /etc/systemd/system/mycelium.service > /dev/null < -- ping6 -c 3 +``` + +## Testing + +### Manual CNI Testing + +You can test the plugin directly using CNI testing tools: + +```bash +# Install CNI plugins for testing +go install github.com/containernetworking/cni/cnitool@latest + +# Set environment +export CNI_PATH=/opt/cni/bin +export NETCONFPATH=/etc/cni/net.d + +# Test ADD operation +echo '{}' | sudo cnitool add mycelium-network /var/run/netns/test + +# Test DEL operation +echo '{}' | sudo cnitool del mycelium-network /var/run/netns/test +``` + +### Troubleshooting + +Check common issues: + +```bash +# Verify Mycelium is running +sudo systemctl status mycelium +ip -6 addr show mycelium + +# Check CNI logs +journalctl -u kubelet | grep -i cni + +# Verify network namespaces +sudo ip netns list + +# Check container interfaces +kubectl exec -it -- ip link show +kubectl exec -it -- ip -6 route show +``` ## Architecture