Skip to content

docs: Enhance documentation for K8s Gateway API metrics. #5628

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

Merged
merged 5 commits into from
Apr 11, 2025

Conversation

sudiptob2
Copy link
Contributor

@sudiptob2 sudiptob2 commented Mar 28, 2025

Tasks

  • Document the process of observing kube-state-metrics using Add-ons charts.

Fixes #5625

Release Notes: No

@sudiptob2 sudiptob2 force-pushed the docs/k8s-gateway-api-metrics branch from 8e24d24 to 81ef5d0 Compare March 28, 2025 17:06
### Install Metrics Stack

Run the following commands to install the metrics stack, with the _Gateway API State Metrics_ configuration,
on your kubernetes cluster:

```shell
kubectl apply --server-side -f https://raw.githubusercontent.com/Kuadrant/gateway-api-state-metrics/main/config/examples/kube-prometheus/bundle_crd.yaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

referring to moving these into https://github.com/envoyproxy/gateway/tree/main/charts/gateway-addons-helm which is the prerequisite step similar to other tasks so users dont need to install/upgrade one more thing

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need L27 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed redundant CRDs

@sudiptob2 sudiptob2 marked this pull request as ready for review March 28, 2025 17:10
@sudiptob2 sudiptob2 requested a review from a team as a code owner March 28, 2025 17:10
@sudiptob2 sudiptob2 marked this pull request as draft March 28, 2025 17:15
@sudiptob2 sudiptob2 force-pushed the docs/k8s-gateway-api-metrics branch from a5eaae9 to 439b31d Compare April 2, 2025 23:27
@sudiptob2 sudiptob2 requested a review from arkodg April 2, 2025 23:36
Copy link

codecov bot commented Apr 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 65.26%. Comparing base (6a15dc7) to head (fdce08f).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5628      +/-   ##
==========================================
- Coverage   65.27%   65.26%   -0.01%     
==========================================
  Files         213      213              
  Lines       34121    34121              
==========================================
- Hits        22272    22269       -3     
- Misses      10508    10510       +2     
- Partials     1341     1342       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sudiptob2 sudiptob2 force-pushed the docs/k8s-gateway-api-metrics branch 2 times, most recently from 142ad30 to f83017f Compare April 3, 2025 15:20
@sudiptob2 sudiptob2 marked this pull request as ready for review April 3, 2025 15:22
@@ -2,57 +2,141 @@
title: "Gateway API Metrics"
---

Resource metrics for Gateway API objects are available using the [Gateway API State Metrics][gasm] project.
The project also provides example dashboard for visualising the metrics using Grafana, and example alerts using Prometheus & Alertmanager.
Resource metrics for **Kubernetes Gateway API** objects are available through the [Gateway API State Metrics][gasm] project. The project also includes an example dashboard for visualizing the metrics with Grafana, along with sample alerts using Prometheus and Alertmanager.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this line still relevant, now that its provided via gateway-addons-helm ?

target_name: [ "name" ]
target_namespace: [ "namespace" ]
rbac:
extraRules:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we also add EG resources here - xPolicies and HTTPRouteFilter

customResourceState:
enabled: true
# Add (Cluster)Role permissions to list/watch the customResources defined in the config to rbac.extraRules
config:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this live here or in a template ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding more context:
This config should be added to a file and then path to that file can be passed to kube-state-metrics
Here is an example

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are using the Prometheus chart that comes with the Prometheus add-on. This chart does not seem to have that confg-file option
https://github.com/prometheus-community/helm-charts/blob/995b3392c82ecfdec4cbc432064b04b40c71c8aa/charts/kube-state-metrics/values.yaml#L452

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like the config file option is enabled by default: https://github.com/prometheus-community/helm-charts/blob/995b3392c82ecfdec4cbc432064b04b40c71c8aa/charts/kube-state-metrics/templates/deployment.yaml#L139C47-L139C83
and when you add those metrics as config it already goes into a configmap so what you have done is sufficient then. ✔️

@sudiptob2 sudiptob2 force-pushed the docs/k8s-gateway-api-metrics branch from 6d9d743 to 21a87af Compare April 9, 2025 20:14
@sudiptob2 sudiptob2 force-pushed the docs/k8s-gateway-api-metrics branch from a75dd90 to 344030f Compare April 9, 2025 22:09
@sudiptob2 sudiptob2 force-pushed the docs/k8s-gateway-api-metrics branch from 1fcf2d7 to 63cb8a9 Compare April 11, 2025 00:17
arkodg
arkodg previously approved these changes Apr 11, 2025
Copy link
Contributor

@arkodg arkodg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks !

@arkodg arkodg requested review from a team April 11, 2025 03:00
@sudiptob2 sudiptob2 force-pushed the docs/k8s-gateway-api-metrics branch from 63cb8a9 to 8042e97 Compare April 11, 2025 03:12
@sudiptob2 sudiptob2 requested a review from arkodg April 11, 2025 03:13
arkodg
arkodg previously approved these changes Apr 11, 2025
@arkodg arkodg requested review from a team and removed request for Thakurvaibhav April 11, 2025 19:25
Copy link
Contributor

@Thakurvaibhav Thakurvaibhav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@arkodg arkodg merged commit 0e49fa6 into envoyproxy:main Apr 11, 2025
28 checks passed
@sudiptob2 sudiptob2 deleted the docs/k8s-gateway-api-metrics branch April 12, 2025 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add kube-state-metrics into addons chart
3 participants