Skip to content

Commit

Permalink
Fix health issue
Browse files Browse the repository at this point in the history
Signed-off-by: Israel Blancas <[email protected]>
  • Loading branch information
iblancasa committed Nov 19, 2024
1 parent 04818f8 commit c1b95b8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 2 additions & 0 deletions controllers/tempo/certrotation_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions controllers/tempo/tempomonolithic_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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{}).
Expand Down
2 changes: 2 additions & 0 deletions controllers/tempo/tempostack_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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{}).
Expand Down

0 comments on commit c1b95b8

Please sign in to comment.