-
Notifications
You must be signed in to change notification settings - Fork 2
09 Exercise
Daniel Morinigo edited this page Jan 16, 2020
·
1 revision
Create a Cluster
scoped CRD and controller to fullfil the following business requirements:
- Have a resource to easily maintain content, this resource should be able to automatically synced to multiple namespaces
- It is recommended to use labels to select the target namespaces
- Removing the replica resource should cleanup all the replicas from all target namespaces
- The replica configmaps should have the same name as the
ConfigMapReplica
instance - Know the current state of the replicas by checking the
ConfigMapReplica
resource details
- Use
kubebuilder
orsample-controller
to implement the controller - Use TDD/BDD to implement tests first then implement the business logic
For examples on how to use kubernetes clients on creating unit tests please check:
- client-go
- [https://github.com/danielfbm/k8s-design-workshop/tree/master/kubebuilder]
I strongly recomment to implement the controller and test cases by yourself to deepen the learning process, and there is a step by step example implementation that can be used as reference.
Have fun!