Skip to content

Commit bee173a

Browse files
authored
Merge pull request #2324 from marquiz/devel/helm-docs
helm: improve chart readme
2 parents bc473e3 + 8d07b1f commit bee173a

File tree

11 files changed

+507
-50
lines changed

11 files changed

+507
-50
lines changed

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,13 @@ helm-schema:
189189
cd deployment/helm/node-feature-discovery/ && \
190190
helm schema
191191

192+
.PHONY: helm-docs
193+
helm-docs:
194+
go tool helm-docs \
195+
-c deployment/helm/ \
196+
-t README.md.gotmpl -t _metadata.gotmpl \
197+
--sort-values-order file
198+
192199
helm-lint:
193200
helm lint --strict deployment/helm/node-feature-discovery/
194201

deployment/helm/node-feature-discovery/.helmignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@
2121
.idea/
2222
*.tmproj
2323
.vscode/
24+
# Sources for autogeneration
25+
README.md.gotmpl
26+
_metadata.gotmpl

deployment/helm/node-feature-discovery/Chart.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ apiVersion: v2
22
appVersion: master
33
icon: https://kubernetes-sigs.github.io/node-feature-discovery/master/assets/images/nfd/favicon.svg
44
description: |
5-
Detects hardware features available on each node in a Kubernetes cluster, and advertises
6-
those features using node labels.
5+
Node Feature Discovery (NFD) is a Kubernetes add-on for detecting hardware
6+
features and system configuration. Detected features are advertised as node
7+
labels. NFD provides flexible configuration and extension points for a wide
8+
range of vendor and application specific node labeling needs.
79
name: node-feature-discovery
810
sources:
911
- https://github.com/kubernetes-sigs/node-feature-discovery

deployment/helm/node-feature-discovery/README.md

Lines changed: 216 additions & 2 deletions
Large diffs are not rendered by default.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{{ template "chart.header" . }}
2+
{{ template "chart.badgesSection" . }}
3+
{{ template "chart.description" . }}
4+
{{ template "chart.homepageLine" . }}
5+
{{ template "chart.maintainersSection" . }}
6+
{{ template "chart.sourcesSection" . }}
7+
{{ template "chart.requirementsSection" . }}
8+
9+
## Installing the chart
10+
11+
```bash
12+
helm install nfd --namespace node-feature-discovery --create-namespace {{ template "metadata.oci_repo" . }} --version {{ template "metadata.oci_tag" . }}
13+
```
14+
15+
See
16+
[NFD documentation](https://kubernetes-sigs.github.io/node-feature-discovery/{{ template "metadata.docs_version" . }}/deployment/helm.html)
17+
for more detailed deployment instructions.
18+
19+
{{ template "chart.valuesSection" . }}
20+
{{ template "helm-docs.versionFooter" . }}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{{- define "metadata.oci_repo" -}}oci://gcr.io/k8s-staging-nfd/charts/node-feature-discovery
2+
{{- end -}}
3+
4+
{{- define "metadata.oci_tag" -}}0.0.0-master
5+
{{- end -}}
6+
7+
{{- define "metadata.docs_version" -}}master
8+
{{- end -}}

deployment/helm/node-feature-discovery/values.yaml

Lines changed: 224 additions & 46 deletions
Large diffs are not rendered by default.

go.mod

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ require (
7171
github.com/go-openapi/swag v0.23.0 // indirect
7272
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
7373
github.com/gobuffalo/flect v1.0.2 // indirect
74+
github.com/gobwas/glob v0.2.3 // indirect
7475
github.com/godbus/dbus/v5 v5.1.0 // indirect
7576
github.com/gogo/protobuf v1.3.2 // indirect
7677
github.com/golang/protobuf v1.5.4 // indirect
@@ -108,6 +109,7 @@ require (
108109
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
109110
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
110111
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
112+
github.com/norwoodj/helm-docs v1.14.2 // indirect
111113
github.com/opencontainers/cgroups v0.0.4 // indirect
112114
github.com/opencontainers/go-digest v1.0.0 // indirect
113115
github.com/opencontainers/runtime-spec v1.2.1 // indirect
@@ -172,6 +174,7 @@ require (
172174
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
173175
gopkg.in/yaml.v2 v2.4.0 // indirect
174176
gopkg.in/yaml.v3 v3.0.1 // indirect
177+
helm.sh/helm/v3 v3.19.0 // indirect
175178
howett.net/plist v1.0.2-0.20250314012144-ee69052608d9 // indirect
176179
k8s.io/apiserver v0.34.1 // indirect
177180
k8s.io/cloud-provider v0.34.1 // indirect
@@ -227,6 +230,7 @@ replace (
227230
)
228231

229232
tool (
233+
github.com/norwoodj/helm-docs/cmd/helm-docs
230234
github.com/vektra/mockery/v2
231235
k8s.io/code-generator
232236
sigs.k8s.io/controller-tools/cmd/controller-gen

go.sum

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UF
3030
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
3131
github.com/chigopher/pathlib v0.19.1 h1:RoLlUJc0CqBGwq239cilyhxPNLXTK+HXoASGyGznx5A=
3232
github.com/chigopher/pathlib v0.19.1/go.mod h1:tzC1dZLW8o33UQpWkNkhvPwL5n4yyFRFm/jL1YGWFvY=
33+
github.com/containerd/containerd v1.7.28 h1:Nsgm1AtcmEh4AHAJ4gGlNSaKgXiNccU270Dnf81FQ3c=
3334
github.com/containerd/containerd/api v1.8.0 h1:hVTNJKR8fMc/2Tiw60ZRijntNMd1U+JVMyTRdsD2bS0=
3435
github.com/containerd/containerd/api v1.8.0/go.mod h1:dFv4lt6S20wTu/hMcP4350RL87qPWLVa/OHOwmmdnYc=
3536
github.com/containerd/errdefs v1.0.0 h1:tg5yIfIlQIrxYtu9ajqY42W3lpS19XqdxRQeEwYG8PI=
@@ -95,6 +96,8 @@ github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1v
9596
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
9697
github.com/gobuffalo/flect v1.0.2 h1:eqjPGSo2WmjgY2XlpGwo2NXgL3RucAKo4k4qQMNA5sA=
9798
github.com/gobuffalo/flect v1.0.2/go.mod h1:A5msMlrHtLqh9umBSnvabjsMrCcCpAyzglnDvkbYKHs=
99+
github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y=
100+
github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
98101
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
99102
github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk=
100103
github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
@@ -216,6 +219,8 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq
216219
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
217220
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus=
218221
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
222+
github.com/norwoodj/helm-docs v1.14.2 h1:Ew3bCq1hZqMnnTopkk66Uy2mGwu/jAclAx+3JAVp1To=
223+
github.com/norwoodj/helm-docs v1.14.2/go.mod h1:qdo76rorOkPDme8nsV5e0JBAYrs56kzvZMYW83k1kgc=
219224
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
220225
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
221226
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
@@ -450,6 +455,8 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
450455
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
451456
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
452457
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
458+
helm.sh/helm/v3 v3.19.0 h1:krVyCGa8fa/wzTZgqw0DUiXuRT5BPdeqE/sQXujQ22k=
459+
helm.sh/helm/v3 v3.19.0/go.mod h1:Lk/SfzN0w3a3C3o+TdAKrLwJ0wcZ//t1/SDXAvfgDdc=
453460
howett.net/plist v1.0.2-0.20250314012144-ee69052608d9 h1:eeH1AIcPvSc0Z25ThsYF+Xoqbn0CI/YnXVYoTLFdGQw=
454461
howett.net/plist v1.0.2-0.20250314012144-ee69052608d9/go.mod h1:fyFX5Hj5tP1Mpk8obqA9MZgXT416Q5711SDT7dQLTLk=
455462
k8s.io/api v0.34.1 h1:jC+153630BMdlFukegoEL8E/yT7aLyQkIVuwhmwDgJM=

hack/prepare-release.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,15 @@ if [ -z "$no_patching" ]; then
138138
-i deployment/helm/node-feature-discovery/Chart.yaml
139139
sed -e s"/pullPolicy:.*/pullPolicy: IfNotPresent/" \
140140
-e s"!gcr.io/k8s-staging-nfd/node-feature-discovery!registry.k8s.io/nfd/node-feature-discovery!" \
141+
-e s"!kubernetes-sigs.github.io/node-feature-discovery/master!kubernetes-sigs.github.io/node-feature-discovery/$docs_version!" \
141142
-i deployment/helm/node-feature-discovery/values.yaml
142143
sed -e s"!kubernetes-sigs.github.io/node-feature-discovery/master!kubernetes-sigs.github.io/node-feature-discovery/$docs_version!" \
143144
-i deployment/helm/node-feature-discovery/README.md
145+
sed -e s"!.*metadata\.oci_repo.*!{{- define \"metadata.oci_repo\" -}}oci://registry.k8s.io/nfd/charts/node-feature-discovery!" \
146+
-e s"/.*metadata\.oci_tag.*/{{- define \"metadata.oci_tag\" -}}$semver/" \
147+
-e s"/.*metadata\.docs_version.*/{{- define \"metadata.docs_version\" -}}$docs_version/" \
148+
-i deployment/helm/node-feature-discovery/_metadata.gotmpl
149+
make helm-docs
144150

145151
# Patch e2e test
146152
echo Patching test/e2e/node_feature_discovery.go flag defaults to registry.k8s.io/nfd/node-feature-discovery and $release

0 commit comments

Comments
 (0)