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

Add grafana kubebuilder plugin #119

Merged
merged 2 commits into from
May 22, 2024
Merged

Add grafana kubebuilder plugin #119

merged 2 commits into from
May 22, 2024

Conversation

david-martin
Copy link
Member

@david-martin david-martin commented May 14, 2024

The changes in this PR are the result of running kubebuilder edit --plugins grafana.kubebuilder.io/v1-alpha

Verified locally via the kuadrant-operator:

kustomize build config/prometheus/ | yq e '
  .metadata.namespace = "kuadrant-system" |
  .spec.selector.matchLabels."control-plane" = "dns-operator-controller-manager"
' - | kubectl --context $KUBECTL_CONTEXT apply -f -
  • port forward to grafana with kubectl --context $KUBECTL_CONTEXT -n monitoring port-forward svc/grafana 3000:3000
  • import the 2 generated grafana dashboard json files (in this pr)

looks like this:

runtime metrics
image

resource metrics
image

@david-martin david-martin requested a review from mikenairn May 14, 2024 15:06
Copy link
Member

@mikenairn mikenairn left a comment

Choose a reason for hiding this comment

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

Looks good to me.

Couple of questions:

  1. Do we intend to define dashboards like this in each sub component and pull them into the kuadrant operator grafana setup?
  2. Is there any way we can pull in grafana and prometheus setup from somewhere (kuadrant operator?) and optionally add it to the local-setup kustomization so we can test this locally without needing to set that up manually or use quickstart?
  3. Any recommended docs on how to work with any of this?

@maleck13
Copy link
Contributor

maleck13 commented May 15, 2024

Looks good to me.

+1

Couple of questions:

  1. Do we intend to define dashboards like this in each sub component and pull them into the kuadrant operator grafana setup?

I think we should have these in each kube-builder based component

  1. Is there any way we can pull in grafana and prometheus setup from somewhere (kuadrant operator?) and optionally add it to the local-setup kustomization so we can test this locally without needing to set that up manually or use quickstart?
  2. Any recommended docs on how to work with any of this?

@mikenairn
Copy link
Member

3. Any recommended docs on how to work with any of this?

From the slack chat https://book.kubebuilder.io/plugins/grafana-v1-alpha.html?highlight=grafana#grafana-plugin-grafanav1-alpha

@david-martin
Copy link
Member Author

  • Is there any way we can pull in grafana and prometheus setup from somewhere (kuadrant operator?) and optionally add it to the local-setup kustomization so we can test this locally without needing to set that up manually or use quickstart?

Easiest method I've found is https://github.com/prometheus-operator/kube-prometheus/blob/main/kustomization.yaml

1 issue is the timing of CRDs being ready, and CRs being created.
Filtering to applying CRDs first, then the rest of the resources like this works well

@maleck13
Copy link
Contributor

@david-martin one minor change I would suggest is the name of the service monitor. It is very generic right now and would prob clash with others. Ok to set is as part of this PR before merge? IE dns-operator-metrics-monitor ?

@maleck13
Copy link
Contributor

Once this merges I want to pull it into the eng environment also

@david-martin
Copy link
Member Author

name of the service monitor

@maleck13 changed.
Also changed the matchLabels selector to match the Service correctly.

@maleck13 maleck13 added this pull request to the merge queue May 22, 2024
Merged via the queue into main with commit 588b443 May 22, 2024
11 checks passed
@david-martin david-martin deleted the grafana-plugin branch May 22, 2024 16:27
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.

3 participants