-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Pete Wall <[email protected]>
- Loading branch information
Showing
16 changed files
with
330 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
name: Bump dependency "kepler" for Helm chart "k8s-monitoring" | ||
sources: | ||
kepler: | ||
name: Get latest "kepler" Helm chart version | ||
kind: helmchart | ||
spec: | ||
name: kepler | ||
url: https://sustainable-computing-io.github.io/kepler-helm-chart | ||
versionfilter: | ||
kind: semver | ||
pattern: '*' | ||
|
||
conditions: | ||
kepler: | ||
name: Ensure Helm chart dependency "kepler" is specified | ||
kind: yaml | ||
spec: | ||
file: charts/k8s-monitoring/Chart.yaml | ||
key: $.dependencies[9].name | ||
value: kepler | ||
disablesourceinput: true | ||
|
||
targets: | ||
kepler: | ||
name: Bump Helm chart dependency "kepler" for Helm chart "k8s-monitoring" | ||
kind: helmchart | ||
spec: | ||
file: Chart.yaml | ||
key: $.dependencies[9].version | ||
name: charts/k8s-monitoring | ||
versionincrement: none | ||
sourceid: kepler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ jobs: | |
- name: Run Updatecli | ||
id: update-alloy | ||
run: | | ||
updatecli apply --config ${UPDATECLI_CONFIG_DIR}/alloy.yaml | ||
updatecli apply --config "${UPDATECLI_CONFIG_DIR}/alloy.yaml" | ||
if ! git diff --exit-code > /dev/null; then | ||
echo "changed=true" >> "${GITHUB_OUTPUT}" | ||
fi | ||
|
@@ -62,6 +62,52 @@ jobs: | |
branch: chore/update-grafana-alloy | ||
delete-branch: true | ||
|
||
updateKepler: | ||
name: Update Kepler | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Updatecli | ||
uses: updatecli/updatecli-action@v2 | ||
|
||
- name: Run Updatecli | ||
id: update-kepler | ||
run: | | ||
updatecli apply --config "${UPDATECLI_CONFIG_DIR}/kepler.yaml" | ||
if ! git diff --exit-code > /dev/null; then | ||
echo "changed=true" >> "${GITHUB_OUTPUT}" | ||
fi | ||
- name: Regenerate docs | ||
if: steps.update-kepler.outputs.changed == 'true' | ||
run: docker run --rm -v "$(pwd)/charts/k8s-monitoring:/helm-docs" -u "$(id -u)" jnorwood/helm-docs | ||
|
||
- name: Install Helm | ||
if: steps.update-kepler.outputs.changed == 'true' | ||
uses: azure/setup-helm@v4 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Regenerate examples | ||
if: steps.update-kepler.outputs.changed == 'true' | ||
run: make regenerate-example-outputs | ||
|
||
- name: Create pull request | ||
if: steps.update-kepler.outputs.changed == 'true' | ||
uses: peter-evans/create-pull-request@v6 | ||
with: | ||
title: "[dependency] Update Kepler" | ||
body: "Updates the Kepler subchart" | ||
base: main | ||
author: "${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>" | ||
committer: "GitHub <[email protected]>" | ||
commit-message: Update Kepler | ||
labels: dependencies | ||
branch: chore/update-kepler | ||
delete-branch: true | ||
|
||
updateKubeStateMetrics: | ||
name: Update Kube State Metrics | ||
runs-on: "ubuntu-latest" | ||
|
@@ -75,7 +121,7 @@ jobs: | |
- name: Run Updatecli | ||
id: update-kube-state-metrics | ||
run: | | ||
updatecli apply --config ${UPDATECLI_CONFIG_DIR}/kube-state-metrics.yaml | ||
updatecli apply --config "${UPDATECLI_CONFIG_DIR}/kube-state-metrics.yaml" | ||
if ! git diff --exit-code > /dev/null; then | ||
echo "changed=true" >> "${GITHUB_OUTPUT}" | ||
fi | ||
|
@@ -121,7 +167,7 @@ jobs: | |
- name: Run Updatecli | ||
id: update-node-exporter | ||
run: | | ||
updatecli apply --config ${UPDATECLI_CONFIG_DIR}/node-exporter.yaml | ||
updatecli apply --config "${UPDATECLI_CONFIG_DIR}/node-exporter.yaml" | ||
if ! git diff --exit-code > /dev/null; then | ||
echo "changed=true" >> "${GITHUB_OUTPUT}" | ||
fi | ||
|
@@ -167,7 +213,7 @@ jobs: | |
- name: Run Updatecli | ||
id: update-opencost | ||
run: | | ||
updatecli apply --config ${UPDATECLI_CONFIG_DIR}/opencost.yaml | ||
updatecli apply --config "${UPDATECLI_CONFIG_DIR}/opencost.yaml" | ||
if ! git diff --exit-code > /dev/null; then | ||
echo "changed=true" >> "${GITHUB_OUTPUT}" | ||
fi | ||
|
@@ -213,7 +259,7 @@ jobs: | |
- name: Run Updatecli | ||
id: update-prometheus-operator-crds | ||
run: | | ||
updatecli apply --config ${UPDATECLI_CONFIG_DIR}/prometheus-operator-crds.yaml | ||
updatecli apply --config "${UPDATECLI_CONFIG_DIR}/prometheus-operator-crds.yaml" | ||
if ! git diff --exit-code > /dev/null; then | ||
echo "changed=true" >> "${GITHUB_OUTPUT}" | ||
fi | ||
|
@@ -259,7 +305,7 @@ jobs: | |
- name: Run Updatecli | ||
id: update-windows-exporter | ||
run: | | ||
updatecli apply --config ${UPDATECLI_CONFIG_DIR}/windows-exporter.yaml | ||
updatecli apply --config "${UPDATECLI_CONFIG_DIR}/windows-exporter.yaml" | ||
if ! git diff --exit-code > /dev/null; then | ||
echo "changed=true" >> "${GITHUB_OUTPUT}" | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
# The minimal set of metrics from Kepler required for Kubernetes Monitoring | ||
- kepler_.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{{ define "alloy.config.kepler.allowList" }} | ||
{{ if .Values.metrics.kepler.metricsTuning.useDefaultAllowList }} | ||
{{ "default_allow_lists/kepler.yaml" | .Files.Get }} | ||
{{ end }} | ||
{{ if .Values.metrics.kepler.metricsTuning.includeMetrics }} | ||
{{ .Values.metrics.kepler.metricsTuning.includeMetrics | toYaml }} | ||
{{ end }} | ||
{{ end }} | ||
|
||
{{ define "alloy.config.kepler" }} | ||
// Kepler | ||
discovery.relabel "kepler" { | ||
targets = discovery.kubernetes.pods.targets | ||
{{- range $k, $v := .Values.metrics.kepler.labelMatchers }} | ||
rule { | ||
source_labels = ["__meta_kubernetes_pod_label_{{ include "escape_label" $k }}"] | ||
regex = "{{ $v }}" | ||
action = "keep" | ||
} | ||
{{- end }} | ||
rule { | ||
source_labels = ["__meta_kubernetes_pod_node_name"] | ||
action = "replace" | ||
target_label = "instance" | ||
} | ||
{{- if .Values.metrics.extraRelabelingRules }} | ||
{{ .Values.metrics.extraRelabelingRules | indent 2 }} | ||
{{- end }} | ||
{{- if .Values.metrics.kepler.extraRelabelingRules }} | ||
{{ .Values.metrics.kepler.extraRelabelingRules | indent 2 }} | ||
{{- end }} | ||
} | ||
|
||
prometheus.scrape "kepler" { | ||
targets = discovery.relabel.kepler.output | ||
job_name = "integrations/kepler" | ||
honor_labels = true | ||
scrape_interval = {{ .Values.metrics.kepler.scrapeInterval | default .Values.metrics.scrapeInterval | quote }} | ||
{{- if .Values.alloy.alloy.clustering.enabled }} | ||
clustering { | ||
enabled = true | ||
} | ||
{{- end }} | ||
forward_to = [prometheus.relabel.kepler.receiver] | ||
} | ||
|
||
prometheus.relabel "kepler" { | ||
max_cache_size = {{ .Values.metrics.kepler.maxCacheSize | default .Values.metrics.maxCacheSize | int }} | ||
{{- if or .Values.metrics.kepler.metricsTuning.useDefaultAllowList .Values.metrics.kepler.metricsTuning.includeMetrics }} | ||
rule { | ||
source_labels = ["__name__"] | ||
regex = "up|{{ join "|" (include "alloy.config.kepler.allowList" . | fromYamlArray) }}" | ||
action = "keep" | ||
} | ||
{{- end }} | ||
{{- if .Values.metrics.kepler.metricsTuning.excludeMetrics }} | ||
rule { | ||
source_labels = ["__name__"] | ||
regex = {{ join "|" .Values.metrics.kepler.metricsTuning.excludeMetrics | quote }} | ||
action = "drop" | ||
} | ||
{{- end }} | ||
{{- if .Values.metrics.extraMetricRelabelingRules }} | ||
{{ .Values.metrics.extraMetricRelabelingRules | indent 2 }} | ||
{{- end }} | ||
{{- if .Values.metrics.kepler.extraMetricRelabelingRules }} | ||
{{ .Values.metrics.kepler.extraMetricRelabelingRules | indent 2 }} | ||
{{- end }} | ||
forward_to = [prometheus.relabel.metrics_service.receiver] | ||
} | ||
{{ end }} |
Oops, something went wrong.