google kubernetes engine - Why Prometheus stack and adapter not fetching the custom metrics in GKE - Stack Overflow

As same as below document, we have implemented the custom metrics pod autoscaling in our project.@Met

As same as below document, we have implemented the custom metrics pod autoscaling in our project. /@MetricFire/prometheus-metrics-based-autoscaling-in-kubernetes-129deb8e7fa6

We have installed the Prometheus stack and adapter in our GKE cluster using helm charts.

Our application exposed the below metrics and we planned to implement the custom metrics HPA using this metrics in GKE cluster.

Metric name: http_server_requests_seconds_count

  • We have updated the below values in Prometheus stack values.yaml file and installed Prometheus stack using this values.yaml file.
additionalPrometheusRulesMap:
rule-name:
  groups:
 - name: sample-recordingrules
    rules:
     - record: sample_record_1m
      expr: (sum by (kubernetes_pod_name) (rate(http_server_requests_seconds_count{job="kubernetes-pods", app="sample-app", kubernetes_pod_name=~".*"}[1m])))
  • We have updated the below values in Prometheus adapter values.yaml file and installed Prometheus adapter using this values.yaml file.
rules:
default: true
custom:
 - seriesQuery: 'sample_record_1m'
  seriesFilters: []
  resources:
   overrides:
    kubernetes_pod_name:
     resource: pod
    kubernetes_namespace:
     resource: namespace
  name:
   matches: "sample_record_1m"
   as: "sample_custom"
  metricsQuery: (predict_linear(sample_record_1m[1m],1*60))
  • We have updated the below values in annotation field in our application deployment yaml.
  prometheus.io/path: /sampleservices/actuator/prometheus
  prometheus.io/port: "8080"
  prometheus.io/scrape: "true"
  • We have updated the custom rules updated in Prometheus adapter in HPA yaml files in below.
metrics:
  - type: Pods
    pods:
      metric:
        name: sample_custom
      target:
        type: AverageValue
        averageValue: 17000m

Note:

  • We have implemented the same procedure in AWS EKS cluster, its working fine and based on custom metrics values the application scales up & down without any issues.
  • But, when we replicated the same procedure in GCP GKE cluster and its not working properly.
  • If we execute the below command to check the custom Prometheus list. But it’s not displayed any custom metrics list.
  • kubectl get --raw “/apis/custom.metrics.k8s.io/v1beta1/” | jq . | grep custom

Request:

  • We are looking for any possible help based on the details shared on why Prometheus stack and adapter not fetching the metrics from application pods to Prometheus in GKE cluster?
  • Do we need to follow up any other extra steps if we implement on GKE cluster to fetch the custom metrics?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744097837a4558270.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信