Skip to content

Commit cdd8cf1

Browse files
committed
Fix remote config secret environment variable and telemetry services deployment notes
Signed-off-by: Pete Wall <pete.wall@grafana.com>
1 parent 55d4c93 commit cdd8cf1

File tree

8 files changed

+148
-1
lines changed

8 files changed

+148
-1
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{{- define "telemetry-services.notes.deployments" }}
2+
{{- if dig "node-exporter" "deploy" false . }}
3+
* Node Exporter (daemonset)
4+
{{- end }}
5+
{{- if dig "windows-exporter" "deploy" false . }}
6+
* Windows Exporter (daemonset)
7+
{{- end }}
8+
{{- if dig "kube-state-metrics" "deploy" false . }}
9+
* kube-state-metrics (deployment)
10+
{{- end }}
11+
{{- if dig "kepler" "deploy" false . }}
12+
* Kepler (daemonset)
13+
{{- end }}
14+
{{- if dig "opencost" "deploy" false . }}
15+
* OpenCost (deployment)
16+
{{- end }}
17+
{{- end }}

charts/k8s-monitoring/docs/examples/instrumentation-hub/output.yaml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

charts/k8s-monitoring/docs/examples/remote-config/output.yaml

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

charts/k8s-monitoring/templates/NOTES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ This chart will install the following components:
88
{{- include (printf "feature.%s.notes.deployments" $feature) (dict "Values" (index $.Values $feature)) | indent 0 }}
99
{{- end }}
1010
{{- include "collectors.notes.deployments" . }}
11+
{{- include "telemetry-services.notes.deployments" (index .Values "telemetry-services" | default dict) }}
1112

1213
It will:
1314
{{- $isTranslating := false }}

charts/k8s-monitoring/templates/collectors/_collector_remoteConfig.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
{{- end }}
2020

2121
{{- if eq (include "collectors.hasExtraEnv" (deepCopy $ | merge (dict "collectorName" $collectorName "envVarName" "GCLOUD_RW_API_KEY"))) "false" }}
22-
{{- $remoteConfigValues := merge ((get $.Values.collectors $collectorName).remoteConfig) (dict "type" "remoteConfig") }}
22+
{{- $remoteConfigValues := merge (dict "type" "remoteConfig") (get $collectorValues "remoteConfig") }}
2323
{{- if eq (include "secrets.usesKubernetesSecret" $remoteConfigValues ) "true" }}
2424
{{- $secretName := include "secrets.kubernetesSecretName" (dict "Values" $.Values "Chart" $.Chart "Release" $.Release "object" $remoteConfigValues "name" (printf "%s-remote-cfg" $collectorName)) }}
2525
{{- $secretKey := include "secrets.getSecretKey" (dict "object" $remoteConfigValues "key" "auth.password") }}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
should list all telemetry services when all are enabled:
2+
1: |
3+
|
4+
Grafana k8s-monitoring Helm chart deployed!
5+
6+
This chart will install the following components:
7+
* Grafana Alloy Operator
8+
* Grafana Alloy "my-collector" (daemonset)
9+
* Node Exporter (daemonset)
10+
* Windows Exporter (daemonset)
11+
* kube-state-metrics (deployment)
12+
* Kepler (daemonset)
13+
* OpenCost (deployment)
14+
15+
It will:
16+
should list node-exporter and windows-exporter:
17+
1: |
18+
|
19+
Grafana k8s-monitoring Helm chart deployed!
20+
21+
This chart will install the following components:
22+
* Grafana Alloy Operator
23+
* Grafana Alloy "my-collector" (daemonset)
24+
* Node Exporter (daemonset)
25+
* Windows Exporter (daemonset)
26+
27+
It will:
28+
should list nothing when all telemetry services are disabled:
29+
1: |
30+
|
31+
Grafana k8s-monitoring Helm chart deployed!
32+
33+
This chart will install the following components:
34+
* Grafana Alloy Operator
35+
* Grafana Alloy "my-collector" (daemonset)
36+
37+
It will:

charts/k8s-monitoring/tests/platform/remote-config/.rendered/output.yaml

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# yamllint disable rule:document-start rule:line-length rule:trailing-spaces
2+
suite: Telemetry Services - Notes
3+
templates:
4+
- NOTES.txt
5+
tests:
6+
- it: should list node-exporter and windows-exporter
7+
set:
8+
cluster:
9+
name: ci-test-cluster
10+
destinations:
11+
prometheus:
12+
type: prometheus
13+
url: http://prometheus.prometheus.svc:9090
14+
collectors: {my-collector: {}}
15+
telemetry-services:
16+
node-exporter:
17+
deploy: true
18+
windows-exporter:
19+
deploy: true
20+
asserts:
21+
- matchSnapshotRaw: {}
22+
23+
- it: should list all telemetry services when all are enabled
24+
set:
25+
cluster:
26+
name: ci-test-cluster
27+
destinations:
28+
prometheus:
29+
type: prometheus
30+
url: http://prometheus.prometheus.svc:9090
31+
collectors: {my-collector: {}}
32+
telemetry-services:
33+
node-exporter:
34+
deploy: true
35+
windows-exporter:
36+
deploy: true
37+
kube-state-metrics:
38+
deploy: true
39+
kepler:
40+
deploy: true
41+
opencost:
42+
deploy: true
43+
asserts:
44+
- matchSnapshotRaw: {}
45+
46+
- it: should list nothing when all telemetry services are disabled
47+
set:
48+
cluster:
49+
name: ci-test-cluster
50+
destinations:
51+
prometheus:
52+
type: prometheus
53+
url: http://prometheus.prometheus.svc:9090
54+
collectors: {my-collector: {}}
55+
telemetry-services:
56+
node-exporter:
57+
deploy: false
58+
windows-exporter:
59+
deploy: false
60+
kube-state-metrics:
61+
deploy: false
62+
kepler:
63+
deploy: false
64+
opencost:
65+
deploy: false
66+
asserts:
67+
- matchSnapshotRaw: {}

0 commit comments

Comments
 (0)