Skip to content

Commit

Permalink
Metrics Adapter: remove deprecated Prom Metrics and non-gRPC code (ke…
Browse files Browse the repository at this point in the history
…dacore#4479)

Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>
  • Loading branch information
zroubalik authored May 18, 2023
1 parent dcfcddc commit 4ae8975
Show file tree
Hide file tree
Showing 17 changed files with 72 additions and 789 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ To learn more about active deprecations, we recommend checking [GitHub Discussio

### Improvements

- **General**: Metrics Adapter: remove deprecated Prometheus Metrics and non-gRPC code ([#3930](https://github.com/kedacore/keda/issues/3930))
- **Azure Data Exporer Scaler**: Use azidentity SDK ([#4489](https://github.com/kedacore/keda/issues/4489))
- **External Scaler**: Add tls options in TriggerAuth metadata. ([#3565](https://github.com/kedacore/keda/issues/3565))
- **GCP PubSub Scaler**: Make it more flexible for metrics ([#4243](https://github.com/kedacore/keda/issues/4243))
Expand Down
8 changes: 0 additions & 8 deletions cmd/adapter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import (

kedav1alpha1 "github.com/kedacore/keda/v2/apis/keda/v1alpha1"
"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 @@ -55,8 +54,6 @@ type Adapter struct {
var logger = klogr.New().WithName("keda_metrics_adapter")

var (
prometheusMetricsPort int
prometheusMetricsPath string
adapterClientRequestQPS float32
adapterClientRequestBurst int
metricsAPIServerPort int
Expand Down Expand Up @@ -145,9 +142,6 @@ func (a *Adapter) makeProvider(ctx context.Context, globalHTTPTimeout time.Durat
handler := scaling.NewScaleHandler(mgr.GetClient(), nil, scheme, globalHTTPTimeout, recorder, secretInformer.Lister())
kubeInformerFactory.Start(ctx.Done())

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

logger.Info("Connecting Metrics Service gRPC client to the server", "address", metricsServiceAddr)
grpcClient, err := metricsservice.NewGrpcClient(metricsServiceAddr, a.SecureServing.ServerCert.CertDirectory)
if err != nil {
Expand Down Expand Up @@ -209,8 +203,6 @@ 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().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
2 changes: 0 additions & 2 deletions config/metrics-server/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ spec:
name: https
- containerPort: 8080
name: http
- containerPort: 9022
name: metrics
volumeMounts:
- mountPath: /tmp
name: temp-vol
Expand Down
3 changes: 0 additions & 3 deletions config/metrics-server/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,5 @@ spec:
- name: http
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

0 comments on commit 4ae8975

Please sign in to comment.