A Kubernetes controller & CRD to handle the NamespaceClass
problem. Find more about the problem here
This project is built using kubebuilder
It consists to 3 main components:
- The
NamespaceClass
CRD
It can be found at config/crd/bases/akuity.io.my.domain_namespaceclasses.yaml - The Namespace Controller:
It can be found at internal/controller/namespace_controller.go - Example files:
It can be found at /examples
git clone https://github.com/anubhav06/nsc-controller.git
cd nsc-controller
- To install the CRD into the cluster:
make install
- To run the controller:
make run
(in a seperate terminal)
You can use the examples folder for some example resources. Note: These are not real policies but just sample policies, to make sure that they are being created/updated/deleted Once you have done the installation process, follow the below process
kubectl apply -f examples/public-network-custom-resource.yaml
kubectl apply -f examples/internal-network-custom-resource.yaml
kubectl apply -f examples/public-network-namespace.yaml
- Change the value of
namespaceclass.akuity.io/name
from "public-network" to "internal-network" and try