This commit is contained in:
2023-09-05 14:21:06 +08:00
parent c91394314c
commit 7c0ea16e35
23 changed files with 1502 additions and 1 deletions

11
main.go
View File

@ -30,6 +30,9 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/healthz"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
apptreesirpubv1alpha1 "git.treesir.pub/cdryzun/operator-demo/api/v1alpha1"
"git.treesir.pub/cdryzun/operator-demo/controllers"
//+kubebuilder:scaffold:imports
)
@ -41,6 +44,7 @@ var (
func init() {
utilruntime.Must(clientgoscheme.AddToScheme(scheme))
utilruntime.Must(apptreesirpubv1alpha1.AddToScheme(scheme))
//+kubebuilder:scaffold:scheme
}
@ -85,6 +89,13 @@ func main() {
os.Exit(1)
}
if err = (&controllers.AppServiceReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}).SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "AppService")
os.Exit(1)
}
//+kubebuilder:scaffold:builder
if err := mgr.AddHealthzCheck("healthz", healthz.Ping); err != nil {