Skip to content

Commit ce61dcb

Browse files
authored
Merge pull request #2330 from marquiz/devel/helm-docs-consolidation
helm: common documentation in html docs and chart readme
2 parents 4734b7d + d1882de commit ce61dcb

File tree

10 files changed

+539
-249
lines changed

10 files changed

+539
-249
lines changed

Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,14 @@ helm-schema:
190190

191191
.PHONY: helm-docs
192192
helm-docs:
193+
cd deployment/helm/node-feature-discovery/ && \
194+
go tool helm-docs \
195+
-t README.md.gotmpl -t _metadata.gotmpl -t _templates.gotmpl \
196+
--sort-values-order file && \
193197
go tool helm-docs \
194-
-c deployment/helm/ \
195-
-t README.md.gotmpl -t _metadata.gotmpl \
196-
--sort-values-order file
198+
-t ../../../docs/deployment/helm.md.gotmpl -t _metadata-site.gotmpl -t _templates.gotmpl \
199+
--sort-values-order file \
200+
-o ../../../docs/deployment/helm.md
197201

198202
helm-lint:
199203
helm lint --strict deployment/helm/node-feature-discovery/

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,5 @@
2424
# Sources for autogeneration
2525
README.md.gotmpl
2626
_metadata.gotmpl
27+
_metadata-site.gotmpl
28+
_templates.gotmpl

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

Lines changed: 125 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,135 @@ range of vendor and application specific node labeling needs.
1414

1515
## Installing the chart
1616

17+
### OCI Helm repository
18+
19+
The NFD project provides Helm charts in an OCI compliant repository. Install
20+
NFD with the default configuration
21+
1722
```bash
1823
helm install nfd --namespace node-feature-discovery --create-namespace oci://gcr.io/k8s-staging-nfd/charts/node-feature-discovery --version 0.0.0-master
1924
```
2025

21-
See
22-
[NFD documentation](https://kubernetes-sigs.github.io/node-feature-discovery/master/deployment/helm.html)
23-
for more detailed deployment instructions.
26+
See the [configuration](#configuration) section below for instructions how to
27+
alter the deployment parameters.
28+
29+
### Legacy Helm repository
30+
31+
For the time being, the NFD project still provides Helm charts in a legacy
32+
(HTTP) Helm repository, too.
33+
34+
> **NOTE:** This repository will be deprecated in the future. It is recommended
35+
> for users to switch to use the OCI Helm repository.
36+
37+
#### Stable version
38+
39+
To install the latest stable version:
40+
41+
```bash
42+
helm repo add nfd https://kubernetes-sigs.github.io/node-feature-discovery/charts
43+
helm repo update
44+
helm install nfd nfd/node-feature-discovery --namespace node-feature-discovery --create-namespace
45+
```
46+
47+
See the [configuration](#configuration) section below for instructions how to
48+
alter the deployment parameters.
49+
50+
### Latest development version
51+
52+
To install the latest development version you need to clone the NFD Git
53+
repository and install from there.
54+
55+
```bash
56+
git clone https://github.com/kubernetes-sigs/node-feature-discovery/
57+
cd node-feature-discovery/deployment/helm
58+
helm install nfd ./node-feature-discovery/ --namespace node-feature-discovery --create-namespace
59+
```
60+
61+
## Configuration
62+
63+
You can override values from `values.yaml` and provide a file with custom values:
64+
65+
```bash
66+
helm install -f <path/to/custom/values.yaml> --namespace nfd --create-namespace nfd oci://gcr.io/k8s-staging-nfd/charts/node-feature-discovery --version 0.0.0-master
67+
```
68+
69+
To specify each parameter separately you can provide them to helm install command:
70+
71+
```bash
72+
helm install --set nameOverride=NFDinstance --set master.replicaCount=2 --namespace nfd --create-namespace nfd oci://gcr.io/k8s-staging-nfd/charts/node-feature-discovery --version 0.0.0-master
73+
```
74+
75+
## Upgrading the chart
76+
77+
To upgrade the `node-feature-discovery` deployment to master via Helm.
78+
79+
### From v0.7 and older
80+
81+
Please see
82+
the [uninstallation guide](https://kubernetes-sigs.github.io/node-feature-discovery/v0.7/get-started/deployment-and-usage.html#uninstallation).
83+
And then follow the standard [installation instructions](#installing-the-chart).
84+
85+
### From v0.8 - v0.11
86+
87+
Helm deployment of NFD was introduced in v0.8.0.
88+
89+
```bash
90+
export NFD_NS=node-feature-discovery
91+
export HELM_INSTALL_NAME=nfd
92+
# Uninstall the old NFD deployment
93+
helm uninstall $HELM_INSTALL_NAME --namespace $NFD_NS
94+
# Install the new NFD deployment
95+
helm install $HELM_INSTALL_NAME oci://gcr.io/k8s-staging-nfd/charts/node-feature-discovery --version 0.0.0-master --namespace $NFD_NS --set master.enable=false
96+
# Wait for NFD Worker to be ready
97+
kubectl wait --timeout=-1s --for=condition=ready pod -l app.kubernetes.io/name=node-feature-discovery --namespace $NFD_NS
98+
# Enable the NFD Master
99+
helm upgrade $HELM_INSTALL_NAME oci://gcr.io/k8s-staging-nfd/charts/node-feature-discovery --version 0.0.0-master --namespace $NFD_NS --set master.enable=true
100+
```
101+
102+
### From v0.12 - v0.13
103+
104+
In v0.12 the `NodeFeature` CRD was introduced as experimental.
105+
The API was not enabled by default.
106+
107+
```bash
108+
export NFD_NS=node-feature-discovery
109+
export HELM_INSTALL_NAME=nfd
110+
# Install and upgrade CRD's
111+
kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/node-feature-discovery/master/deployment/base/nfd-crds/nfd-api-crds.yaml
112+
# Install the new NFD deployment
113+
helm upgrade $HELM_INSTALL_NAME oci://gcr.io/k8s-staging-nfd/charts/node-feature-discovery --version 0.0.0-master --namespace $NFD_NS --set master.enable=false
114+
# Wait for NFD Worker to be ready
115+
kubectl wait --timeout=-1s --for=condition=ready pod -l app.kubernetes.io/name=node-feature-discovery --namespace $NFD_NS
116+
# Enable the NFD Master
117+
helm upgrade $HELM_INSTALL_NAME oci://gcr.io/k8s-staging-nfd/charts/node-feature-discovery --version 0.0.0-master --namespace $NFD_NS --set master.enable=true
118+
```
119+
120+
### From v0.14+
121+
122+
As of version v0.14 the Helm chart is the primary deployment method for NFD,
123+
and the CRD `NodeFeature` is enabled by default.
124+
125+
```bash
126+
export NFD_NS=node-feature-discovery
127+
export HELM_INSTALL_NAME=nfd
128+
# Install and upgrade CRD's
129+
kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/node-feature-discovery/master/deployment/base/nfd-crds/nfd-api-crds.yaml
130+
# Install the new NFD deployment
131+
helm upgrade $HELM_INSTALL_NAME oci://gcr.io/k8s-staging-nfd/charts/node-feature-discovery --version 0.0.0-master --namespace $NFD_NS
132+
```
133+
134+
## Uninstalling the chart
135+
136+
To uninstall the `node-feature-discovery` deployment:
137+
138+
```bash
139+
helm uninstall nfd --namespace node-feature-discovery
140+
```
141+
142+
The command removes all the Kubernetes components associated with the chart and
143+
deletes the release. It also runs a post-delete hook that cleans up the nodes
144+
of all labels, annotations, taints and extended resources that were created by
145+
NFD.
24146

25147
## Values
26148

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

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,4 @@
66
{{ template "chart.sourcesSection" . }}
77
{{ template "chart.requirementsSection" . }}
88

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" . }}
9+
{{ template "common" . }}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{{- define "metadata.oci_repo" -}}
2+
{{ "{{ site.helm_oci_repo }}" }}
3+
{{- end -}}
4+
5+
{{- define "metadata.oci_tag" -}}
6+
{{ "{{ site.helm_chart_version }}" }}
7+
{{- end -}}
8+
9+
{{- define "metadata.docs_version" -}}
10+
{{ "{{ site.version }}" }}
11+
{{- end -}}
12+
13+
{{- define "metadata.nfd_release" -}}
14+
{{ "{{ site.release }}" }}
15+
{{- end -}}

deployment/helm/node-feature-discovery/_metadata.gotmpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@
66

77
{{- define "metadata.docs_version" -}}master
88
{{- end -}}
9+
10+
{{- define "metadata.nfd_release" -}}master
11+
{{- end -}}
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
{{ define "note.autogenerated" -}}
2+
<!--
3+
DO NOT EDIT: file generated by helm-docs
4+
-->
5+
{{- end }}
6+
7+
{{- define "common" }}
8+
9+
## Installing the chart
10+
11+
### OCI Helm repository
12+
13+
The NFD project provides Helm charts in an OCI compliant repository. Install
14+
NFD with the default configuration
15+
16+
```bash
17+
helm install nfd --namespace node-feature-discovery --create-namespace {{ template "metadata.oci_repo" . }} --version {{ template "metadata.oci_tag" . }}
18+
```
19+
20+
See the [configuration](#configuration) section below for instructions how to
21+
alter the deployment parameters.
22+
23+
### Legacy Helm repository
24+
25+
For the time being, the NFD project still provides Helm charts in a legacy
26+
(HTTP) Helm repository, too.
27+
28+
> **NOTE:** This repository will be deprecated in the future. It is recommended
29+
> for users to switch to use the OCI Helm repository.
30+
31+
#### Stable version
32+
33+
To install the latest stable version:
34+
35+
```bash
36+
helm repo add nfd https://kubernetes-sigs.github.io/node-feature-discovery/charts
37+
helm repo update
38+
helm install nfd nfd/node-feature-discovery --namespace node-feature-discovery --create-namespace
39+
```
40+
41+
See the [configuration](#configuration) section below for instructions how to
42+
alter the deployment parameters.
43+
44+
### Latest development version
45+
46+
To install the latest development version you need to clone the NFD Git
47+
repository and install from there.
48+
49+
```bash
50+
git clone https://github.com/kubernetes-sigs/node-feature-discovery/
51+
cd node-feature-discovery/deployment/helm
52+
helm install nfd ./node-feature-discovery/ --namespace node-feature-discovery --create-namespace
53+
```
54+
55+
## Configuration
56+
57+
You can override values from `values.yaml` and provide a file with custom values:
58+
59+
```bash
60+
helm install -f <path/to/custom/values.yaml> --namespace nfd --create-namespace nfd {{ template "metadata.oci_repo" . }} --version {{ template "metadata.oci_tag" . }}
61+
```
62+
63+
To specify each parameter separately you can provide them to helm install command:
64+
65+
```bash
66+
helm install --set nameOverride=NFDinstance --set master.replicaCount=2 --namespace nfd --create-namespace nfd {{ template "metadata.oci_repo" . }} --version {{ template "metadata.oci_tag" . }}
67+
```
68+
69+
## Upgrading the chart
70+
71+
To upgrade the `node-feature-discovery` deployment to {{ template "metadata.nfd_release" . }} via Helm.
72+
73+
### From v0.7 and older
74+
75+
Please see
76+
the [uninstallation guide](https://kubernetes-sigs.github.io/node-feature-discovery/v0.7/get-started/deployment-and-usage.html#uninstallation).
77+
And then follow the standard [installation instructions](#installing-the-chart).
78+
79+
### From v0.8 - v0.11
80+
81+
Helm deployment of NFD was introduced in v0.8.0.
82+
83+
```bash
84+
export NFD_NS=node-feature-discovery
85+
export HELM_INSTALL_NAME=nfd
86+
# Uninstall the old NFD deployment
87+
helm uninstall $HELM_INSTALL_NAME --namespace $NFD_NS
88+
# Install the new NFD deployment
89+
helm install $HELM_INSTALL_NAME {{ template "metadata.oci_repo" . }} --version {{ template "metadata.oci_tag" . }} --namespace $NFD_NS --set master.enable=false
90+
# Wait for NFD Worker to be ready
91+
kubectl wait --timeout=-1s --for=condition=ready pod -l app.kubernetes.io/name=node-feature-discovery --namespace $NFD_NS
92+
# Enable the NFD Master
93+
helm upgrade $HELM_INSTALL_NAME {{ template "metadata.oci_repo" . }} --version {{ template "metadata.oci_tag" . }} --namespace $NFD_NS --set master.enable=true
94+
```
95+
96+
### From v0.12 - v0.13
97+
98+
In v0.12 the `NodeFeature` CRD was introduced as experimental.
99+
The API was not enabled by default.
100+
101+
```bash
102+
export NFD_NS=node-feature-discovery
103+
export HELM_INSTALL_NAME=nfd
104+
# Install and upgrade CRD's
105+
kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/node-feature-discovery/{{ template "metadata.nfd_release" . }}/deployment/base/nfd-crds/nfd-api-crds.yaml
106+
# Install the new NFD deployment
107+
helm upgrade $HELM_INSTALL_NAME {{ template "metadata.oci_repo" . }} --version {{ template "metadata.oci_tag" . }} --namespace $NFD_NS --set master.enable=false
108+
# Wait for NFD Worker to be ready
109+
kubectl wait --timeout=-1s --for=condition=ready pod -l app.kubernetes.io/name=node-feature-discovery --namespace $NFD_NS
110+
# Enable the NFD Master
111+
helm upgrade $HELM_INSTALL_NAME {{ template "metadata.oci_repo" . }} --version {{ template "metadata.oci_tag" . }} --namespace $NFD_NS --set master.enable=true
112+
```
113+
114+
### From v0.14+
115+
116+
As of version v0.14 the Helm chart is the primary deployment method for NFD,
117+
and the CRD `NodeFeature` is enabled by default.
118+
119+
```bash
120+
export NFD_NS=node-feature-discovery
121+
export HELM_INSTALL_NAME=nfd
122+
# Install and upgrade CRD's
123+
kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/node-feature-discovery/{{ template "metadata.nfd_release" . }}/deployment/base/nfd-crds/nfd-api-crds.yaml
124+
# Install the new NFD deployment
125+
helm upgrade $HELM_INSTALL_NAME {{ template "metadata.oci_repo" . }} --version {{ template "metadata.oci_tag" . }} --namespace $NFD_NS
126+
```
127+
128+
## Uninstalling the chart
129+
130+
To uninstall the `node-feature-discovery` deployment:
131+
132+
```bash
133+
helm uninstall nfd --namespace node-feature-discovery
134+
```
135+
136+
The command removes all the Kubernetes components associated with the chart and
137+
deletes the release. It also runs a post-delete hook that cleans up the nodes
138+
of all labels, annotations, taints and extended resources that were created by
139+
NFD.
140+
141+
{{ template "chart.valuesSection" . }}
142+
{{ end -}}

0 commit comments

Comments
 (0)