Skip to content

Commit c1eb6e8

Browse files
authored
Add helm-docs + helm-lint + clean up (#38)
* feat(gitignore): ✨ add .gitignore for GitHub Actions testing * Include configuration for testing GitHub Actions locally. * Ignore `act_pull_request.json` and `bin` directory. Signed-off-by: Akshay Iyyadurai Balasundaram <akshay.iyyadurai.balasundaram@sap.com> * feat(charts): ✨ update ceph-operations chart to version 1.6.0 * Added new maintainers: `richardtief` * Updated `README.md` and `README.md.gotmpl` for better documentation * Introduced new `helm-lint.yaml` and `helm-docs.yaml` workflows for CI * Enhanced `ceph-capacity-quick-view.json` with datasource configurations * Removed outdated `README.md` from `ceph-operations` directory * Updated `plugindefinition.yaml` and `values.yaml` for consistency Signed-off-by: Akshay Iyyadurai Balasundaram <akshay.iyyadurai.balasundaram@sap.com> --------- Signed-off-by: Akshay Iyyadurai Balasundaram <akshay.iyyadurai.balasundaram@sap.com>
1 parent 342c4f4 commit c1eb6e8

12 files changed

Lines changed: 281 additions & 47 deletions

File tree

.github/configs/helm-lint.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# SPDX-FileCopyrightText: 2025 SAP SE or an SAP affiliate company and Greenhouse contributors
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# See https://github.com/helm/chart-testing#configuration
5+
remote: origin
6+
target-branch: main
7+
validate-maintainers: true
8+
check-version-increment: true
9+
chart-dirs:
10+
- charts

.github/workflows/helm-docs.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: "Helm Docs Check"
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
paths:
7+
- "charts/ceph-operations/values.yaml"
8+
9+
jobs:
10+
helm-docs-check:
11+
runs-on: [default]
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
15+
with:
16+
fetch-depth: 0
17+
token: ${{ secrets.GITHUB_TOKEN }}
18+
19+
- name: Set up go environment
20+
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5
21+
with:
22+
go-version: "stable"
23+
24+
- name: Generate README.md using Helm Docs
25+
id: generate-readme
26+
run: |
27+
echo "Generating README.md for charts/ceph-operations..."
28+
make generate-readme
29+
30+
if git diff --quiet -- README.md; then
31+
echo "README.md is already up-to-date."
32+
echo "outdated=false" >> "$GITHUB_OUTPUT"
33+
else
34+
echo "README.md has changed."
35+
echo "outdated=true" >> "$GITHUB_OUTPUT"
36+
fi
37+
38+
- name: Helm-Docs Check
39+
if: steps.generate-readme.outputs.outdated == 'true'
40+
run: |
41+
echo "::error file=README.md::README.md is outdated. Please run 'make generate-readme' and update the PR."
42+
exit 1

.github/workflows/helm-lint.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: "Helm lint and tests"
2+
on:
3+
pull_request:
4+
types: [opened, synchronize, reopened]
5+
6+
env:
7+
REGISTRY: ghcr.io
8+
9+
jobs:
10+
helm-lint-test:
11+
runs-on: [default]
12+
steps:
13+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
14+
with:
15+
fetch-depth: 0
16+
token: ${{ secrets.GITHUB_TOKEN }}
17+
18+
- name: Set up Helm
19+
uses: azure/setup-helm@b9e51907a09c216f16ebe8536097933489208112 # v4.3.0
20+
21+
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5
22+
with:
23+
python-version: 3.9
24+
check-latest: true
25+
token: ${{ secrets.GITHUB_TOKEN }}
26+
27+
- name: Set up chart-linting and chart-testing
28+
uses: helm/chart-testing-action@0d28d3144d3a25ea2cc349d6e59901c4ff469b3b # v2.7.0
29+
30+
- name: Run chart-linting (list-changed)
31+
id: list-changed
32+
run: |
33+
changed=$(ct list-changed --config .github/configs/helm-lint.yaml --target-branch ${{ github.event.repository.default_branch }})
34+
if [[ -n "$changed" ]]; then
35+
echo "changed=true" >> "$GITHUB_OUTPUT"
36+
fi
37+
38+
- name: Run chart-linting
39+
if: steps.list-changed.outputs.changed == 'true'
40+
run: ct lint --config .github/configs/helm-lint.yaml --target-branch ${{ github.event.repository.default_branch }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# config file for testing GitHub Actions locally
2+
act_pull_request.json
3+
bin

Makefile

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Detect OS (Linux/macOS)
2+
OS := $(shell uname -s | tr '[:upper:]' '[:lower:]')
3+
4+
# Detect ARCH (AMD64 or ARM64)
5+
UNAME_M := $(shell uname -m)
6+
7+
## Location to install dependencies to
8+
LOCALBIN ?= $(shell pwd)/bin
9+
$(LOCALBIN):
10+
mkdir -p $(LOCALBIN)
11+
KUSTOMIZE ?= $(LOCALBIN)/kustomize
12+
YQ ?= $(LOCALBIN)/yq
13+
HELM_DOCS_VERSION ?= 1.14.2
14+
HELM_DOCS_REPO ?= https://github.com/norwoodj/helm-docs/releases/download/v$(HELM_DOCS_VERSION)/helm-docs_$(HELM_DOCS_VERSION)_$(OS)_$(UNAME_M).tar.gz
15+
16+
17+
## Download `helm-docs` locally if necessary
18+
.PHONY: helm-docs
19+
helm-docs: $(LOCALBIN)
20+
@if test -x $(LOCALBIN)/helm-docs && ! $(LOCALBIN)/helm-docs -v | grep -q $(HELM_DOCS_VERSION); then \
21+
echo "$(LOCALBIN)/helm-docs -v is not expected $(HELM_DOCS_VERSION). Removing it before installing."; \
22+
rm -f $(LOCALBIN)/helm-docs; \
23+
fi
24+
25+
@# Download and install helm-docs if not present
26+
@if [ ! -s "$(LOCALBIN)/helm-docs" ]; then \
27+
echo "Downloading helm-docs $(HELM_DOCS_VERSION) to $(LOCALBIN)"; \
28+
curl -L -f $(HELM_DOCS_REPO) -o $(LOCALBIN)/helm-docs.tar.gz; \
29+
tar -xzf $(LOCALBIN)/helm-docs.tar.gz -C $(LOCALBIN) helm-docs; \
30+
rm $(LOCALBIN)/helm-docs.tar.gz; \
31+
chmod +x $(LOCALBIN)/helm-docs; \
32+
fi
33+
34+
.PHONY: generate-readme
35+
generate-readme: helm-docs
36+
@$(LOCALBIN)/helm-docs -c charts/ceph-operations -o ../../README.md -t ../../README.md.gotmpl
37+
38+
.PHONY: lint
39+
lint:
40+
ct lint --config .github/configs/helm-lint.yaml

README.md

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,46 @@ cloud-storage-operations
3333
3434
├── perses-dashboards-global/ Perses dashboards for visualizing global metrics.
3535
36-
├── playbooks/ Step-by-step instructions for troubleshooting.
36+
├── playbooks/ Step-by-step instructions for troubleshooting.
3737
3838
├── Chart.yaml Helm chart manifest.
3939
40-
└── plugindefintion.yaml Links the Helm chart to the Greenhouse platform.
40+
└── plugindefintion.yaml Links the Helm chart to the Greenhouse platform.
4141
4242
```
4343

44+
## Values
45+
46+
| Key | Type | Default | Description |
47+
|-----|------|---------|-------------|
48+
| dashboards.create | bool | `true` | Enables ConfigMap resources with dashboards to be created |
49+
| dashboards.dashboardSelectors | list | `[{"name":"plutono-dashboard","value":"\"true\""}]` | Label selectors for the Plutono dashboards to be picked up by Plutono. |
50+
| dashboards.global.create | bool | `false` | Enables ConfigMap resources with global dashboards to be created |
51+
| dashboards.global.dashboardSelectors | list | `[{"name":"plutono-global","value":"\"true\""}]` | Label selectors for the global Plutono dashboards to be picked up by the global Plutono. |
52+
| dashboards.global.persesDashboardSelectors | list | `[{"name":"perses.dev/global-resource","value":"\"true\""}]` | Label selectors for the global Perses dashboards to be picked up by the global Perses. |
53+
| global.commonLabels | object | `{}` | Common labels to add to all resources # |
54+
| persesDashboards.create | bool | `true` | Enables ConfigMap resources with perses dashboards to be created |
55+
| persesDashboards.dashboardSelectors | list | `[{"name":"perses.dev/resource","value":"\"true\""}]` | Label selectors for the Plutono dashboards to be picked up by Plutono. |
56+
| prometheusRules.additionalRuleAnnotations | object | `{}` | Additional annotations for PrometheusRule alerts |
57+
| prometheusRules.additionalRuleLabels | string | `nil` | Additional labels for PrometheusRule alerts # This is useful for adding additional labels such as "support_group" or "service" for the routing of alerts to each rule |
58+
| prometheusRules.annotations | object | `{}` | Annotations for PrometheusRules |
59+
| prometheusRules.create | bool | `true` | Enables PrometheusRule resources to be created |
60+
| prometheusRules.disabled | object | `{"CephAPodNodePGImbalance":true,"CephNodeInconsistentMTU":true,"CephStorageNodePGImbalance":true}` | Disables specific PrometheusRule alerts |
61+
| prometheusRules.labels | object | `{}` | Labels for PrometheusRules |
62+
| prometheusRules.ruleGroups.absentMetrics | bool | `true` | |
63+
| prometheusRules.ruleGroups.clusterHealth | bool | `true` | |
64+
| prometheusRules.ruleGroups.customrules | bool | `true` | |
65+
| prometheusRules.ruleGroups.generic | bool | `true` | |
66+
| prometheusRules.ruleGroups.healthChecks | bool | `true` | |
67+
| prometheusRules.ruleGroups.manager | bool | `false` | |
68+
| prometheusRules.ruleGroups.mon | bool | `true` | |
69+
| prometheusRules.ruleGroups.nodes | bool | `true` | |
70+
| prometheusRules.ruleGroups.osd | bool | `true` | |
71+
| prometheusRules.ruleGroups.pgr | bool | `true` | |
72+
| prometheusRules.ruleGroups.pools | bool | `true` | |
73+
| prometheusRules.ruleGroups.rados | bool | `true` | |
74+
| prometheusRules.ruleSelectors | string | `nil` | |
75+
4476
## Support, Feedback, Contributing
4577

4678
This project is open to feature requests/suggestions, bug reports etc. via [GitHub issues](https://github.com/cobaltcore-dev/cloud-storage-operations/issues). Contribution and feedback are encouraged and always welcome. For more information about how to contribute, the project structure, as well as additional contribution information, see our [Contribution Guidelines](CONTRIBUTING.md).

README.md.gotmpl

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<!--
2+
# SPDX-FileCopyrightText: Copyright 2024 SAP SE or an SAP affiliate company and cobaltcore-dev contributors
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
-->
6+
7+
# Cloud storage operations
8+
9+
[![REUSE status](https://api.reuse.software/badge/github.com/cobaltcore-dev/cloud-storage-operations)](https://api.reuse.software/info/github.com/cobaltcore-dev/cloud-storage-operations)
10+
11+
This repository contains packaged resources and configuration related to the operations of the vendor-neutral cloud storage backend within the ApeiroRA project.
12+
13+
# Content
14+
15+
The content is structured as follows:
16+
17+
```
18+
cloud-storage-operations
19+
20+
└── charts/
21+
22+
└── ceph-operations
23+
24+
├── aggregations/ Prometheus aggregation rules for kubernetes.
25+
26+
├── alerts/ Prometheus alerts for kubernetes.
27+
28+
├── dashboards/ Plutono dashboards for visualizing key metrics.
29+
|
30+
├── dashboards-global/ Plutono dashboards for visualizing global metrics.
31+
32+
├── perses-dashboards/ Perses dashboards for visualizing key metrics.
33+
34+
├── perses-dashboards-global/ Perses dashboards for visualizing global metrics.
35+
36+
├── playbooks/ Step-by-step instructions for troubleshooting.
37+
38+
├── Chart.yaml Helm chart manifest.
39+
40+
└── plugindefintion.yaml Links the Helm chart to the Greenhouse platform.
41+
42+
```
43+
44+
{{ template "chart.valuesSection" . }}
45+
46+
## Support, Feedback, Contributing
47+
48+
This project is open to feature requests/suggestions, bug reports etc. via [GitHub issues](https://github.com/cobaltcore-dev/cloud-storage-operations/issues). Contribution and feedback are encouraged and always welcome. For more information about how to contribute, the project structure, as well as additional contribution information, see our [Contribution Guidelines](CONTRIBUTING.md).
49+
50+
## Security / Disclosure
51+
If you find any bug that may be a security problem, please follow our instructions at [in our security policy](https://github.com/cobaltcore-dev/cloud-storage-operations/security/policy) on how to report it. Please do not create GitHub issues for security-related doubts or problems.
52+
53+
## Code of Conduct
54+
55+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone. By participating in this project, you agree to abide by its [Code of Conduct](https://github.com/SAP/.github/blob/main/CODE_OF_CONDUCT.md) at all times.
56+
57+
## Licensing
58+
59+
Copyright 2024 SAP SE or an SAP affiliate company and cobaltcore-dev contributors. Please see our [LICENSE](LICENSE) for copyright and license information. Detailed information including third-party components and their licensing/copyright information is available [via the REUSE tool](https://api.reuse.software/info/github.com/cobaltcore-dev/cloud-storage-operations).

charts/ceph-operations/Chart.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,9 @@ apiVersion: v2
22
name: ceph-operations
33
description: Ceph operations bundle
44
type: application
5-
version: 1.6.3
5+
version: 1.6.4
6+
maintainers:
7+
- name: sumitarora2786
8+
- name: richardtief
9+
- name: ibakshay
10+

charts/ceph-operations/README.md

Lines changed: 0 additions & 26 deletions
This file was deleted.

charts/ceph-operations/perses-dashboards-global/ceph-capacity-quick-view.json

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@
123123
"plugin": {
124124
"kind": "PrometheusTimeSeriesQuery",
125125
"spec": {
126+
"datasource": {
127+
"kind": "PrometheusDatasource",
128+
"name": "thanos-global-st1-eu-de-1-query"
129+
},
126130
"minStep": "",
127131
"query": "ceph_cluster_total_bytes",
128132
"seriesNameFormat": ""
@@ -136,6 +140,10 @@
136140
"plugin": {
137141
"kind": "PrometheusTimeSeriesQuery",
138142
"spec": {
143+
"datasource": {
144+
"kind": "PrometheusDatasource",
145+
"name": "thanos-global-st1-eu-de-1-query"
146+
},
139147
"minStep": "",
140148
"query": "ceph_cluster_total_used_bytes",
141149
"seriesNameFormat": ""
@@ -149,6 +157,10 @@
149157
"plugin": {
150158
"kind": "PrometheusTimeSeriesQuery",
151159
"spec": {
160+
"datasource": {
161+
"kind": "PrometheusDatasource",
162+
"name": "thanos-global-st1-eu-de-1-query"
163+
},
152164
"minStep": "",
153165
"query": "1 - (ceph_cluster_total_bytes - ceph_cluster_total_used_bytes) / ceph_cluster_total_bytes",
154166
"seriesNameFormat": ""
@@ -259,6 +271,9 @@
259271
"plugin": {
260272
"kind": "PrometheusTimeSeriesQuery",
261273
"spec": {
274+
"datasource": {
275+
"kind": "PrometheusDatasource"
276+
},
262277
"minStep": "",
263278
"query": "(max(global:limes_consolidated_cluster_capacity{full_resource=~\"ceph/(.*)\"}) by (region) *\n max(global:limes_consolidated_unit_multiplier{full_resource=~\"ceph/(.*)\"}) by (region))",
264279
"seriesNameFormat": ""
@@ -272,6 +287,9 @@
272287
"plugin": {
273288
"kind": "PrometheusTimeSeriesQuery",
274289
"spec": {
290+
"datasource": {
291+
"kind": "PrometheusDatasource"
292+
},
275293
"minStep": "",
276294
"query": "(sum(global:limes_consolidated_domain_quota{full_resource=~\"ceph/(.*)\"}) by (region) *\n max(global:limes_consolidated_unit_multiplier{full_resource=~\"ceph/(.*)\"}) by (region))",
277295
"seriesNameFormat": ""
@@ -285,6 +303,9 @@
285303
"plugin": {
286304
"kind": "PrometheusTimeSeriesQuery",
287305
"spec": {
306+
"datasource": {
307+
"kind": "PrometheusDatasource"
308+
},
288309
"minStep": "",
289310
"query": "(max(global:limes_consolidated_cluster_capacity{full_resource=~\"ceph/(.*)\"}) by (region) *\n max(global:limes_consolidated_unit_multiplier{full_resource=~\"ceph/(.*)\"}) by (region)) -\n(sum(global:limes_consolidated_domain_quota{full_resource=~\"ceph/(.*)\"}) by (region) *\n max(global:limes_consolidated_unit_multiplier{full_resource=~\"ceph/(.*)\"}) by (region))",
290311
"seriesNameFormat": ""
@@ -298,6 +319,9 @@
298319
"plugin": {
299320
"kind": "PrometheusTimeSeriesQuery",
300321
"spec": {
322+
"datasource": {
323+
"kind": "PrometheusDatasource"
324+
},
301325
"minStep": "",
302326
"query": "(sum(global:limes_consolidated_domain_usage{full_resource=~\"ceph/(.*)\"}) by (region) *\n max(global:limes_consolidated_unit_multiplier{full_resource=~\"ceph/(.*)\"}) by (region))",
303327
"seriesNameFormat": ""
@@ -311,6 +335,9 @@
311335
"plugin": {
312336
"kind": "PrometheusTimeSeriesQuery",
313337
"spec": {
338+
"datasource": {
339+
"kind": "PrometheusDatasource"
340+
},
314341
"minStep": "",
315342
"query": "(sum(global:limes_consolidated_domain_quota{full_resource=~\"ceph/(.*)\"}) by (region) *\n max(global:limes_consolidated_unit_multiplier{full_resource=~\"ceph/(.*)\"}) by (region)) / (max(global:limes_consolidated_cluster_capacity{full_resource=~\"ceph/(.*)\"}) by (region) *\n max(global:limes_consolidated_unit_multiplier{full_resource=~\"ceph/(.*)\"}) by (region))",
316343
"seriesNameFormat": ""
@@ -324,6 +351,9 @@
324351
"plugin": {
325352
"kind": "PrometheusTimeSeriesQuery",
326353
"spec": {
354+
"datasource": {
355+
"kind": "PrometheusDatasource"
356+
},
327357
"minStep": "",
328358
"query": "(sum(global:limes_consolidated_domain_usage{full_resource=~\"ceph/(.*)\"}) by (region) *\n max(global:limes_consolidated_unit_multiplier{full_resource=~\"ceph/(.*)\"}) by (region)) / (max(global:limes_consolidated_cluster_capacity{full_resource=~\"ceph/(.*)\"}) by (region) *\n max(global:limes_consolidated_unit_multiplier{full_resource=~\"ceph/(.*)\"}) by (region))",
329359
"seriesNameFormat": ""
@@ -364,7 +394,6 @@
364394
],
365395
"variables": [],
366396
"duration": "1h",
367-
"refreshInterval": "0s",
368-
"datasources": {}
397+
"refreshInterval": "0s"
369398
}
370399
}

0 commit comments

Comments
 (0)