Skip to content

Commit 7453b3c

Browse files
authored
Improve the preset docs to show the actual preset file (#2470)
Signed-off-by: Pete Wall <pete.wall@grafana.com>
1 parent 82b8429 commit 7453b3c

File tree

8 files changed

+147
-2
lines changed

8 files changed

+147
-2
lines changed

charts/k8s-monitoring/Makefile

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,20 @@ INTEGRATION_VALUES_FILES = $(shell find charts/feature-integrations/integrations
3131
docs/collectors/%.md: collectors/%-values.yaml $$(wildcard docs/collectors/.doc_templates/%.gotmpl)
3232
docker run --platform linux/amd64 --rm --volume $(shell pwd):/chart ghcr.io/grafana/helm-chart-toolbox-doc-generator --file /chart/$< --template /chart/docs/collectors/.doc_templates/$(shell basename -s -values.yaml $<).gotmpl > $@
3333

34-
docs/collectors/presets/%.md: collectors/presets/%.yaml $$(wildcard docs/collectors/presets/.doc_templates/%.gotmpl)
35-
docker run --platform linux/amd64 --rm --volume $(shell pwd):/chart ghcr.io/grafana/helm-chart-toolbox-doc-generator --file /chart/$< --template /chart/docs/collectors/presets/.doc_templates/$(shell basename -s .yaml $<).gotmpl > $@
34+
docs/collectors/presets/%.md: collectors/presets/%.yaml
35+
@echo '<!--' > $@
36+
@echo '(NOTE: Do not edit README.md directly. It is a generated file!)' >> $@
37+
@echo '( To make changes, please modify values.yaml or description.txt and run `make examples`)' >> $@
38+
@echo '-->' >> $@
39+
docker run --platform linux/amd64 --rm --volume $(shell pwd):/chart ghcr.io/grafana/helm-chart-toolbox-doc-generator --file /chart/$< --template /chart/docs/collectors/presets/.doc_templates/$(shell basename -s .yaml $<).gotmpl >> $@
40+
41+
@echo '' >> $@
42+
@echo '<!-- textlint-disable terminology -->' >> $@
43+
@echo '```yaml' >> $@
44+
@cat $< >> $@
45+
@echo '```' >> $@
46+
@echo '<!-- textlint-enable terminology -->' >> $@
47+
3648

3749
docs/destinations/%.md: destinations/%-values.yaml $$(wildcard docs/destinations/.doc_templates/%.gotmpl)
3850
docker run --platform linux/amd64 --rm --volume $(shell pwd):/chart ghcr.io/grafana/helm-chart-toolbox-doc-generator --file /chart/$< --template /chart/docs/destinations/.doc_templates/$(shell basename -s -values.yaml $<).gotmpl > $@

charts/k8s-monitoring/docs/collectors/presets/clustered.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
<!--
2+
(NOTE: Do not edit README.md directly. It is a generated file!)
3+
( To make changes, please modify values.yaml or description.txt and run `make examples`)
4+
-->
15
# clustered.yaml
26

37
<!-- textlint-disable terminology -->
@@ -9,3 +13,16 @@
913
|-----|------|---------|-------------|
1014
| alloy | object | `{"clustering":{"enabled":true}}` | Enables Alloy clustering to distribute telemetry gathering compatible work across multiple replicas. |
1115
<!-- textlint-enable terminology -->
16+
17+
<!-- textlint-disable terminology -->
18+
```yaml
19+
---
20+
# Clustered preset
21+
22+
# -- Enables Alloy clustering to distribute telemetry gathering compatible work across multiple replicas.
23+
# @section -- Alloy Configuration
24+
alloy:
25+
clustering:
26+
enabled: true
27+
```
28+
<!-- textlint-enable terminology -->

charts/k8s-monitoring/docs/collectors/presets/daemonset.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
<!--
2+
(NOTE: Do not edit README.md directly. It is a generated file!)
3+
( To make changes, please modify values.yaml or description.txt and run `make examples`)
4+
-->
15
# daemonset.yaml
26

37
<!-- textlint-disable terminology -->
@@ -9,3 +13,18 @@
913
|-----|------|---------|-------------|
1014
| controller | object | `{"tolerations":[{"effect":"NoSchedule","operator":"Exists"}],"type":"daemonset"}` | Configures Alloy to run as a DaemonSet, ensuring a single instance per node. |
1115
<!-- textlint-enable terminology -->
16+
17+
<!-- textlint-disable terminology -->
18+
```yaml
19+
---
20+
# DaemonSet preset
21+
22+
# -- Configures Alloy to run as a DaemonSet, ensuring a single instance per node.
23+
# @section -- Alloy Configuration
24+
controller:
25+
type: daemonset
26+
tolerations:
27+
- effect: NoSchedule
28+
operator: Exists
29+
```
30+
<!-- textlint-enable terminology -->

charts/k8s-monitoring/docs/collectors/presets/deployment.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
<!--
2+
(NOTE: Do not edit README.md directly. It is a generated file!)
3+
( To make changes, please modify values.yaml or description.txt and run `make examples`)
4+
-->
15
# deployment.yaml
26

37
<!-- textlint-disable terminology -->
@@ -9,3 +13,16 @@
913
|-----|------|---------|-------------|
1014
| controller | object | `{"replicas":1,"type":"deployment"}` | Configures Alloy to run as a Deployment, with a default of 1 replica. |
1115
<!-- textlint-enable terminology -->
16+
17+
<!-- textlint-disable terminology -->
18+
```yaml
19+
---
20+
# Deployment preset
21+
22+
# -- Configures Alloy to run as a Deployment, with a default of 1 replica.
23+
# @section -- Alloy Configuration
24+
controller:
25+
type: deployment
26+
replicas: 1
27+
```
28+
<!-- textlint-enable terminology -->

charts/k8s-monitoring/docs/collectors/presets/filesystem-log-reader.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
<!--
2+
(NOTE: Do not edit README.md directly. It is a generated file!)
3+
( To make changes, please modify values.yaml or description.txt and run `make examples`)
4+
-->
15
# filesystem-log-reader.yaml
26

37
<!-- textlint-disable terminology -->
@@ -9,3 +13,20 @@
913
|-----|------|---------|-------------|
1014
| alloy | object | `{"mounts":{"dockercontainers":true,"varlog":true}}` | Configures Alloy to mount the /var/log from the Node's file system. |
1115
<!-- textlint-enable terminology -->
16+
17+
<!-- textlint-disable terminology -->
18+
```yaml
19+
---
20+
# Filesystem log reader preset
21+
22+
# -- Configures Alloy to mount the /var/log from the Node's file system.
23+
# @section -- Alloy Configuration
24+
alloy:
25+
mounts:
26+
# Mount `/var/log` from the host into the container for log collection.
27+
varlog: true
28+
29+
# Also mount `/var/lib/docker/containers` from the host into the container for log collection.
30+
dockercontainers: true
31+
```
32+
<!-- textlint-enable terminology -->

charts/k8s-monitoring/docs/collectors/presets/privileged.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
<!--
2+
(NOTE: Do not edit README.md directly. It is a generated file!)
3+
( To make changes, please modify values.yaml or description.txt and run `make examples`)
4+
-->
15
# privileged.yaml
26

37
<!-- textlint-disable terminology -->
@@ -15,3 +19,23 @@
1519
|-----|------|---------|-------------|
1620
| controller.hostPID | bool | `true` | |
1721
<!-- textlint-enable terminology -->
22+
23+
<!-- textlint-disable terminology -->
24+
```yaml
25+
---
26+
# Privileged preset
27+
28+
# -- Configures Alloy to run with elevated privileges, allowing it to access system resources and perform operations
29+
# that require root access.
30+
# @section -- Alloy Configuration
31+
alloy:
32+
securityContext:
33+
allowPrivilegeEscalation: true
34+
privileged: true
35+
runAsGroup: 0
36+
runAsUser: 0
37+
38+
controller:
39+
hostPID: true
40+
```
41+
<!-- textlint-enable terminology -->

charts/k8s-monitoring/docs/collectors/presets/singleton.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
<!--
2+
(NOTE: Do not edit README.md directly. It is a generated file!)
3+
( To make changes, please modify values.yaml or description.txt and run `make examples`)
4+
-->
15
# singleton.yaml
26

37
<!-- textlint-disable terminology -->
@@ -9,3 +13,17 @@
913
|-----|------|---------|-------------|
1014
| controller | object | `{"replicas":1,"type":"deployment"}` | Configures Alloy to run as a single-instance, protecting workloads that would result in duplicated data if run on multiple replicas. |
1115
<!-- textlint-enable terminology -->
16+
17+
<!-- textlint-disable terminology -->
18+
```yaml
19+
---
20+
# Singleton preset
21+
22+
# -- Configures Alloy to run as a single-instance, protecting workloads that would result in duplicated data if run on
23+
# multiple replicas.
24+
# @section -- Alloy Configuration
25+
controller:
26+
type: deployment
27+
replicas: 1
28+
```
29+
<!-- textlint-enable terminology -->

charts/k8s-monitoring/docs/collectors/presets/statefulset.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
<!--
2+
(NOTE: Do not edit README.md directly. It is a generated file!)
3+
( To make changes, please modify values.yaml or description.txt and run `make examples`)
4+
-->
15
# statefulset.yaml
26

37
<!-- textlint-disable terminology -->
@@ -9,3 +13,16 @@
913
|-----|------|---------|-------------|
1014
| controller | object | `{"replicas":1,"type":"statefulset"}` | Configures Alloy to run as a StatefulSet, with a default of 1 replica. |
1115
<!-- textlint-enable terminology -->
16+
17+
<!-- textlint-disable terminology -->
18+
```yaml
19+
---
20+
# StatefulSet preset
21+
22+
# -- Configures Alloy to run as a StatefulSet, with a default of 1 replica.
23+
# @section -- Alloy Configuration
24+
controller:
25+
type: statefulset
26+
replicas: 1
27+
```
28+
<!-- textlint-enable terminology -->

0 commit comments

Comments
 (0)