k8s-sidecar-testinglisted
Install: claude install-skill fakoli/fakoli-plugins
# K8s Sidecar Testing
Test nat464-sidecar in an IPv6-only Kubernetes cluster using Multipass VMs and k3s.
## Workflow
Execute phases in order. Each phase has a corresponding script in `scripts/`.
### Phase 1: VM Provisioning (run on Mac)
```bash
scripts/vm-setup.sh [vm-name] [cpus] [memory] [disk]
# Defaults: nat464-dev, 2 CPUs, 4G RAM, 20G disk
```
Then transfer the project into the VM:
```bash
tar czf /tmp/nat464.tar.gz --exclude=target --exclude=.git -C /path/to nat464-sidecar
multipass transfer /tmp/nat464.tar.gz nat464-dev:/home/ubuntu/
multipass shell nat464-dev
# Inside VM:
tar xzf nat464.tar.gz
```
### Phase 2: k3s Cluster Setup (run inside VM)
```bash
scripts/k3s-setup.sh
```
Creates an IPv6-only pod network emulating AWS EKS:
- Pod CIDR: `fd00:42::/56` (IPv6-only, like EKS)
- Service CIDR: `fd00:43::/112` (IPv6-only)
- Node: dual-stack (like EKS ENI nodes)
- CoreDNS DNS64 with `64:ff9b::/96` prefix
### Phase 3: Build Container Image (run inside VM)
```bash
scripts/build-image.sh [project-dir]
# Default: /home/ubuntu/nat464-sidecar
```
Builds with Docker, imports into k3s containerd.
### Phase 4: Deploy and Verify (run inside VM)
```bash
scripts/deploy-test.sh [manifest-path]
# Default: /home/ubuntu/nat464-sidecar/deploy/example-pod.yaml
```
Runs eight automated tests:
1. Health check (`/healthz` endpoint)
2. Nginx IPv4-only confirmation (`ss -tlnp` shows `0.0.0.0:80` only)
3. Direct IPv6 to nginx:80 refused (proving sidecar is required)
4. Inbound tra