This project offers a cluster API control plane controller that manages the control plane of a MicroK8s cluster. It is expected to be used along with the respective MicroK8s specific machine bootstrap provider.
Proposal: Migrate logger from zap to klog which is an industry used logger used in Cluster API(CAPI) and all other providers (CAPx) projects. Using klog will help in more granular control over logging as it supports --v verbosity flag in Kubernetes objects's arguments. klog will also help in bringing this provider more in-line with other CAPx projects.
Can we run commands before and/or after deploying the microk8s cluster in the openstack provider? It would be preferable , if this was possible using the cluster generated YAML.
Proposal: In the current implementation, command line flags like MetricsBindAddress, LeaderElection etc. are initialized in the main() function only. We can use a separate InitFlags() function to initialize all the command line flags. This approach will ease the process of adding more command line flags in future, and will help in keeping the main() function clean. This approach will also bring this provider more in-line with other CAPx projects
The current implementation of control-plane-microk8s controller does not support watchNamespace flag. This won't have any affect on clusters deployed using upstream's deployment model as controllers and webhooks are a singleton instance.
But in many cases where controllers and webhooks are separate entities, this can create issues when having a separate controller per namespace as then there will be no restriction for the controller to watch objects in its namespace only. This can create an instance of multiple reconcilers from different namespaces creating resources in different namespaces.
Supporting watchNamespace will be helpful for downstream and will assist in bringing this provider, more in-line with other CAPx providers.