Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 12 additions & 0 deletions api/v1alpha2/controllermanagerconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,20 @@ type ControllerMetrics struct {
// BindAddress is the TCP address that the controller should bind to
// for serving prometheus metrics.
// It can be set to "0" to disable the metrics serving.
// NOTE: This field is deprecated, please use DiagnosticsAddress field
// +optional
BindAddress string `json:"bindAddress,omitempty"`

// DiagnosticsAddress is the TCP address that the controller should bind to
// for serving prometheus metric.
// It can be set to "0" to disable the metrics serving.
// +optional
DiagnosticsAddress string `json:"diagnosticsAddress,omitempty"`

// InsecureDiagnostics indicates if insecure metrics serving should be enabled.
// If false, or not set, the diagnostics address will expose pprof endpoints too.
// +optional
InsecureDiagnostics bool `json:"insecureDiagnostics,omitempty"`
}

// ControllerHealth defines the health configs.
Expand Down
24 changes: 24 additions & 0 deletions config/crd/bases/operator.cluster.x-k8s.io_addonproviders.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1432,7 +1432,19 @@ spec:
BindAddress is the TCP address that the controller should bind to
for serving prometheus metrics.
It can be set to "0" to disable the metrics serving.
NOTE: This field is deprecated, please use DiagnosticsAddress field
type: string
diagnosticsAddress:
description: |-
DiagnosticsAddress is the TCP address that the controller should bind to
for serving prometheus metric.
It can be set to "0" to disable the metrics serving.
type: string
insecureDiagnostics:
description: |-
InsecureDiagnostics indicates if insecure metrics serving should be enabled.
If false, or not set, the diagnostics address will expose pprof endpoints too.
type: boolean
type: object
profilerAddress:
description: |-
Expand Down Expand Up @@ -2961,7 +2973,19 @@ spec:
BindAddress is the TCP address that the controller should bind to
for serving prometheus metrics.
It can be set to "0" to disable the metrics serving.
NOTE: This field is deprecated, please use DiagnosticsAddress field
type: string
diagnosticsAddress:
description: |-
DiagnosticsAddress is the TCP address that the controller should bind to
for serving prometheus metric.
It can be set to "0" to disable the metrics serving.
type: string
insecureDiagnostics:
description: |-
InsecureDiagnostics indicates if insecure metrics serving should be enabled.
If false, or not set, the diagnostics address will expose pprof endpoints too.
type: boolean
type: object
profilerAddress:
description: |-
Expand Down
24 changes: 24 additions & 0 deletions config/crd/bases/operator.cluster.x-k8s.io_bootstrapproviders.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1432,7 +1432,19 @@ spec:
BindAddress is the TCP address that the controller should bind to
for serving prometheus metrics.
It can be set to "0" to disable the metrics serving.
NOTE: This field is deprecated, please use DiagnosticsAddress field
type: string
diagnosticsAddress:
description: |-
DiagnosticsAddress is the TCP address that the controller should bind to
for serving prometheus metric.
It can be set to "0" to disable the metrics serving.
type: string
insecureDiagnostics:
description: |-
InsecureDiagnostics indicates if insecure metrics serving should be enabled.
If false, or not set, the diagnostics address will expose pprof endpoints too.
type: boolean
type: object
profilerAddress:
description: |-
Expand Down Expand Up @@ -2961,7 +2973,19 @@ spec:
BindAddress is the TCP address that the controller should bind to
for serving prometheus metrics.
It can be set to "0" to disable the metrics serving.
NOTE: This field is deprecated, please use DiagnosticsAddress field
type: string
diagnosticsAddress:
description: |-
DiagnosticsAddress is the TCP address that the controller should bind to
for serving prometheus metric.
It can be set to "0" to disable the metrics serving.
type: string
insecureDiagnostics:
description: |-
InsecureDiagnostics indicates if insecure metrics serving should be enabled.
If false, or not set, the diagnostics address will expose pprof endpoints too.
type: boolean
type: object
profilerAddress:
description: |-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1433,7 +1433,19 @@ spec:
BindAddress is the TCP address that the controller should bind to
for serving prometheus metrics.
It can be set to "0" to disable the metrics serving.
NOTE: This field is deprecated, please use DiagnosticsAddress field
type: string
diagnosticsAddress:
description: |-
DiagnosticsAddress is the TCP address that the controller should bind to
for serving prometheus metric.
It can be set to "0" to disable the metrics serving.
type: string
insecureDiagnostics:
description: |-
InsecureDiagnostics indicates if insecure metrics serving should be enabled.
If false, or not set, the diagnostics address will expose pprof endpoints too.
type: boolean
type: object
profilerAddress:
description: |-
Expand Down Expand Up @@ -2962,7 +2974,19 @@ spec:
BindAddress is the TCP address that the controller should bind to
for serving prometheus metrics.
It can be set to "0" to disable the metrics serving.
NOTE: This field is deprecated, please use DiagnosticsAddress field
type: string
diagnosticsAddress:
description: |-
DiagnosticsAddress is the TCP address that the controller should bind to
for serving prometheus metric.
It can be set to "0" to disable the metrics serving.
type: string
insecureDiagnostics:
description: |-
InsecureDiagnostics indicates if insecure metrics serving should be enabled.
If false, or not set, the diagnostics address will expose pprof endpoints too.
type: boolean
type: object
profilerAddress:
description: |-
Expand Down
24 changes: 24 additions & 0 deletions config/crd/bases/operator.cluster.x-k8s.io_coreproviders.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1432,7 +1432,19 @@ spec:
BindAddress is the TCP address that the controller should bind to
for serving prometheus metrics.
It can be set to "0" to disable the metrics serving.
NOTE: This field is deprecated, please use DiagnosticsAddress field
type: string
diagnosticsAddress:
description: |-
DiagnosticsAddress is the TCP address that the controller should bind to
for serving prometheus metric.
It can be set to "0" to disable the metrics serving.
type: string
insecureDiagnostics:
description: |-
InsecureDiagnostics indicates if insecure metrics serving should be enabled.
If false, or not set, the diagnostics address will expose pprof endpoints too.
type: boolean
type: object
profilerAddress:
description: |-
Expand Down Expand Up @@ -2961,7 +2973,19 @@ spec:
BindAddress is the TCP address that the controller should bind to
for serving prometheus metrics.
It can be set to "0" to disable the metrics serving.
NOTE: This field is deprecated, please use DiagnosticsAddress field
type: string
diagnosticsAddress:
description: |-
DiagnosticsAddress is the TCP address that the controller should bind to
for serving prometheus metric.
It can be set to "0" to disable the metrics serving.
type: string
insecureDiagnostics:
description: |-
InsecureDiagnostics indicates if insecure metrics serving should be enabled.
If false, or not set, the diagnostics address will expose pprof endpoints too.
type: boolean
type: object
profilerAddress:
description: |-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1433,7 +1433,19 @@ spec:
BindAddress is the TCP address that the controller should bind to
for serving prometheus metrics.
It can be set to "0" to disable the metrics serving.
NOTE: This field is deprecated, please use DiagnosticsAddress field
type: string
diagnosticsAddress:
description: |-
DiagnosticsAddress is the TCP address that the controller should bind to
for serving prometheus metric.
It can be set to "0" to disable the metrics serving.
type: string
insecureDiagnostics:
description: |-
InsecureDiagnostics indicates if insecure metrics serving should be enabled.
If false, or not set, the diagnostics address will expose pprof endpoints too.
type: boolean
type: object
profilerAddress:
description: |-
Expand Down Expand Up @@ -2962,7 +2974,19 @@ spec:
BindAddress is the TCP address that the controller should bind to
for serving prometheus metrics.
It can be set to "0" to disable the metrics serving.
NOTE: This field is deprecated, please use DiagnosticsAddress field
type: string
diagnosticsAddress:
description: |-
DiagnosticsAddress is the TCP address that the controller should bind to
for serving prometheus metric.
It can be set to "0" to disable the metrics serving.
type: string
insecureDiagnostics:
description: |-
InsecureDiagnostics indicates if insecure metrics serving should be enabled.
If false, or not set, the diagnostics address will expose pprof endpoints too.
type: boolean
type: object
profilerAddress:
description: |-
Expand Down
24 changes: 24 additions & 0 deletions config/crd/bases/operator.cluster.x-k8s.io_ipamproviders.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1432,7 +1432,19 @@ spec:
BindAddress is the TCP address that the controller should bind to
for serving prometheus metrics.
It can be set to "0" to disable the metrics serving.
NOTE: This field is deprecated, please use DiagnosticsAddress field
type: string
diagnosticsAddress:
description: |-
DiagnosticsAddress is the TCP address that the controller should bind to
for serving prometheus metric.
It can be set to "0" to disable the metrics serving.
type: string
insecureDiagnostics:
description: |-
InsecureDiagnostics indicates if insecure metrics serving should be enabled.
If false, or not set, the diagnostics address will expose pprof endpoints too.
type: boolean
type: object
profilerAddress:
description: |-
Expand Down Expand Up @@ -2961,7 +2973,19 @@ spec:
BindAddress is the TCP address that the controller should bind to
for serving prometheus metrics.
It can be set to "0" to disable the metrics serving.
NOTE: This field is deprecated, please use DiagnosticsAddress field
type: string
diagnosticsAddress:
description: |-
DiagnosticsAddress is the TCP address that the controller should bind to
for serving prometheus metric.
It can be set to "0" to disable the metrics serving.
type: string
insecureDiagnostics:
description: |-
InsecureDiagnostics indicates if insecure metrics serving should be enabled.
If false, or not set, the diagnostics address will expose pprof endpoints too.
type: boolean
type: object
profilerAddress:
description: |-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1434,7 +1434,19 @@ spec:
BindAddress is the TCP address that the controller should bind to
for serving prometheus metrics.
It can be set to "0" to disable the metrics serving.
NOTE: This field is deprecated, please use DiagnosticsAddress field
type: string
diagnosticsAddress:
description: |-
DiagnosticsAddress is the TCP address that the controller should bind to
for serving prometheus metric.
It can be set to "0" to disable the metrics serving.
type: string
insecureDiagnostics:
description: |-
InsecureDiagnostics indicates if insecure metrics serving should be enabled.
If false, or not set, the diagnostics address will expose pprof endpoints too.
type: boolean
type: object
profilerAddress:
description: |-
Expand Down Expand Up @@ -2963,7 +2975,19 @@ spec:
BindAddress is the TCP address that the controller should bind to
for serving prometheus metrics.
It can be set to "0" to disable the metrics serving.
NOTE: This field is deprecated, please use DiagnosticsAddress field
type: string
diagnosticsAddress:
description: |-
DiagnosticsAddress is the TCP address that the controller should bind to
for serving prometheus metric.
It can be set to "0" to disable the metrics serving.
type: string
insecureDiagnostics:
description: |-
InsecureDiagnostics indicates if insecure metrics serving should be enabled.
If false, or not set, the diagnostics address will expose pprof endpoints too.
type: boolean
type: object
profilerAddress:
description: |-
Expand Down
8 changes: 8 additions & 0 deletions internal/controller/component_customizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package controller
import (
"fmt"
"sort"
"strconv"
"strings"
"time"

Expand Down Expand Up @@ -232,10 +233,17 @@ func customizeManagerContainer(mSpec *operatorv1.ManagerSpec, c *corev1.Containe
c.Args = leaderElectionArgs(mSpec.LeaderElection, c.Args)
}

// metrics
if mSpec.Metrics.BindAddress != "" {
c.Args = setArgs(c.Args, "--metrics-bind-addr", mSpec.Metrics.BindAddress)
}

if mSpec.Metrics.DiagnosticsAddress != "" {
c.Args = setArgs(c.Args, "--diagnostics-address", mSpec.Metrics.DiagnosticsAddress)
}

c.Args = setArgs(c.Args, "--insecure-diagnostics", strconv.FormatBool(mSpec.Metrics.InsecureDiagnostics))

// webhooks
if mSpec.Webhook.Host != "" {
c.Args = setArgs(c.Args, "--webhook-host", mSpec.Webhook.Host)
Expand Down
Loading