|
|
@@ -30,6 +30,7 @@ import (
|
|
|
"sigs.k8s.io/controller-runtime/pkg/cache"
|
|
|
"sigs.k8s.io/controller-runtime/pkg/client"
|
|
|
"sigs.k8s.io/controller-runtime/pkg/controller"
|
|
|
+ "sigs.k8s.io/controller-runtime/pkg/healthz"
|
|
|
"sigs.k8s.io/controller-runtime/pkg/metrics/server"
|
|
|
"sigs.k8s.io/controller-runtime/pkg/webhook"
|
|
|
|
|
|
@@ -61,6 +62,7 @@ var (
|
|
|
setupLog = ctrl.Log.WithName("setup")
|
|
|
dnsName string
|
|
|
certDir string
|
|
|
+ liveAddr string
|
|
|
metricsAddr string
|
|
|
healthzAddr string
|
|
|
controllerClass string
|
|
|
@@ -141,6 +143,7 @@ var rootCmd = &cobra.Command{
|
|
|
Metrics: server.Options{
|
|
|
BindAddress: metricsAddr,
|
|
|
},
|
|
|
+ HealthProbeBindAddress: liveAddr,
|
|
|
WebhookServer: webhook.NewServer(webhook.Options{
|
|
|
Port: 9443,
|
|
|
}),
|
|
|
@@ -287,6 +290,11 @@ var rootCmd = &cobra.Command{
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if err := mgr.AddHealthzCheck("healthz", healthz.Ping); err != nil {
|
|
|
+ setupLog.Error(err, "unable to add controller healthz check")
|
|
|
+ os.Exit(1)
|
|
|
+ }
|
|
|
+
|
|
|
fs := feature.Features()
|
|
|
for _, f := range fs {
|
|
|
if f.Initialize == nil {
|
|
|
@@ -315,6 +323,7 @@ func init() {
|
|
|
rootCmd.Flags().IntVar(&concurrent, "concurrent", 1, "The number of concurrent reconciles.")
|
|
|
rootCmd.Flags().Float32Var(&clientQPS, "client-qps", 50, "QPS configuration to be passed to rest.Client")
|
|
|
rootCmd.Flags().IntVar(&clientBurst, "client-burst", 100, "Maximum Burst allowed to be passed to rest.Client")
|
|
|
+ rootCmd.Flags().StringVar(&liveAddr, "live-addr", ":8082", "The address the live endpoint binds to.")
|
|
|
rootCmd.Flags().StringVar(&loglevel, "loglevel", "info", "loglevel to use, one of: debug, info, warn, error, dpanic, panic, fatal")
|
|
|
rootCmd.Flags().StringVar(&zapTimeEncoding, "zap-time-encoding", "epoch", "Zap time encoding (one of 'epoch', 'millis', 'nano', 'iso8601', 'rfc3339' or 'rfc3339nano')")
|
|
|
rootCmd.Flags().StringVar(&namespace, "namespace", "", "watch external secrets scoped in the provided namespace only. ClusterSecretStore can be used but only work if it doesn't reference resources from other namespaces")
|