diff --git a/cmd/root.go b/cmd/root.go index 837984506..d573cb6e9 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -70,6 +70,11 @@ func readConfig(cmd *cobra.Command, configFile string) error { return fmt.Errorf("controller config validation failed: %w", err) } + options.HealthProbeBindAddress = ":8081" + options.PprofBindAddress = ":6060" + options.ReadinessEndpointName = "/readyz" + options.LivenessEndpointName = "/healthz" + cmd.SetContext(context.WithValue(cmd.Context(), RootConfigKey{}, RootConfig{options, ctrlConfig})) return nil } diff --git a/controllers/tempo/certrotation_controller.go b/controllers/tempo/certrotation_controller.go index 28c59f824..c514449af 100644 --- a/controllers/tempo/certrotation_controller.go +++ b/controllers/tempo/certrotation_controller.go @@ -10,6 +10,7 @@ import ( ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" + "github.com/google/uuid" configv1alpha1 "github.com/grafana/tempo-operator/apis/config/v1alpha1" "github.com/grafana/tempo-operator/apis/tempo/v1alpha1" tempoStackState "github.com/grafana/tempo-operator/controllers/tempo/internal/management/state" @@ -88,6 +89,7 @@ func (r *CertRotationReconciler) Reconcile(ctx context.Context, req ctrl.Request // SetupWithManager sets up the controller with the Manager. func (r *CertRotationReconciler) SetupWithManager(mgr ctrl.Manager) error { return ctrl.NewControllerManagedBy(mgr). + Named("certrotation" + uuid.New().String()). For(&v1alpha1.TempoStack{}). Owns(&corev1.Secret{}). Complete(r) diff --git a/controllers/tempo/tempomonolithic_controller.go b/controllers/tempo/tempomonolithic_controller.go index c24285d2f..aa157acfd 100644 --- a/controllers/tempo/tempomonolithic_controller.go +++ b/controllers/tempo/tempomonolithic_controller.go @@ -4,6 +4,7 @@ import ( "context" "fmt" + "github.com/google/uuid" grafanav1 "github.com/grafana/grafana-operator/v5/api/v1beta1" routev1 "github.com/openshift/api/route/v1" monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" @@ -228,6 +229,7 @@ func (r *TempoMonolithicReconciler) getOwnedObjects(ctx context.Context, tempo v // SetupWithManager sets up the controller with the Manager. func (r *TempoMonolithicReconciler) SetupWithManager(mgr ctrl.Manager) error { builder := ctrl.NewControllerManagedBy(mgr). + Named("tempomonolithic" + uuid.New().String()). For(&v1alpha1.TempoMonolithic{}). Owns(&corev1.ConfigMap{}). Owns(&corev1.Secret{}). diff --git a/controllers/tempo/tempostack_controller.go b/controllers/tempo/tempostack_controller.go index e97cd2472..e79869dd6 100644 --- a/controllers/tempo/tempostack_controller.go +++ b/controllers/tempo/tempostack_controller.go @@ -6,6 +6,7 @@ import ( "fmt" "github.com/go-logr/logr" + "github.com/google/uuid" grafanav1 "github.com/grafana/grafana-operator/v5/api/v1beta1" routev1 "github.com/openshift/api/route/v1" monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" @@ -198,6 +199,7 @@ func (r *TempoStackReconciler) SetupWithManager(mgr ctrl.Manager) error { } builder := ctrl.NewControllerManagedBy(mgr). + Named("tempostack-"+uuid.New().String()). For(&v1alpha1.TempoStack{}). Owns(&corev1.ConfigMap{}). Owns(&corev1.ServiceAccount{}).