Skip to content

Commit

Permalink
chore(templates): simpler alert file naming (#12)
Browse files Browse the repository at this point in the history
* chore(templates): simpler alert file naming

* chore(gh-actions): remove chart tests

* Automatic application of license header

* fix(gh-action): chart dir

* fix(values.yaml): trailing spaces

* chore(Chart.yaml): remove source

---------

Co-authored-by: License Bot <[email protected]>
  • Loading branch information
richardtief and License Bot authored Oct 17, 2024
1 parent e112789 commit 55d7046
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/configs/helm-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ target-branch: main
validate-maintainers: false
check-version-increment: false
chart-dirs:
- charts/kubernetes-operations
- charts
8 changes: 0 additions & 8 deletions .github/workflows/helm-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,6 @@ jobs:
if: steps.list-changed.outputs.changed == 'true'
run: ct lint --config .github/configs/helm-lint.yaml --target-branch ${{ github.event.repository.default_branch }}

- name: Run chart-testing (list-changed)
id: chart-test-list-changed
run: |
changed=$(ct list-changed --config .github/configs/helm-test.yaml --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Check version bump
id: check-bump
if: steps.list-changed.outputs.changed == 'true'
Expand Down
4 changes: 1 addition & 3 deletions charts/kubernetes-operations/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@

apiVersion: v2
name: kubernetes-operations
version: 1.0.0
version: 1.1.0
description: A set of Plutono dashboards and Prometheus alerting rules combined with playbooks to ensure effective operations of Kubernetes.
maintainers:
- name: Richard Tief (I520251)
email: [email protected]
sources:
- ghcr.io/cloudoperators/kubernetes-operations
keywords:
- Helm Chart
- Kubernetes operations
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors
# SPDX-License-Identifier: Apache-2.0

groups:
- name: kubernetes-apiserver
rules:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors
# SPDX-License-Identifier: Apache-2.0

groups:
- name: kubernetes-health
rules:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors
# SPDX-License-Identifier: Apache-2.0

groups:
- name: kubernetes-kubelet
rules:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors
# SPDX-License-Identifier: Apache-2.0

groups:
- name: kubernetes-node
rules:
Expand Down
7 changes: 5 additions & 2 deletions charts/kubernetes-operations/plugindefinition.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors
# SPDX-License-Identifier: Apache-2.0

# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and cobaltcore-dev contributors
# SPDX-License-Identifier: Apache-2.0

Expand All @@ -6,15 +9,15 @@ kind: PluginDefinition
metadata:
name: kubernetes-operations
spec:
version: 1.0.0
version: 1.1.0
displayName: Kubernetes operations bundle
description: Operations bundle for Kubernetes
docMarkDownUrl: https://raw.githubusercontent.com/cloudoperators/kubernetes-operations/main/README.md
icon: https://raw.githubusercontent.com/cloudoperators/kubernetes-operations/main/charts/kubernetes-operations/kubernetes-logo.png
helmChart:
name: kubernetes-operations
repository: oci://ghcr.io/cloudoperators/kubernetes-operations/charts
version: 1.0.0
version: 1.1.0
options:
- name: prometheusRules.create
description: Create Prometheus rules
Expand Down
4 changes: 2 additions & 2 deletions charts/kubernetes-operations/templates/alerts.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{{- if .Values.prometheusRules.create -}}
{{- $root := . -}}
{{- range $path, $bytes := .Files.Glob "alerts/*.alerts.tpl" }}
{{- range $path, $bytes := .Files.Glob "alerts/*.yaml" }}
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: {{ printf "%s-%s" $.Release.Name $path | replace "/" "-" | replace "." "-" | trimSuffix "-tpl" | replace "-alerts-" "-" | trunc 63 }}
name: {{ printf "%s-%s" $.Release.Name $path | replace "/" "-" | trimSuffix "-yaml" | trunc 63 }}
labels:
{{ include "kubernetes-operations.ruleSelectorLabels" (list $path $root) | indent 4 }}
{{ include "kubernetes-operations.labels" (list $path $root) | indent 4 }}
Expand Down
4 changes: 2 additions & 2 deletions charts/kubernetes-operations/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ global:
## C default rules for monitoring the cluster
##
prometheusRules:
## Enables PrometheusRule resources to be created

## Enables PrometheusRule resources to be created
create: true

## Label selectors for the Prometheus rules to be picked up by Prometheus.
Expand Down

0 comments on commit 55d7046

Please sign in to comment.