- 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=/usr/local/kubebuilder/bin # path-to-kubebuilder/bin
make test
# make binary
make
# start the controller
bin/firewall-controller --hosts-file ./hosts --enable-signature-check=false --enable-IDS=false
# install kind (k8s in docker)
# create a local kind cluster
kind create cluster
# deploy manifests
k apply -f deploy
# watch results
k describe -n firewall firewall
cat nftables.v4
cat hosts