Develop Setup
- download kubebuilder
- download kustomize from kustomize
- init project and run kubebuilder
kubebuilder init --domain metal-stack.io
kubebuilder create api --group firewall --version v1 --kind Network
- run test
export KUBEBUILDER_ASSETS=~/dev/kubebuilder_2.3.1_linux_amd64/bin
make test
Testing locally
# start kind cluster
kind create cluster
# deploy manifests
k apply -f deploy
# start the controller
bin/firewall-controller --hosts-file ./hosts
# watch results
k describe -n firewall firewall
cat nftables.v4
cat hosts