Skip to content

Commit c07e067

Browse files
committed
Hackathon feature to get kubernetes manifests
1 parent f11c636 commit c07e067

32 files changed

+1253
-404
lines changed

charts/k8s-monitoring/Chart.lock

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ dependencies:
2626
- name: feature-pod-logs-via-kubernetes-api
2727
repository: ""
2828
version: 1.0.0
29+
- name: feature-kubernetes-manifests
30+
repository: ""
31+
version: 1.0.0
2932
- name: feature-profiling
3033
repository: ""
3134
version: 1.0.0
@@ -38,5 +41,5 @@ dependencies:
3841
- name: alloy-operator
3942
repository: https://grafana.github.io/helm-charts
4043
version: 0.3.12
41-
digest: sha256:a8b9ee322060fd86ea05a284afdd271dc9e59a4b87c804025e60e5821f094859
42-
generated: "2025-11-18T21:17:38.708059-06:00"
44+
digest: sha256:4190e7a543d9bae2e06af0338041acbe20d35e29b323bac56050164086ebd014
45+
generated: "2025-12-01T11:48:36.601481-06:00"

charts/k8s-monitoring/Chart.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ dependencies:
5858
repository: ""
5959
version: 1.0.0
6060
condition: podLogsViaKubernetesApi.enabled
61+
- alias: kubernetesManifests
62+
name: feature-kubernetes-manifests
63+
repository: ""
64+
version: 1.0.0
65+
condition: kubernetesManifests.enabled
6166
- alias: profiling
6267
name: feature-profiling
6368
repository: ""

charts/k8s-monitoring/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ details:
248248
| | clusterEvents(feature-cluster-events) | 1.0.0 |
249249
| | clusterMetrics(feature-cluster-metrics) | 1.0.0 |
250250
| | integrations(feature-integrations) | 1.0.0 |
251+
| | kubernetesManifests(feature-kubernetes-manifests) | 1.0.0 |
251252
| | nodeLogs(feature-node-logs) | 1.0.0 |
252253
| | podLogs(feature-pod-logs) | 1.0.0 |
253254
| | podLogsViaKubernetesApi(feature-pod-logs-via-kubernetes-api) | 1.0.0 |
@@ -393,6 +394,13 @@ details:
393394
| integrations | object | No integrations enabled | Service Integrations enables gathering telemetry data for common services and applications deployed to Kubernetes. To see the valid options, please see the [Service Integrations documentation](https://github.com/grafana/k8s-monitoring-helm/tree/main/charts/k8s-monitoring/charts/feature-integrations). |
394395
| integrations.destinations | list | `[]` | The destinations where integration metrics will be sent. If empty, all metrics-capable destinations will be used. |
395396

397+
### Features - Kubernetes Manifests
398+
399+
| Key | Type | Default | Description |
400+
|-----|------|---------|-------------|
401+
| kubernetesManifests.destinations | list | `[]` | The destinations where logs will be sent. If empty, all logs-capable destinations will be used. |
402+
| kubernetesManifests.enabled | bool | `false` | Enable gathering Kubernetes Manifests. |
403+
396404
### Features - Node Logs
397405

398406
| Key | Type | Default | Description |
@@ -448,3 +456,13 @@ details:
448456
| selfReporting.destinations | list | `[]` | The destinations where self-report metrics will be sent. If empty, all metrics-capable destinations will be used. |
449457
| selfReporting.enabled | bool | `true` | Enable Self-reporting. |
450458
| selfReporting.scrapeInterval | string | 60s | How frequently to generate self-report metrics. This does utilize the global scrapeInterval setting. |
459+
460+
### Other Values
461+
462+
| Key | Type | Default | Description |
463+
|-----|------|---------|-------------|
464+
| kubernetesManifests.image.digest | string | `""` | |
465+
| kubernetesManifests.image.pullPolicy | string | `"IfNotPresent"` | |
466+
| kubernetesManifests.image.registry | string | `"ghcr.io"` | |
467+
| kubernetesManifests.image.repository | string | `"grafana/helm-chart-toolbox-kubectl"` | |
468+
| kubernetesManifests.image.tag | string | `"0.1.2"` | |
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
docs
2+
schema-mods
3+
tests
4+
Makefile
5+
README.md
6+
README.md.gotmpl
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dependencies: []
2+
digest: sha256:643d5437104296e21d906ecb15b2c96ad278f20cfc4af53b12bb6069bd853726
3+
generated: "2024-08-28T15:09:37.347011-05:00"
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
apiVersion: v2
3+
name: feature-kubernetes-manifests
4+
description: Kubernetes Observability feature for gathering Kubernetes manifests.
5+
type: application
6+
sources:
7+
- https://github.com/grafana/k8s-monitoring-helm/tree/main/charts/k8s-monitoring/charts/feature-kubernetes-manifests
8+
version: 1.0.0
9+
appVersion: 1.0.0
10+
maintainers:
11+
- email: pete.wall@grafana.com
12+
name: petewall
13+
dependencies: []
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
HAS_HELM_UNITTEST := $(shell helm plugin list | grep unittest 2> /dev/null)
2+
3+
.SECONDEXPANSION:
4+
README.md: values.yaml Chart.yaml $$(wildcard README.md.gotmpl)
5+
docker run --rm --platform linux/amd64 --volume $(shell pwd):/chart ghcr.io/grafana/helm-chart-toolbox-doc-generator --chart /chart > $@
6+
7+
Chart.lock: Chart.yaml
8+
helm dependency update .
9+
@touch Chart.lock # Ensure the timestamp is updated
10+
11+
values.schema.json: values.yaml $$(wildcard schema-mods/*)
12+
docker run --rm --platform linux/amd64 --volume $(shell pwd):/chart ghcr.io/grafana/helm-chart-toolbox-schema-generator --chart /chart > $@
13+
14+
.PHONY: clean
15+
clean:
16+
rm -f README.md values.schema.json
17+
18+
.PHONY: build
19+
build: README.md Chart.lock values.schema.json
20+
21+
.PHONY: lint-script
22+
lint-script:
23+
@if command -v shellcheck &> /dev/null; then \
24+
shellcheck templates/script.sh; \
25+
else \
26+
docker run --rm -v $(shell pwd):/src --workdir /src koalaman/shellcheck:stable --rcfile .shellcheckrc templates/script.sh; \
27+
fi
28+
29+
.PHONY: lint
30+
lint: lint-script
31+
32+
.PHONY: test
33+
test: build
34+
helm lint .
35+
ct lint --lint-conf ../../.lintconf.yaml --helm-dependency-extra-args=--skip-refresh --charts .
36+
ifdef HAS_HELM_UNITTEST
37+
helm unittest .
38+
else
39+
docker run --rm --volume $(shell pwd):/apps helmunittest/helm-unittest:3.18.4-1.0.0 .
40+
endif
41+
42+
.PHONY: update-test-snapshots
43+
update-test-snapshots:
44+
ifdef HAS_HELM_UNITTEST
45+
helm unittest . --update-snapshot
46+
else
47+
docker run --rm --volume $(shell pwd):/apps helmunittest/helm-unittest:3.18.4-1.0.0 . --update-snapshot
48+
endif
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<!--
2+
(NOTE: Do not edit README.md directly. It is a generated file!)
3+
( To make changes, please modify README.md.gotmpl and run `helm-docs`)
4+
-->
5+
6+
# Feature: Kubernetes Manifests
7+
8+
TODO
9+
10+
## Usage
11+
12+
```yaml
13+
kubernetesManifests:
14+
enabled: true
15+
... [values](#values)
16+
```
17+
18+
## Testing
19+
20+
This chart contains unit tests to verify the generated configuration. The hidden value `deployAsConfigMap` will render
21+
the generated configuration into a ConfigMap object. While this ConfigMap is not used during regular operation, you can
22+
use it to show the outcome of a given values file.
23+
24+
The unit tests use this ConfigMap to create an object with the configuration that can be asserted against. To run the
25+
tests, use `helm test`.
26+
27+
Be sure perform actual integration testing in a live environment in the main [k8s-monitoring](../..) chart.
28+
29+
<!-- textlint-disable terminology -->
30+
## Maintainers
31+
32+
| Name | Email | Url |
33+
| ---- | ------ | --- |
34+
| petewall | <pete.wall@grafana.com> | |
35+
<!-- textlint-enable terminology -->
36+
<!-- markdownlint-disable no-bare-urls -->
37+
<!-- markdownlint-disable list-marker-space -->
38+
## Source Code
39+
40+
* <https://github.com/grafana/k8s-monitoring-helm/tree/main/charts/k8s-monitoring/charts/feature-kubernetes-manifests>
41+
<!-- markdownlint-enable list-marker-space -->
42+
<!-- markdownlint-enable no-bare-urls -->
43+
44+
## Values
45+
46+
| Key | Type | Default | Description |
47+
|-----|------|---------|-------------|
48+
| image.digest | string | `""` | |
49+
| image.pullPolicy | string | `"IfNotPresent"` | |
50+
| image.pullSecrets | list | `[]` | |
51+
| image.registry | string | `"ghcr.io"` | |
52+
| image.repository | string | `"grafana/helm-chart-toolbox-kubectl"` | |
53+
| image.tag | string | `"0.1.2"` | |
54+
| namespaces | list | `[]` | |
55+
| pods.gather | bool | `true` | |
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<!--
2+
(NOTE: Do not edit README.md directly. It is a generated file!)
3+
( To make changes, please modify README.md.gotmpl and run `helm-docs`)
4+
-->
5+
6+
# Feature: Kubernetes Manifests
7+
8+
TODO
9+
10+
## Usage
11+
12+
```yaml
13+
kubernetesManifests:
14+
enabled: true
15+
... [values](#values)
16+
```
17+
18+
## Testing
19+
20+
This chart contains unit tests to verify the generated configuration. The hidden value `deployAsConfigMap` will render
21+
the generated configuration into a ConfigMap object. While this ConfigMap is not used during regular operation, you can
22+
use it to show the outcome of a given values file.
23+
24+
The unit tests use this ConfigMap to create an object with the configuration that can be asserted against. To run the
25+
tests, use `helm test`.
26+
27+
Be sure perform actual integration testing in a live environment in the main [k8s-monitoring](../..) chart.
28+
29+
<!-- textlint-disable terminology -->
30+
{{ template "chart.maintainersSection" . }}
31+
<!-- textlint-enable terminology -->
32+
<!-- markdownlint-disable no-bare-urls -->
33+
<!-- markdownlint-disable list-marker-space -->
34+
{{ template "chart.sourcesSection" . }}
35+
<!-- markdownlint-enable list-marker-space -->
36+
<!-- markdownlint-enable no-bare-urls -->
37+
{{ template "chart.requirementsSection" . }}
38+
{{ template "chart.valuesSection" . }}

0 commit comments

Comments
 (0)