Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use default pprof server
Signed-off-by: Masayuki Ishii <[email protected]>
  • Loading branch information
masa213f committed May 29, 2023
commit c0e9796cf797aeaf67bba1da4643b773082ae855
9 changes: 1 addition & 8 deletions cmd/moco-controller/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"github.com/cybozu-go/moco/pkg/cert"
"github.com/cybozu-go/moco/pkg/dbop"
"github.com/cybozu-go/moco/pkg/metrics"
"github.com/cybozu-go/moco/pkg/pprof"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
Expand Down Expand Up @@ -73,6 +72,7 @@ func subMain(ns, addr string, port int) error {
Scheme: scheme,
MetricsBindAddress: config.metricsAddr,
HealthProbeBindAddress: config.probeAddr,
PprofBindAddress: config.pprofAddr,
LeaderElection: true,
LeaderElectionID: config.leaderElectionID,
LeaderElectionNamespace: ns,
Expand Down Expand Up @@ -146,13 +146,6 @@ func subMain(ns, addr string, port int) error {
return err
}

if config.pprofAddr != "" && config.pprofAddr != "0" {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The manager supports pprof server by default.
So we can remove the original pprof server added in #500.

ref: kubernetes-sigs/controller-runtime#1943

if err := mgr.Add(pprof.NewHandler(ctrl.Log.WithName("pprof"), config.pprofAddr)); err != nil {
setupLog.Error(err, "unable to set pprof handler")
return err
}
}

metrics.Register(k8smetrics.Registry)

setupLog.Info("starting manager")
Expand Down
65 changes: 0 additions & 65 deletions pkg/pprof/pprof.go

This file was deleted.