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

CR monitoring via KSM #2513

Open
bavarianbidi opened this issue May 30, 2023 · 0 comments
Open

CR monitoring via KSM #2513

bavarianbidi opened this issue May 30, 2023 · 0 comments

Comments

@bavarianbidi
Copy link

bavarianbidi commented May 30, 2023

Is your feature request related to a problem? Please describe.

Beside the core objects (Pods, Services, ...), a "modern" kubernetes cluster consist of a lot of additional information which is stored in CustomResources (CRs).

The configuration/definition of these CRs are having a huge impact on the "behavior" of a cluster.
All the relevant information should be exported as metrics to get used in dashboards and alerts.

E.g. using flux as gitops tool support different configurations such as the remote-branch to use

$ k get gitrepo -n flux-giantswarm giantswarm-config -o yaml | yq ".spec.ref"       
branch: main

The reconciliation of the gitrepo is stored in the .status.conditions field of the gitrepo CR itself:

$ k get gitrepo -n flux-giantswarm giantswarm-config -o yaml | yq '.status.conditions'

- lastTransitionTime: "2023-05-29T11:58:37Z"
  message: stored artifact for revision 'main@sha1:06a6bf1b36e2ca013d655018435fe7a15e36fbe8'
  observedGeneration: 54
  reason: Succeeded
  status: "True"
  type: Ready
- lastTransitionTime: "2023-05-29T11:58:37Z"
  message: stored artifact for revision 'main@sha1:06a6bf1b36e2ca013d655018435fe7a15e36fbe8'
  observedGeneration: 54
  reason: Succeeded
  status: "True"
  type: ArtifactInStorage

Describe the solution you'd like

With kube-state-metrics (KSM) version v2.5.0 a new feature got introduced to convert different type of information from CRs into metrics.

Within Giant Swarm we already use KSM to monitor all the different CAPI related CRs in the so called cluster-api-monitoring-app.
This app was initially build for CAPI only but it's an easy one to monitor other CRs as well (e.g. demo PR to monitor flux CRs).

For that reason i would like to have a generic app within GiantSwarm to monitor all the known CRs which are relevant for day-2 operation.
Instead of writing custom monitoring/metrics exporter i would like to define the generated metrics in the KSM based CustomResourceDefinition format.

Describe alternatives you've considered

Writing own metrics exporter per CRD controller

Additional context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant