Skip to content

Commit

Permalink
Merge pull request #978 from epam/pprof
Browse files Browse the repository at this point in the history
Added pprof endpoint
  • Loading branch information
k8s-ci-robot authored Jul 13, 2023
2 parents a4b6e88 + 21cc7bd commit 94dba8f
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions apis/config/v1beta1/configuration_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@ type ControllerManager struct {
// +optional
Health ControllerHealth `json:"health,omitempty"`

// PprofBindAddress is the TCP address that the controller should bind to
// for serving pprof.
// It can be set to "" or "0" to disable the pprof serving.
// Since pprof may contain sensitive information, make sure to protect it
// before exposing it to public.
// +optional
PprofBindAddress string `json:"pprofBindAddress,omitempty"`

// Controller contains global configuration options for controllers
// registered within this manager.
// +optional
Expand Down
1 change: 1 addition & 0 deletions charts/kueue/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ managerConfig:
clientConnection:
qps: 50
burst: 100
#pprofBindAddress: :8082
#waitForPodsReady:
# enable: true
#manageJobsWithoutQueueName: true
Expand Down
1 change: 1 addition & 0 deletions config/components/manager/controller_manager_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ controller:
clientConnection:
qps: 50
burst: 100
#pprofBindAddress: :8082
#waitForPodsReady:
# enable: true
#manageJobsWithoutQueueName: true
Expand Down
4 changes: 4 additions & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ func addTo(o *ctrl.Options, cfg *configapi.Configuration) {
o.MetricsBindAddress = cfg.Metrics.BindAddress
}

if o.PprofBindAddress == "" && cfg.PprofBindAddress != "" {
o.PprofBindAddress = cfg.PprofBindAddress
}

if o.HealthProbeBindAddress == "" && cfg.Health.HealthProbeBindAddress != "" {
o.HealthProbeBindAddress = cfg.Health.HealthProbeBindAddress
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ health:
livenessEndpointName: live
metrics:
bindAddress: :8080
pprofBindAddress: :8082
leaderElection:
leaderElect: true
resourceName: c1f6bfd2.kueue.x-k8s.io
Expand Down Expand Up @@ -474,6 +475,7 @@ integrations:
ReadinessEndpointName: "ready",
LivenessEndpointName: "live",
MetricsBindAddress: configapi.DefaultMetricsBindAddress,
PprofBindAddress: ":8082",
LeaderElection: true,
LeaderElectionID: configapi.DefaultLeaderElectionID,
LeaderElectionNamespace: "namespace",
Expand Down

0 comments on commit 94dba8f

Please sign in to comment.