master
dongming 2 years ago
parent 0321c0fa48
commit 9b77fdace3

@ -65,6 +65,7 @@ func main() {
ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))
// manager 核心数据对象
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,
MetricsBindAddress: metricsAddr,
@ -89,6 +90,7 @@ func main() {
os.Exit(1)
}
// Reconciler 存在于manager下
if err = (&controllers.AppReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
@ -98,6 +100,7 @@ func main() {
}
//+kubebuilder:scaffold:builder
// 检测健康的相关数据
if err := mgr.AddHealthzCheck("healthz", healthz.Ping); err != nil {
setupLog.Error(err, "unable to set up health check")
os.Exit(1)
@ -108,6 +111,7 @@ func main() {
}
setupLog.Info("starting manager")
// 启动manager
if err := mgr.Start(ctrl.SetupSignalHandler()); err != nil {
setupLog.Error(err, "problem running manager")
os.Exit(1)

Loading…
Cancel
Save