Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaking change: Remove deprecated prometheus metrics from Metric Server #4471

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ To learn more about active deprecations, we recommend checking [GitHub Discussio

### Breaking Changes

- TODO ([#XXX](https://github.com/kedacore/keda/issue/XXX))
- Prometheus metrics on KEDA Metric Server are removed ([#3972](https://github.com/kedacore/keda/issues/3972))
JorTurFer marked this conversation as resolved.
Show resolved Hide resolved

### Other

Expand Down
12 changes: 2 additions & 10 deletions cmd/adapter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import (
kedav1alpha1 "github.com/kedacore/keda/v2/apis/keda/v1alpha1"
kedacontrollers "github.com/kedacore/keda/v2/controllers/keda"
"github.com/kedacore/keda/v2/pkg/metricsservice"
prommetrics "github.com/kedacore/keda/v2/pkg/prommetrics/adapter"
kedaprovider "github.com/kedacore/keda/v2/pkg/provider"
"github.com/kedacore/keda/v2/pkg/scaling"
kedautil "github.com/kedacore/keda/v2/pkg/util"
Expand All @@ -61,10 +60,8 @@ var logger = klogr.New().WithName("keda_metrics_adapter")

var (
prometheusMetricsPort int
prometheusMetricsPath string
adapterClientRequestQPS float32
adapterClientRequestBurst int
metricsAPIServerPort int
disableCompression bool
metricsServiceAddr string
)
Expand Down Expand Up @@ -115,7 +112,7 @@ func (a *Adapter) makeProvider(ctx context.Context, globalHTTPTimeout time.Durat
cfg.Burst = adapterClientRequestBurst
cfg.DisableCompression = disableCompression

metricsBindAddress := fmt.Sprintf(":%v", metricsAPIServerPort)
metricsBindAddress := fmt.Sprintf(":%v", prometheusMetricsPort)
mgr, err := ctrl.NewManager(cfg, ctrl.Options{
MetricsBindAddress: metricsBindAddress,
Scheme: scheme,
Expand Down Expand Up @@ -153,9 +150,6 @@ func (a *Adapter) makeProvider(ctx context.Context, globalHTTPTimeout time.Durat
externalMetricsInfo := &[]provider.ExternalMetricInfo{}
externalMetricsInfoLock := &sync.RWMutex{}

prometheusServer := &prommetrics.PrometheusMetricServer{}
go func() { prometheusServer.NewServer(fmt.Sprintf(":%v", prometheusMetricsPort), prometheusMetricsPath) }()

stopCh := make(chan struct{})
if err := runScaledObjectController(ctx, mgr, handler, logger, externalMetricsInfo, externalMetricsInfoLock, maxConcurrentReconciles, stopCh, secretInformer.Informer().HasSynced); err != nil {
return nil, nil, err
Expand Down Expand Up @@ -245,9 +239,7 @@ func main() {

cmd.Flags().StringVar(&cmd.Message, "msg", "starting adapter...", "startup message")
cmd.Flags().AddGoFlagSet(flag.CommandLine) // make sure we get the klog flags
cmd.Flags().IntVar(&metricsAPIServerPort, "port", 8080, "Set the port for the metrics API server")
cmd.Flags().IntVar(&prometheusMetricsPort, "metrics-port", 9022, "Set the port to expose prometheus metrics")
cmd.Flags().StringVar(&prometheusMetricsPath, "metrics-path", "/metrics", "Set the path for the prometheus metrics endpoint")
cmd.Flags().IntVar(&prometheusMetricsPort, "port", 8080, "Set the port to expose prometheus metrics")
cmd.Flags().StringVar(&metricsServiceAddr, "metrics-service-address", generateDefaultMetricsServiceAddr(), "The address of the gRPRC Metrics Service Server.")
cmd.Flags().Float32Var(&adapterClientRequestQPS, "kube-api-qps", 20.0, "Set the QPS rate for throttling requests sent to the apiserver")
cmd.Flags().IntVar(&adapterClientRequestBurst, "kube-api-burst", 30, "Set the burst for throttling requests sent to the apiserver")
Expand Down
12 changes: 8 additions & 4 deletions config/crd/bases/keda.sh_scaledjobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2136,7 +2136,8 @@ spec:
defined in spec.resourceClaims, that are used
by this container. \n This is an alpha field
and requires enabling the DynamicResourceAllocation
feature gate. \n This field is immutable."
feature gate. \n This field is immutable.
It can only be set for containers."
items:
description: ResourceClaim references one
entry in PodSpec.ResourceClaims.
Expand Down Expand Up @@ -3570,7 +3571,8 @@ spec:
defined in spec.resourceClaims, that are used
by this container. \n This is an alpha field
and requires enabling the DynamicResourceAllocation
feature gate. \n This field is immutable."
feature gate. \n This field is immutable.
It can only be set for containers."
items:
description: ResourceClaim references one
entry in PodSpec.ResourceClaims.
Expand Down Expand Up @@ -5039,7 +5041,8 @@ spec:
defined in spec.resourceClaims, that are used
by this container. \n This is an alpha field
and requires enabling the DynamicResourceAllocation
feature gate. \n This field is immutable."
feature gate. \n This field is immutable.
It can only be set for containers."
items:
description: ResourceClaim references one
entry in PodSpec.ResourceClaims.
Expand Down Expand Up @@ -6920,7 +6923,8 @@ spec:
\n This is an alpha field and
requires enabling the DynamicResourceAllocation
feature gate. \n This field is
immutable."
immutable. It can only be set
for containers."
items:
description: ResourceClaim references
one entry in PodSpec.ResourceClaims.
Expand Down
2 changes: 0 additions & 2 deletions config/metrics-server/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ spec:
- containerPort: 6443
name: https
- containerPort: 8080
name: http
- containerPort: 9022
name: metrics
volumeMounts:
- mountPath: /tmp
Expand Down
5 changes: 1 addition & 4 deletions config/metrics-server/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,8 @@ spec:
- name: https
port: 443
targetPort: 6443
- name: http
- name: metrics
port: 80
targetPort: 8080
- name: metrics
port: 9022
targetPort: 9022
selector:
app: keda-metrics-apiserver
2 changes: 0 additions & 2 deletions config/prometheus/kustomization.yaml

This file was deleted.

16 changes: 0 additions & 16 deletions config/prometheus/monitor.yaml

This file was deleted.

Loading