Remove Jenkins and Kubernetes overall dashboards from the monitoring system manifests.
Signed-off-by: zhenyus <zhenyus@mathmast.com>
This commit is contained in:
parent
5efc8ea5de
commit
604af2dffb
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,3 @@
|
|||||||
|
# CODEOWNERS
|
||||||
|
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
|
||||||
|
* @dotdc
|
||||||
@ -0,0 +1,48 @@
|
|||||||
|
name: Bug Report
|
||||||
|
description: File a bug report
|
||||||
|
title: "[bug] "
|
||||||
|
labels: ["bug"]
|
||||||
|
assignees:
|
||||||
|
- dotdc
|
||||||
|
# Doc: https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
**Please make sure you don't accidentally share sensitive information while filing this issue.**
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Describe the bug
|
||||||
|
description: A clear and concise description of what the bug is.
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: How to reproduce?
|
||||||
|
description: Steps to reproduce the bug.
|
||||||
|
placeholder: |
|
||||||
|
1. In this environment...
|
||||||
|
2. With this config...
|
||||||
|
3. Run '...'
|
||||||
|
4. See error...
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Expected behavior
|
||||||
|
description: A concise description of what you expected to happen.
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Additional context
|
||||||
|
description: |
|
||||||
|
Add any other context about the problem here.
|
||||||
|
|
||||||
|
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
@ -0,0 +1,29 @@
|
|||||||
|
name: Feature request
|
||||||
|
description: Suggest an idea for this project
|
||||||
|
title: "[enhancement] "
|
||||||
|
labels: ["enhancement"]
|
||||||
|
assignees:
|
||||||
|
- dotdc
|
||||||
|
# Doc: https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
**Please make sure you don't accidentally share sensitive information while filing this issue.**
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Describe the enhancement you'd like
|
||||||
|
description: A clear and concise description of what should be added to this project.
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
- type: textarea
|
||||||
|
attributes:
|
||||||
|
label: Additional context
|
||||||
|
description: |
|
||||||
|
Add any other context about your feature request here.
|
||||||
|
|
||||||
|
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
# Pull Request
|
||||||
|
|
||||||
|
## Required Fields
|
||||||
|
|
||||||
|
### :mag_right: What kind of change is it?
|
||||||
|
|
||||||
|
- fix | feat | docs | chore | ci
|
||||||
|
|
||||||
|
### :dart: What has been changed and why do we need it?
|
||||||
|
|
||||||
|
- ...
|
||||||
|
|
||||||
|
## Optional Fields
|
||||||
|
|
||||||
|
### :heavy_check_mark: Which issue(s) this PR fixes?
|
||||||
|
|
||||||
|
- ...
|
||||||
|
|
||||||
|
### :speech_balloon: Additional information?
|
||||||
|
|
||||||
|
- ...
|
||||||
@ -0,0 +1,33 @@
|
|||||||
|
name: pre-commit-checks
|
||||||
|
|
||||||
|
# Doc: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
# Allow this workflow to be manually triggered
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
pre-commit-checks:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
# Doc: https://github.com/marketplace/actions/checkout
|
||||||
|
- name: Checkout ${{ github.repository }}
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
# Doc: https://github.com/marketplace/actions/setup-python
|
||||||
|
- name: Setup Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
|
||||||
|
# Install pre-commit
|
||||||
|
- name: Install pre-commit
|
||||||
|
run: pip install pre-commit
|
||||||
|
|
||||||
|
# Run pre-commit checks
|
||||||
|
- name: Run pre-commit checks
|
||||||
|
run: pre-commit run --all-files
|
||||||
@ -0,0 +1,34 @@
|
|||||||
|
name: release
|
||||||
|
|
||||||
|
# Doc: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
paths:
|
||||||
|
- 'dashboards/**/*.json'
|
||||||
|
# Allow this workflow to be manually triggered
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
# Doc: https://github.com/marketplace/actions/checkout
|
||||||
|
- name: Checkout ${{ github.repository }}
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
# Doc: https://github.com/marketplace/actions/setup-node-js-environment
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
|
||||||
|
# Doc: https://github.com/semantic-release/semantic-release/blob/master/docs/recipes/ci-configurations/github-actions.md
|
||||||
|
- name: Semantic Release
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.PAT }}
|
||||||
|
run: npx semantic-release
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
# Doc: https://pre-commit.com
|
||||||
|
|
||||||
|
repos:
|
||||||
|
# Default pre-commit hooks
|
||||||
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
|
rev: v5.0.0
|
||||||
|
hooks:
|
||||||
|
- id: check-json
|
||||||
|
- id: check-yaml
|
||||||
|
- id: check-added-large-files
|
||||||
|
- id: check-merge-conflict
|
||||||
|
- id: mixed-line-ending
|
||||||
|
- id: trailing-whitespace
|
||||||
|
|
||||||
|
# Typos
|
||||||
|
- repo: https://github.com/crate-ci/typos
|
||||||
|
rev: v1.29.4
|
||||||
|
hooks:
|
||||||
|
- id: typos
|
||||||
|
|
||||||
|
# Markdown linter
|
||||||
|
- repo: https://github.com/igorshubovych/markdownlint-cli
|
||||||
|
rev: v0.43.0
|
||||||
|
hooks:
|
||||||
|
- id: markdownlint
|
||||||
|
args:
|
||||||
|
- "--disable=MD013"
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"branches": [
|
||||||
|
"master"
|
||||||
|
],
|
||||||
|
"plugins": [
|
||||||
|
"@semantic-release/commit-analyzer",
|
||||||
|
"@semantic-release/release-notes-generator",
|
||||||
|
"@semantic-release/github"
|
||||||
|
]
|
||||||
|
}
|
||||||
@ -0,0 +1,132 @@
|
|||||||
|
# Contributor Covenant Code of Conduct
|
||||||
|
|
||||||
|
## Our Pledge
|
||||||
|
|
||||||
|
We as members, contributors, and leaders pledge to make participation in our
|
||||||
|
community a harassment-free experience for everyone, regardless of age, body
|
||||||
|
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
||||||
|
identity and expression, level of experience, education, socio-economic status,
|
||||||
|
nationality, personal appearance, race, caste, color, religion, or sexual
|
||||||
|
identity and orientation.
|
||||||
|
|
||||||
|
We pledge to act and interact in ways that contribute to an open, welcoming,
|
||||||
|
diverse, inclusive, and healthy community.
|
||||||
|
|
||||||
|
## Our Standards
|
||||||
|
|
||||||
|
Examples of behavior that contributes to a positive environment for our
|
||||||
|
community include:
|
||||||
|
|
||||||
|
* Demonstrating empathy and kindness toward other people
|
||||||
|
* Being respectful of differing opinions, viewpoints, and experiences
|
||||||
|
* Giving and gracefully accepting constructive feedback
|
||||||
|
* Accepting responsibility and apologizing to those affected by our mistakes,
|
||||||
|
and learning from the experience
|
||||||
|
* Focusing on what is best not just for us as individuals, but for the overall
|
||||||
|
community
|
||||||
|
|
||||||
|
Examples of unacceptable behavior include:
|
||||||
|
|
||||||
|
* The use of sexualized language or imagery, and sexual attention or advances of
|
||||||
|
any kind
|
||||||
|
* Trolling, insulting or derogatory comments, and personal or political attacks
|
||||||
|
* Public or private harassment
|
||||||
|
* Publishing others' private information, such as a physical or email address,
|
||||||
|
without their explicit permission
|
||||||
|
* Other conduct which could reasonably be considered inappropriate in a
|
||||||
|
professional setting
|
||||||
|
|
||||||
|
## Enforcement Responsibilities
|
||||||
|
|
||||||
|
Community leaders are responsible for clarifying and enforcing our standards of
|
||||||
|
acceptable behavior and will take appropriate and fair corrective action in
|
||||||
|
response to any behavior that they deem inappropriate, threatening, offensive,
|
||||||
|
or harmful.
|
||||||
|
|
||||||
|
Community leaders have the right and responsibility to remove, edit, or reject
|
||||||
|
comments, commits, code, wiki edits, issues, and other contributions that are
|
||||||
|
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
||||||
|
decisions when appropriate.
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
This Code of Conduct applies within all community spaces, and also applies when
|
||||||
|
an individual is officially representing the community in public spaces.
|
||||||
|
Examples of representing our community include using an official e-mail address,
|
||||||
|
posting via an official social media account, or acting as an appointed
|
||||||
|
representative at an online or offline event.
|
||||||
|
|
||||||
|
## Enforcement
|
||||||
|
|
||||||
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||||
|
reported to the community leaders responsible for enforcement at <david@0xdc.me>.
|
||||||
|
All complaints will be reviewed and investigated promptly and fairly.
|
||||||
|
|
||||||
|
All community leaders are obligated to respect the privacy and security of the
|
||||||
|
reporter of any incident.
|
||||||
|
|
||||||
|
## Enforcement Guidelines
|
||||||
|
|
||||||
|
Community leaders will follow these Community Impact Guidelines in determining
|
||||||
|
the consequences for any action they deem in violation of this Code of Conduct:
|
||||||
|
|
||||||
|
### 1. Correction
|
||||||
|
|
||||||
|
**Community Impact**: Use of inappropriate language or other behavior deemed
|
||||||
|
unprofessional or unwelcome in the community.
|
||||||
|
|
||||||
|
**Consequence**: A private, written warning from community leaders, providing
|
||||||
|
clarity around the nature of the violation and an explanation of why the
|
||||||
|
behavior was inappropriate. A public apology may be requested.
|
||||||
|
|
||||||
|
### 2. Warning
|
||||||
|
|
||||||
|
**Community Impact**: A violation through a single incident or series of
|
||||||
|
actions.
|
||||||
|
|
||||||
|
**Consequence**: A warning with consequences for continued behavior. No
|
||||||
|
interaction with the people involved, including unsolicited interaction with
|
||||||
|
those enforcing the Code of Conduct, for a specified period of time. This
|
||||||
|
includes avoiding interactions in community spaces as well as external channels
|
||||||
|
like social media. Violating these terms may lead to a temporary or permanent
|
||||||
|
ban.
|
||||||
|
|
||||||
|
### 3. Temporary Ban
|
||||||
|
|
||||||
|
**Community Impact**: A serious violation of community standards, including
|
||||||
|
sustained inappropriate behavior.
|
||||||
|
|
||||||
|
**Consequence**: A temporary ban from any sort of interaction or public
|
||||||
|
communication with the community for a specified period of time. No public or
|
||||||
|
private interaction with the people involved, including unsolicited interaction
|
||||||
|
with those enforcing the Code of Conduct, is allowed during this period.
|
||||||
|
Violating these terms may lead to a permanent ban.
|
||||||
|
|
||||||
|
### 4. Permanent Ban
|
||||||
|
|
||||||
|
**Community Impact**: Demonstrating a pattern of violation of community
|
||||||
|
standards, including sustained inappropriate behavior, harassment of an
|
||||||
|
individual, or aggression toward or disparagement of classes of individuals.
|
||||||
|
|
||||||
|
**Consequence**: A permanent ban from any sort of public interaction within the
|
||||||
|
community.
|
||||||
|
|
||||||
|
## Attribution
|
||||||
|
|
||||||
|
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||||
|
version 2.1, available at
|
||||||
|
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
||||||
|
|
||||||
|
Community Impact Guidelines were inspired by
|
||||||
|
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
||||||
|
|
||||||
|
For answers to common questions about this code of conduct, see the FAQ at
|
||||||
|
[https://www.contributor-covenant.org/faq][FAQ].\
|
||||||
|
Translations are available at
|
||||||
|
[https://www.contributor-covenant.org/translations][translations].
|
||||||
|
|
||||||
|
[homepage]: https://www.contributor-covenant.org
|
||||||
|
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
||||||
|
[Mozilla CoC]: https://github.com/mozilla/diversity
|
||||||
|
[FAQ]: https://www.contributor-covenant.org/faq
|
||||||
|
[translations]: https://www.contributor-covenant.org/translations
|
||||||
@ -0,0 +1,20 @@
|
|||||||
|
# Contributing Guidelines
|
||||||
|
|
||||||
|
Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
|
||||||
|
|
||||||
|
## Project Scope
|
||||||
|
|
||||||
|
This project aims to offer a set of modern Grafana dashboards for Kubernetes.\
|
||||||
|
Because setups could be very diverse, it is not possible to make theses dashboards universal.\
|
||||||
|
Changes are welcome as soon as they work with [kube-prometheus-stack](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack).
|
||||||
|
|
||||||
|
## How to Contribute
|
||||||
|
|
||||||
|
- **Submit an issue :** to report a bug, share an idea or open a discussion.
|
||||||
|
- **Submit a pull request:** to share a fix or a feature.
|
||||||
|
|
||||||
|
## Best practices
|
||||||
|
|
||||||
|
- Bump dashboard(s) version(s)
|
||||||
|
- [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) is preferred
|
||||||
|
- [Signed commits](https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---signoff) is preferred
|
||||||
@ -0,0 +1,201 @@
|
|||||||
|
Apache License
|
||||||
|
Version 2.0, January 2004
|
||||||
|
http://www.apache.org/licenses/
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
|
|
||||||
|
1. Definitions.
|
||||||
|
|
||||||
|
"License" shall mean the terms and conditions for use, reproduction,
|
||||||
|
and distribution as defined by Sections 1 through 9 of this document.
|
||||||
|
|
||||||
|
"Licensor" shall mean the copyright owner or entity authorized by
|
||||||
|
the copyright owner that is granting the License.
|
||||||
|
|
||||||
|
"Legal Entity" shall mean the union of the acting entity and all
|
||||||
|
other entities that control, are controlled by, or are under common
|
||||||
|
control with that entity. For the purposes of this definition,
|
||||||
|
"control" means (i) the power, direct or indirect, to cause the
|
||||||
|
direction or management of such entity, whether by contract or
|
||||||
|
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||||
|
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||||
|
|
||||||
|
"You" (or "Your") shall mean an individual or Legal Entity
|
||||||
|
exercising permissions granted by this License.
|
||||||
|
|
||||||
|
"Source" form shall mean the preferred form for making modifications,
|
||||||
|
including but not limited to software source code, documentation
|
||||||
|
source, and configuration files.
|
||||||
|
|
||||||
|
"Object" form shall mean any form resulting from mechanical
|
||||||
|
transformation or translation of a Source form, including but
|
||||||
|
not limited to compiled object code, generated documentation,
|
||||||
|
and conversions to other media types.
|
||||||
|
|
||||||
|
"Work" shall mean the work of authorship, whether in Source or
|
||||||
|
Object form, made available under the License, as indicated by a
|
||||||
|
copyright notice that is included in or attached to the work
|
||||||
|
(an example is provided in the Appendix below).
|
||||||
|
|
||||||
|
"Derivative Works" shall mean any work, whether in Source or Object
|
||||||
|
form, that is based on (or derived from) the Work and for which the
|
||||||
|
editorial revisions, annotations, elaborations, or other modifications
|
||||||
|
represent, as a whole, an original work of authorship. For the purposes
|
||||||
|
of this License, Derivative Works shall not include works that remain
|
||||||
|
separable from, or merely link (or bind by name) to the interfaces of,
|
||||||
|
the Work and Derivative Works thereof.
|
||||||
|
|
||||||
|
"Contribution" shall mean any work of authorship, including
|
||||||
|
the original version of the Work and any modifications or additions
|
||||||
|
to that Work or Derivative Works thereof, that is intentionally
|
||||||
|
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||||
|
or by an individual or Legal Entity authorized to submit on behalf of
|
||||||
|
the copyright owner. For the purposes of this definition, "submitted"
|
||||||
|
means any form of electronic, verbal, or written communication sent
|
||||||
|
to the Licensor or its representatives, including but not limited to
|
||||||
|
communication on electronic mailing lists, source code control systems,
|
||||||
|
and issue tracking systems that are managed by, or on behalf of, the
|
||||||
|
Licensor for the purpose of discussing and improving the Work, but
|
||||||
|
excluding communication that is conspicuously marked or otherwise
|
||||||
|
designated in writing by the copyright owner as "Not a Contribution."
|
||||||
|
|
||||||
|
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||||
|
on behalf of whom a Contribution has been received by Licensor and
|
||||||
|
subsequently incorporated within the Work.
|
||||||
|
|
||||||
|
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
copyright license to reproduce, prepare Derivative Works of,
|
||||||
|
publicly display, publicly perform, sublicense, and distribute the
|
||||||
|
Work and such Derivative Works in Source or Object form.
|
||||||
|
|
||||||
|
3. Grant of Patent License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
(except as stated in this section) patent license to make, have made,
|
||||||
|
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||||
|
where such license applies only to those patent claims licensable
|
||||||
|
by such Contributor that are necessarily infringed by their
|
||||||
|
Contribution(s) alone or by combination of their Contribution(s)
|
||||||
|
with the Work to which such Contribution(s) was submitted. If You
|
||||||
|
institute patent litigation against any entity (including a
|
||||||
|
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||||
|
or a Contribution incorporated within the Work constitutes direct
|
||||||
|
or contributory patent infringement, then any patent licenses
|
||||||
|
granted to You under this License for that Work shall terminate
|
||||||
|
as of the date such litigation is filed.
|
||||||
|
|
||||||
|
4. Redistribution. You may reproduce and distribute copies of the
|
||||||
|
Work or Derivative Works thereof in any medium, with or without
|
||||||
|
modifications, and in Source or Object form, provided that You
|
||||||
|
meet the following conditions:
|
||||||
|
|
||||||
|
(a) You must give any other recipients of the Work or
|
||||||
|
Derivative Works a copy of this License; and
|
||||||
|
|
||||||
|
(b) You must cause any modified files to carry prominent notices
|
||||||
|
stating that You changed the files; and
|
||||||
|
|
||||||
|
(c) You must retain, in the Source form of any Derivative Works
|
||||||
|
that You distribute, all copyright, patent, trademark, and
|
||||||
|
attribution notices from the Source form of the Work,
|
||||||
|
excluding those notices that do not pertain to any part of
|
||||||
|
the Derivative Works; and
|
||||||
|
|
||||||
|
(d) If the Work includes a "NOTICE" text file as part of its
|
||||||
|
distribution, then any Derivative Works that You distribute must
|
||||||
|
include a readable copy of the attribution notices contained
|
||||||
|
within such NOTICE file, excluding those notices that do not
|
||||||
|
pertain to any part of the Derivative Works, in at least one
|
||||||
|
of the following places: within a NOTICE text file distributed
|
||||||
|
as part of the Derivative Works; within the Source form or
|
||||||
|
documentation, if provided along with the Derivative Works; or,
|
||||||
|
within a display generated by the Derivative Works, if and
|
||||||
|
wherever such third-party notices normally appear. The contents
|
||||||
|
of the NOTICE file are for informational purposes only and
|
||||||
|
do not modify the License. You may add Your own attribution
|
||||||
|
notices within Derivative Works that You distribute, alongside
|
||||||
|
or as an addendum to the NOTICE text from the Work, provided
|
||||||
|
that such additional attribution notices cannot be construed
|
||||||
|
as modifying the License.
|
||||||
|
|
||||||
|
You may add Your own copyright statement to Your modifications and
|
||||||
|
may provide additional or different license terms and conditions
|
||||||
|
for use, reproduction, or distribution of Your modifications, or
|
||||||
|
for any such Derivative Works as a whole, provided Your use,
|
||||||
|
reproduction, and distribution of the Work otherwise complies with
|
||||||
|
the conditions stated in this License.
|
||||||
|
|
||||||
|
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||||
|
any Contribution intentionally submitted for inclusion in the Work
|
||||||
|
by You to the Licensor shall be under the terms and conditions of
|
||||||
|
this License, without any additional terms or conditions.
|
||||||
|
Notwithstanding the above, nothing herein shall supersede or modify
|
||||||
|
the terms of any separate license agreement you may have executed
|
||||||
|
with Licensor regarding such Contributions.
|
||||||
|
|
||||||
|
6. Trademarks. This License does not grant permission to use the trade
|
||||||
|
names, trademarks, service marks, or product names of the Licensor,
|
||||||
|
except as required for reasonable and customary use in describing the
|
||||||
|
origin of the Work and reproducing the content of the NOTICE file.
|
||||||
|
|
||||||
|
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||||
|
agreed to in writing, Licensor provides the Work (and each
|
||||||
|
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||||
|
implied, including, without limitation, any warranties or conditions
|
||||||
|
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||||
|
appropriateness of using or redistributing the Work and assume any
|
||||||
|
risks associated with Your exercise of permissions under this License.
|
||||||
|
|
||||||
|
8. Limitation of Liability. In no event and under no legal theory,
|
||||||
|
whether in tort (including negligence), contract, or otherwise,
|
||||||
|
unless required by applicable law (such as deliberate and grossly
|
||||||
|
negligent acts) or agreed to in writing, shall any Contributor be
|
||||||
|
liable to You for damages, including any direct, indirect, special,
|
||||||
|
incidental, or consequential damages of any character arising as a
|
||||||
|
result of this License or out of the use or inability to use the
|
||||||
|
Work (including but not limited to damages for loss of goodwill,
|
||||||
|
work stoppage, computer failure or malfunction, or any and all
|
||||||
|
other commercial damages or losses), even if such Contributor
|
||||||
|
has been advised of the possibility of such damages.
|
||||||
|
|
||||||
|
9. Accepting Warranty or Additional Liability. While redistributing
|
||||||
|
the Work or Derivative Works thereof, You may choose to offer,
|
||||||
|
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||||
|
or other liability obligations and/or rights consistent with this
|
||||||
|
License. However, in accepting such obligations, You may act only
|
||||||
|
on Your own behalf and on Your sole responsibility, not on behalf
|
||||||
|
of any other Contributor, and only if You agree to indemnify,
|
||||||
|
defend, and hold each Contributor harmless for any liability
|
||||||
|
incurred by, or claims asserted against, such Contributor by reason
|
||||||
|
of your accepting any such warranty or additional liability.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
APPENDIX: How to apply the Apache License to your work.
|
||||||
|
|
||||||
|
To apply the Apache License to your work, attach the following
|
||||||
|
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||||
|
replaced with your own identifying information. (Don't include
|
||||||
|
the brackets!) The text should be enclosed in the appropriate
|
||||||
|
comment syntax for the file format. We also recommend that a
|
||||||
|
file or class name and description of purpose be included on the
|
||||||
|
same "printed page" as the copyright notice for easier
|
||||||
|
identification within third-party archives.
|
||||||
|
|
||||||
|
Copyright 2020 David Calvert
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
@ -0,0 +1,388 @@
|
|||||||
|
# grafana-dashboards-kubernetes <!-- omit in toc -->
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## Table of contents <!-- omit in toc -->
|
||||||
|
|
||||||
|
- [Description](#description)
|
||||||
|
- [Releases](#releases)
|
||||||
|
- [Features](#features)
|
||||||
|
- [Dashboards](#dashboards)
|
||||||
|
- [Installation](#installation)
|
||||||
|
- [Install manually](#install-manually)
|
||||||
|
- [Install via grafana.com](#install-via-grafanacom)
|
||||||
|
- [Install with ArgoCD](#install-with-argocd)
|
||||||
|
- [Install with Helm values](#install-with-helm-values)
|
||||||
|
- [Install as ConfigMaps](#install-as-configmaps)
|
||||||
|
- [Install as ConfigMaps with Terraform](#install-as-configmaps-with-terraform)
|
||||||
|
- [Install as GrafanaDashboard with Grafana Operator](#install-as-grafanadashboard-with-grafana-operator)
|
||||||
|
- [Known issue(s)](#known-issues)
|
||||||
|
- [Broken panels due to a too-high resolution](#broken-panels-due-to-a-too-high-resolution)
|
||||||
|
- [Broken panels on k8s-views-nodes when a node changes its IP address](#broken-panels-on-k8s-views-nodes-when-a-node-changes-its-ip-address)
|
||||||
|
- [Broken panels on k8s-views-nodes due to the nodename label](#broken-panels-on-k8s-views-nodes-due-to-the-nodename-label)
|
||||||
|
- [Contributing](#contributing)
|
||||||
|
|
||||||
|
## Description
|
||||||
|
|
||||||
|
This repository contains a modern set of [Grafana](https://github.com/grafana/grafana) dashboards for [Kubernetes](https://github.com/kubernetes/kubernetes).\
|
||||||
|
They are inspired by many other dashboards from `kubernetes-mixin` and `grafana.com`.
|
||||||
|
|
||||||
|
More information about them in my article: [A set of modern Grafana dashboards for Kubernetes](https://0xdc.me/blog/a-set-of-modern-grafana-dashboards-for-kubernetes/)
|
||||||
|
|
||||||
|
You can also download them on [Grafana.com](https://grafana.com/grafana/dashboards/?plcmt=top-nav&cta=downloads&search=dotdc).
|
||||||
|
|
||||||
|
## Releases
|
||||||
|
|
||||||
|
This repository follows [semantic versioning](https://semver.org) for releases.\
|
||||||
|
It relies on [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) to automate releases using [semantic-release](https://github.com/semantic-release/semantic-release).
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
These dashboards are made and tested for the [kube-prometheus-stack](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack) chart, but they should work well with others as soon as you have [kube-state-metrics](https://github.com/kubernetes/kube-state-metrics) and [prometheus-node-exporter](https://github.com/prometheus/node_exporter) installed on your Kubernetes cluster.
|
||||||
|
|
||||||
|
They are not backward compatible with older Grafana versions because they try to take advantage of Grafana's newest features like:
|
||||||
|
|
||||||
|
- `gradient mode` introduced in Grafana 8.1 ([Grafana Blog post](https://grafana.com/blog/2021/09/10/new-in-grafana-8.1-gradient-mode-for-time-series-visualizations-and-dynamic-panel-configuration/))
|
||||||
|
- `time series` visualization panel introduced in Grafana 7.4 ([Grafana Blog post](https://grafana.com/blog/2021/02/10/how-the-new-time-series-panel-brings-major-performance-improvements-and-new-visualization-features-to-grafana-7.4/))
|
||||||
|
- `$__rate_interval` variable introduced in Grafana 7.2 ([Grafana Blog post](https://grafana.com/blog/2020/09/28/new-in-grafana-7.2-__rate_interval-for-prometheus-rate-queries-that-just-work/))
|
||||||
|
|
||||||
|
They also have a `Prometheus Datasource` variable so they will work on a federated Grafana instance.
|
||||||
|
|
||||||
|
As an example, here's how the `Kubernetes / Views / Global` dashboard looks like:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## Dashboards
|
||||||
|
|
||||||
|
| File name | Description | Screenshot |
|
||||||
|
|:---------------------------|:------------|:----------:|
|
||||||
|
| k8s-addons-prometheus.json | Dashboard for Prometheus. | [LINK](https://raw.githubusercontent.com/dotdc/media/main/grafana-dashboards-kubernetes/k8s-addons-prometheus.png) |
|
||||||
|
| k8s-addons-trivy-operator.json | Dashboard for the Trivy Operator from Aqua Security. | [LINK](https://raw.githubusercontent.com/dotdc/media/main/grafana-dashboards-kubernetes/k8s-addons-trivy-operator.png) |
|
||||||
|
| k8s-system-api-server.json | Dashboard for the API Server Kubernetes component. | [LINK](https://raw.githubusercontent.com/dotdc/media/main/grafana-dashboards-kubernetes/k8s-system-api-server.png) |
|
||||||
|
| k8s-system-coredns.json | Show information on the CoreDNS Kubernetes component. | [LINK](https://raw.githubusercontent.com/dotdc/media/main/grafana-dashboards-kubernetes/k8s-system-coredns.png) |
|
||||||
|
| k8s-views-global.json | `Global` level view dashboard for Kubernetes. | [LINK](https://raw.githubusercontent.com/dotdc/media/main/grafana-dashboards-kubernetes/k8s-views-global.png) |
|
||||||
|
| k8s-views-namespaces.json | `Namespaces` level view dashboard for Kubernetes. | [LINK](https://raw.githubusercontent.com/dotdc/media/main/grafana-dashboards-kubernetes/k8s-views-namespaces.png) |
|
||||||
|
| k8s-views-nodes.json | `Nodes` level view dashboard for Kubernetes. | [LINK](https://raw.githubusercontent.com/dotdc/media/main/grafana-dashboards-kubernetes/k8s-views-nodes.png) |
|
||||||
|
| k8s-views-pods.json | `Pods` level view dashboard for Kubernetes. | [LINK](https://raw.githubusercontent.com/dotdc/media/main/grafana-dashboards-kubernetes/k8s-views-pods.png) |
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
In most cases, you will need to clone this repository (or your fork):
|
||||||
|
|
||||||
|
```terminal
|
||||||
|
git clone https://github.com/dotdc/grafana-dashboards-kubernetes.git
|
||||||
|
cd grafana-dashboards-kubernetes
|
||||||
|
```
|
||||||
|
|
||||||
|
If you plan to deploy these dashboards using [ArgoCD](#install-with-argocd), [ConfigMaps](#install-as-configmaps) or [Terraform](#install-as-configmaps-with-terraform), you will also need to enable and configure the `dashboards sidecar` on the Grafana Helm chart to get the dashboards loaded in your Grafana instance:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# kube-prometheus-stack values
|
||||||
|
grafana:
|
||||||
|
sidecar:
|
||||||
|
dashboards:
|
||||||
|
enabled: true
|
||||||
|
defaultFolderName: "General"
|
||||||
|
label: grafana_dashboard
|
||||||
|
labelValue: "1"
|
||||||
|
folderAnnotation: grafana_folder
|
||||||
|
searchNamespace: ALL
|
||||||
|
provider:
|
||||||
|
foldersFromFilesStructure: true
|
||||||
|
```
|
||||||
|
|
||||||
|
### Install manually
|
||||||
|
|
||||||
|
On the WebUI of your Grafana instance, put your mouse over the `+` sign on the left menu, then click on `Import`.\
|
||||||
|
Once you are on the Import page, you can upload the JSON files one by one from your local copy using the `Upload JSON file` button.
|
||||||
|
|
||||||
|
### Install via grafana.com
|
||||||
|
|
||||||
|
On the WebUI of your Grafana instance, put your mouse over the `+` sign on the left menu, then click on `Import`.\
|
||||||
|
Once you are on the Import page, you can put the grafana.com dashboard ID (see table below) under `Import via grafana.com` then click on the `Load` button. Repeat for each dashboard.
|
||||||
|
|
||||||
|
Grafana.com dashboard id list:
|
||||||
|
|
||||||
|
| Dashboard | ID |
|
||||||
|
|:-----------------------------------|:------|
|
||||||
|
| k8s-addons-prometheus.json | 19105 |
|
||||||
|
| k8s-addons-trivy-operator.json | 16337 |
|
||||||
|
| k8s-system-api-server.json | 15761 |
|
||||||
|
| k8s-system-coredns.json | 15762 |
|
||||||
|
| k8s-views-global.json | 15757 |
|
||||||
|
| k8s-views-namespaces.json | 15758 |
|
||||||
|
| k8s-views-nodes.json | 15759 |
|
||||||
|
| k8s-views-pods.json | 15760 |
|
||||||
|
|
||||||
|
### Install with ArgoCD
|
||||||
|
|
||||||
|
If you are using ArgoCD, this will deploy the dashboards in the default project of ArgoCD:
|
||||||
|
|
||||||
|
```terminal
|
||||||
|
kubectl apply -f argocd-app.yml
|
||||||
|
```
|
||||||
|
|
||||||
|
You will also need to enable and configure the Grafana `dashboards sidecar` as described in [Installation](#installation).
|
||||||
|
|
||||||
|
### Install with Helm values
|
||||||
|
|
||||||
|
If you use the official Grafana helm chart or kube-prometheus-stack, you can install the dashboards directly using the `dashboardProviders` & `dashboards` helm chart values.
|
||||||
|
|
||||||
|
Depending on your setup, add or merge the following block example to your helm chart values.\
|
||||||
|
The example is for [kube-prometheus-stack](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack), for the official [Grafana helm chart](https://github.com/grafana/helm-charts/tree/main/charts/grafana), remove the first line (`grafana:`), and reduce the indentation level of the entire block.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
grafana:
|
||||||
|
# Provision grafana-dashboards-kubernetes
|
||||||
|
dashboardProviders:
|
||||||
|
dashboardproviders.yaml:
|
||||||
|
apiVersion: 1
|
||||||
|
providers:
|
||||||
|
- name: 'grafana-dashboards-kubernetes'
|
||||||
|
orgId: 1
|
||||||
|
folder: 'Kubernetes'
|
||||||
|
type: file
|
||||||
|
disableDeletion: true
|
||||||
|
editable: true
|
||||||
|
options:
|
||||||
|
path: /var/lib/grafana/dashboards/grafana-dashboards-kubernetes
|
||||||
|
dashboards:
|
||||||
|
grafana-dashboards-kubernetes:
|
||||||
|
k8s-system-api-server:
|
||||||
|
url: https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-system-api-server.json
|
||||||
|
token: ''
|
||||||
|
k8s-system-coredns:
|
||||||
|
url: https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-system-coredns.json
|
||||||
|
token: ''
|
||||||
|
k8s-views-global:
|
||||||
|
url: https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-views-global.json
|
||||||
|
token: ''
|
||||||
|
k8s-views-namespaces:
|
||||||
|
url: https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-views-namespaces.json
|
||||||
|
token: ''
|
||||||
|
k8s-views-nodes:
|
||||||
|
url: https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-views-nodes.json
|
||||||
|
token: ''
|
||||||
|
k8s-views-pods:
|
||||||
|
url: https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-views-pods.json
|
||||||
|
token: ''
|
||||||
|
```
|
||||||
|
|
||||||
|
### Install as ConfigMaps
|
||||||
|
|
||||||
|
Grafana dashboards can be provisioned as Kubernetes ConfigMaps if you configure the [dashboard sidecar](https://github.com/grafana/helm-charts/blob/main/charts/grafana/values.yaml#L667) available on the official [Grafana Helm Chart](https://github.com/grafana/helm-charts/tree/main/charts/grafana).
|
||||||
|
|
||||||
|
To build the ConfigMaps and output them on STDOUT :
|
||||||
|
|
||||||
|
```terminal
|
||||||
|
kubectl kustomize .
|
||||||
|
```
|
||||||
|
|
||||||
|
*Note: no namespace is set by default, you can change that in the `kustomization.yaml` file.*
|
||||||
|
|
||||||
|
To build and deploy them directly on your Kubernetes cluster :
|
||||||
|
|
||||||
|
```terminal
|
||||||
|
kubectl apply -k . -n monitoring
|
||||||
|
```
|
||||||
|
|
||||||
|
You will also need to enable and configure the Grafana `dashboards sidecar` as described in [Installation](#installation).
|
||||||
|
|
||||||
|
*Note: you can change the namespace if needed.*
|
||||||
|
|
||||||
|
### Install as ConfigMaps with Terraform
|
||||||
|
|
||||||
|
If you use Terraform to provision your Kubernetes resources, you can convert the generated ConfigMaps to Terraform code using [tfk8s](https://github.com/jrhouston/tfk8s).
|
||||||
|
|
||||||
|
To build and convert ConfigMaps to Terraform code :
|
||||||
|
|
||||||
|
```terminal
|
||||||
|
kubectl kustomize . | tfk8s
|
||||||
|
```
|
||||||
|
|
||||||
|
You will also need to enable and configure the Grafana `dashboards sidecar` as described in [Installation](#installation).
|
||||||
|
|
||||||
|
*Note: no namespace is set by default, you can change that in the `kustomization.yaml` file.*
|
||||||
|
|
||||||
|
### Install as GrafanaDashboard with Grafana Operator
|
||||||
|
|
||||||
|
If you use Grafana Operator to provision your Grafana dashboards, you can use the following manifests:
|
||||||
|
|
||||||
|
Make sure to use your proper namespace.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
apiVersion: grafana.integreatly.org/v1beta1
|
||||||
|
kind: GrafanaDashboard
|
||||||
|
metadata:
|
||||||
|
name: k8s-system-api-server
|
||||||
|
namespace: monitoring
|
||||||
|
spec:
|
||||||
|
instanceSelector:
|
||||||
|
matchLabels:
|
||||||
|
dashboards: "grafana"
|
||||||
|
url: "https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-system-api-server.json"
|
||||||
|
---
|
||||||
|
apiVersion: grafana.integreatly.org/v1beta1
|
||||||
|
kind: GrafanaDashboard
|
||||||
|
metadata:
|
||||||
|
name: k8s-system-coredns
|
||||||
|
namespace: monitoring
|
||||||
|
spec:
|
||||||
|
instanceSelector:
|
||||||
|
matchLabels:
|
||||||
|
dashboards: "grafana"
|
||||||
|
url: "https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-system-coredns.json"
|
||||||
|
---
|
||||||
|
apiVersion: grafana.integreatly.org/v1beta1
|
||||||
|
kind: GrafanaDashboard
|
||||||
|
metadata:
|
||||||
|
name: k8s-views-global
|
||||||
|
namespace: monitoring
|
||||||
|
spec:
|
||||||
|
instanceSelector:
|
||||||
|
matchLabels:
|
||||||
|
dashboards: "grafana"
|
||||||
|
url: "https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-views-global.json"
|
||||||
|
---
|
||||||
|
apiVersion: grafana.integreatly.org/v1beta1
|
||||||
|
kind: GrafanaDashboard
|
||||||
|
metadata:
|
||||||
|
name: k8s-views-namespaces
|
||||||
|
namespace: monitoring
|
||||||
|
spec:
|
||||||
|
instanceSelector:
|
||||||
|
matchLabels:
|
||||||
|
dashboards: "grafana"
|
||||||
|
url: "https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-views-namespaces.json"
|
||||||
|
---
|
||||||
|
apiVersion: grafana.integreatly.org/v1beta1
|
||||||
|
kind: GrafanaDashboard
|
||||||
|
metadata:
|
||||||
|
name: k8s-views-nodes
|
||||||
|
namespace: monitoring
|
||||||
|
spec:
|
||||||
|
instanceSelector:
|
||||||
|
matchLabels:
|
||||||
|
dashboards: "grafana"
|
||||||
|
url: "https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-views-nodes.json"
|
||||||
|
---
|
||||||
|
apiVersion: grafana.integreatly.org/v1beta1
|
||||||
|
kind: GrafanaDashboard
|
||||||
|
metadata:
|
||||||
|
name: k8s-views-pods
|
||||||
|
namespace: monitoring
|
||||||
|
spec:
|
||||||
|
instanceSelector:
|
||||||
|
matchLabels:
|
||||||
|
dashboards: "grafana"
|
||||||
|
url: "https://raw.githubusercontent.com/dotdc/grafana-dashboards-kubernetes/master/dashboards/k8s-views-pods.json"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Known issue(s)
|
||||||
|
|
||||||
|
### Broken panels due to a too-high resolution
|
||||||
|
|
||||||
|
A user reported in [#50](https://github.com/dotdc/grafana-dashboards-kubernetes/issues/50) that some panels were broken because the default value of the `$resolution` variable was too low. The root cause hasn't been identified precisely, but he was using Grafana Agent & Grafana Mimir. Changing the `$resolution` variable to a higher value (a lower resolution) will likely solve the issue.
|
||||||
|
To make the fix permanent, you can configure the `Scrape interval` in your Grafana Datasource to a working value for your setup.
|
||||||
|
|
||||||
|
### Broken panels on k8s-views-nodes when a node changes its IP address
|
||||||
|
|
||||||
|
To make this dashboard more convenient, there's a small variable hack to display `node` instead of `instance`.
|
||||||
|
Because of that, some panels could lack data when a node changes its IP address as reported in [#102](https://github.com/dotdc/grafana-dashboards-kubernetes/issues/102).
|
||||||
|
|
||||||
|
No easy fix for this scenario yet, but it should be a corner case for most people.
|
||||||
|
Feel free to reopen the issue if you have ideas to fix this.
|
||||||
|
|
||||||
|
### Broken panels on k8s-views-nodes due to the nodename label
|
||||||
|
|
||||||
|
The `k8s-views-nodes` dashboard will have many broken panels if the `node` label from `kube_node_info` doesn't match the `nodename` label from `node_uname_info`.
|
||||||
|
|
||||||
|
This situation can happen on certain deployments of the node exporter running inside Kubernetes(e.g. via a `DaemonSet`), where `nodename` takes a different value than the node name as understood by the Kubernetes API.
|
||||||
|
|
||||||
|
Below are some ways to relabel the metric to force the `nodename` label to the appropriate value, depending on the way the collection agent is deployed:
|
||||||
|
|
||||||
|
#### Directly through the Prometheus configuration file <!-- omit in toc -->
|
||||||
|
|
||||||
|
Assuming the node exporter job is defined through `kubernetes_sd_config`, you can take advantage of the internal discovery labels and fix this by adding the following relabeling rule to the job:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# File: prometheus.yaml
|
||||||
|
scrape_configs:
|
||||||
|
- job_name: node-exporter
|
||||||
|
relabel_configs:
|
||||||
|
# Add this
|
||||||
|
- action: replace
|
||||||
|
source_labels: [ __meta_kubernetes_pod_node_name]
|
||||||
|
target_label: nodename
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Through a `ServiceMonitor` <!-- omit in toc -->
|
||||||
|
|
||||||
|
If using the Prometheus operator or the Grafana agent in operator mode, the scrape job should instead be configured via a `ServiceMonitor` that will dynamically edit the Prometheus configuration file. In that case, the relabeling has a slightly different syntax:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# File: service-monitor.yaml
|
||||||
|
apiVersion: monitoring.coreos.com/v1
|
||||||
|
kind: ServiceMonitor
|
||||||
|
endpoints:
|
||||||
|
- port: http-metrics
|
||||||
|
relabelings:
|
||||||
|
# Add this
|
||||||
|
- action: replace
|
||||||
|
sourceLabels: [ __meta_kubernetes_node_name]
|
||||||
|
targetLabel: nodename
|
||||||
|
```
|
||||||
|
|
||||||
|
As a convenience, if using the [kube-prometheus-stack helm chart](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack), this added rule can be directly specified in your values.yaml:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# File: kube-prometheus-stack-values.yaml
|
||||||
|
prometheus-node-exporter:
|
||||||
|
prometheus:
|
||||||
|
monitor:
|
||||||
|
relabelings:
|
||||||
|
- action: replace
|
||||||
|
sourceLabels: [__meta_kubernetes_pod_node_name]
|
||||||
|
targetLabel: nodename
|
||||||
|
```
|
||||||
|
|
||||||
|
#### With Grafana Agent Flow mode <!-- omit in toc -->
|
||||||
|
|
||||||
|
The Grafana Agent can [bundle its own node_exporter](https://grafana.com/docs/agent/v0.33/flow/reference/components/prometheus.exporter.unix/). In that case, relabeling can be done this way:
|
||||||
|
|
||||||
|
```river
|
||||||
|
prometheus.exporter.unix {
|
||||||
|
}
|
||||||
|
|
||||||
|
prometheus.scrape "node_exporter" {
|
||||||
|
targets = prometheus.exporter.unix.targets
|
||||||
|
forward_to = [prometheus.relabel.node_exporter.receiver]
|
||||||
|
|
||||||
|
job_name = "node-exporter"
|
||||||
|
}
|
||||||
|
|
||||||
|
prometheus.relabel "node_exporter" {
|
||||||
|
forward_to = [prometheus.remote_write.sink.receiver]
|
||||||
|
|
||||||
|
rule {
|
||||||
|
replacement = env("HOSTNAME")
|
||||||
|
target_label = "nodename"
|
||||||
|
}
|
||||||
|
|
||||||
|
rule {
|
||||||
|
# The default job name is "integrations/node_exporter" and needs to be replaced
|
||||||
|
replacement = "node-exporter"
|
||||||
|
target_label = "job"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
The `HOSTNAME` environment variable is injected by default by the [Grafana Agent helm chart](https://github.com/grafana/agent/blob/93cb1a2718f6fc90fd06ef33b6bcff519dbed662/operations/helm/charts/grafana-agent/templates/containers/_agent.yaml#L25)
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
Feel free to contribute to this project:
|
||||||
|
|
||||||
|
- Give a GitHub ⭐ if you like it
|
||||||
|
- Create an [Issue](https://github.com/dotdc/grafana-dashboards-kubernetes/issues) to make a feature request, report a bug or share an idea.
|
||||||
|
- Create a [Pull Request](https://github.com/dotdc/grafana-dashboards-kubernetes/pulls) if you want to share code or anything useful to this project.
|
||||||
@ -0,0 +1,29 @@
|
|||||||
|
apiVersion: argoproj.io/v1alpha1
|
||||||
|
kind: Application
|
||||||
|
metadata:
|
||||||
|
name: grafana-dashboards-kubernetes
|
||||||
|
namespace: argocd
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: grafana-dashboards-kubernetes
|
||||||
|
app.kubernetes.io/version: HEAD
|
||||||
|
app.kubernetes.io/managed-by: argocd
|
||||||
|
finalizers:
|
||||||
|
- resources-finalizer.argocd.argoproj.io
|
||||||
|
spec:
|
||||||
|
project: default # You may need to change this!
|
||||||
|
source:
|
||||||
|
path: ./
|
||||||
|
repoURL: https://github.com/dotdc/grafana-dashboards-kubernetes
|
||||||
|
targetRevision: HEAD
|
||||||
|
|
||||||
|
destination:
|
||||||
|
server: https://kubernetes.default.svc
|
||||||
|
namespace: monitoring
|
||||||
|
syncPolicy:
|
||||||
|
## https://argo-cd.readthedocs.io/en/stable/user-guide/auto_sync
|
||||||
|
automated:
|
||||||
|
prune: true
|
||||||
|
selfHeal: true
|
||||||
|
syncOptions:
|
||||||
|
- CreateNamespace=true
|
||||||
|
- Replace=true
|
||||||
@ -0,0 +1 @@
|
|||||||
|
*.json
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,43 @@
|
|||||||
|
# Global options
|
||||||
|
generatorOptions:
|
||||||
|
disableNameSuffixHash: true
|
||||||
|
labels:
|
||||||
|
grafana_dashboard: "1"
|
||||||
|
commonAnnotations:
|
||||||
|
grafana_folder: "Kubernetes"
|
||||||
|
#namespace: monitoring
|
||||||
|
|
||||||
|
# Generate a ConfigMap for each dashboard
|
||||||
|
configMapGenerator:
|
||||||
|
|
||||||
|
#################################################
|
||||||
|
# Views Dashboards
|
||||||
|
#################################################
|
||||||
|
|
||||||
|
- name: dashboards-k8s-views-global
|
||||||
|
files: [ dashboards/k8s-views-global.json ]
|
||||||
|
|
||||||
|
- name: dashboards-k8s-views-namespaces
|
||||||
|
files: [ dashboards/k8s-views-namespaces.json ]
|
||||||
|
|
||||||
|
- name: dashboards-k8s-views-nodes
|
||||||
|
files: [ dashboards/k8s-views-nodes.json ]
|
||||||
|
|
||||||
|
- name: dashboards-k8s-views-pods
|
||||||
|
files: [ dashboards/k8s-views-pods.json ]
|
||||||
|
|
||||||
|
#################################################
|
||||||
|
# System / Addons Dashboards
|
||||||
|
#################################################
|
||||||
|
|
||||||
|
- name: dashboards-k8s-system-api-server
|
||||||
|
files: [ dashboards/k8s-system-api-server.json ]
|
||||||
|
|
||||||
|
- name: dashboards-k8s-system-coredns
|
||||||
|
files: [ dashboards/k8s-system-coredns.json ]
|
||||||
|
|
||||||
|
- name: dashboards-k8s-addons-prometheus
|
||||||
|
files: [ dashboards/k8s-addons-prometheus.json ]
|
||||||
|
|
||||||
|
- name: dashboards-k8s-addons-trivy-operator
|
||||||
|
files: [ dashboards/k8s-addons-trivy-operator.json ]
|
||||||
@ -0,0 +1,67 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
# Default version if not provided
|
||||||
|
DEFAULT_VERSION="2.8.2"
|
||||||
|
VERSION=${1:-$DEFAULT_VERSION}
|
||||||
|
|
||||||
|
# Base directory paths
|
||||||
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
DASHBOARDS_DIR="$SCRIPT_DIR/$VERSION/dashboards"
|
||||||
|
OUTPUT_DIR="$SCRIPT_DIR"
|
||||||
|
|
||||||
|
# Validate version directory exists
|
||||||
|
if [[ ! -d "$DASHBOARDS_DIR" ]]; then
|
||||||
|
echo "Error: Version directory '$DASHBOARDS_DIR' does not exist"
|
||||||
|
echo "Available versions:"
|
||||||
|
ls -1 "$SCRIPT_DIR" | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' || echo " No version directories found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Validate dashboards exist
|
||||||
|
if [[ ! -d "$DASHBOARDS_DIR" ]] || [[ -z "$(ls -A "$DASHBOARDS_DIR"/*.json 2>/dev/null)" ]]; then
|
||||||
|
echo "Error: No JSON dashboard files found in '$DASHBOARDS_DIR'"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Generating ConfigMaps from dashboard files in version $VERSION..."
|
||||||
|
|
||||||
|
# Process each JSON file in the dashboards directory
|
||||||
|
for json_file in "$DASHBOARDS_DIR"/*.json; do
|
||||||
|
if [[ ! -f "$json_file" ]]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Extract filename without extension
|
||||||
|
filename=$(basename "$json_file" .json)
|
||||||
|
|
||||||
|
# Generate ConfigMap name by replacing underscores with hyphens
|
||||||
|
configmap_name="${filename//_/-}-dashboard"
|
||||||
|
|
||||||
|
# Output YAML file path
|
||||||
|
yaml_file="$OUTPUT_DIR/$filename.yaml"
|
||||||
|
|
||||||
|
echo "Processing: $json_file -> $yaml_file"
|
||||||
|
|
||||||
|
# Generate ConfigMap YAML
|
||||||
|
cat > "$yaml_file" << EOF
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: $configmap_name
|
||||||
|
namespace: freeleaps-monitoring-system
|
||||||
|
labels:
|
||||||
|
grafana_dashboard: "1"
|
||||||
|
data:
|
||||||
|
$filename.json: |-
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Add JSON content with proper indentation
|
||||||
|
sed 's/^/ /' "$json_file" >> "$yaml_file"
|
||||||
|
|
||||||
|
echo "Generated: $yaml_file"
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "ConfigMap generation completed for version $VERSION"
|
||||||
|
echo "Generated files are located in: $OUTPUT_DIR"
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user