FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[release-v1.36] CCM: Use existing metrics port (`--secure-port`) for SDK metrics instead of dedicated one (`--metrics-address`) by stackit-ske · Pull Request #1527 · stackitcloud/cloud-provider-stackit · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .go  (1) .yaml  (2) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
11 changes: 9 additions & 2 deletions cmd/cloud-controller-manager/main.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"k8s.io/cloud-provider/options"
cliflag "k8s.io/component-base/cli/flag"
"k8s.io/component-base/logs"
"k8s.io/component-base/metrics/legacyregistry"
_ "k8s.io/component-base/metrics/prometheus/clientgo"
_ "k8s.io/component-base/metrics/prometheus/version"
"k8s.io/klog/v2"
Expand All @@ -33,6 +34,12 @@ var (
metricsAddressFlag *string
)

func init() {
// RawMustRegister is marked as deprecated because this bypasses the metric stability framework. But we want to
// use the same metrics in different repos, so it does not make sense to only use different types in this repo.
legacyregistry.RawMustRegister(metrics.NewExporter())
}

func main() {
ccmOptions, err := options.NewCloudControllerManagerOptions()
if err != nil {
Expand All @@ -49,8 +56,8 @@ func main() {
ctx, cancel := signal.NotifyContext(context.Background(), syscall.SIGTERM, syscall.SIGINT)
defer cancel()

// setup metrics
metricsAddressFlag = additionalFlags.FlagSet("metrics").String("metrics-address", defaultMetricsAddress, "set the prometheus metrics endpoint")
// TODO: remove this later. Not removed yet because it is breaking to remove it.
metricsAddressFlag = additionalFlags.FlagSet("metrics").String("metrics-address", defaultMetricsAddress, "set the prometheus metrics endpoint. Deprecated, do not use! Use --secure-port for metrics.")

command := app.NewCloudControllerManagerCommand(ccmOptions, cloudInitializer(ctx), controllerInitializers, controllerAliases, additionalFlags, wait.NeverStop)
pflag.CommandLine.SetNormalizeFunc(cliflag.WordSepNormalizeFunc)
Expand Down
5 changes: 0 additions & 5 deletions deploy/cloud-controller-manager/deployment.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,8 @@ spec:
value: /etc/serviceaccount/sa_key.json
ports:
- containerPort: 10258
hostPort: 10258
name: https
protocol: TCP
- containerPort: 9090
hostPort: 9090
name: metrics
protocol: TCP
resources:
limits:
cpu: "0.5"
Expand Down
10 changes: 3 additions & 7 deletions deploy/cloud-controller-manager/service.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@ spec:
selector:
app: stackit-cloud-controller-manager
ports:
- name: main
port: 80
targetPort: 8888
protocol: TCP
- name: metrics
port: 8080
targetPort: metrics
- name: https
port: 10258
targetPort: https
protocol: TCP
type: ClusterIP

Back | FazBrowse Home | New Git URL