Skip to content

Commit 02b6b73

Browse files
committed
Drop dynamic run-time reconfiguration
Simplify the code and reduce possible error scenarios by dropping fsnotify-based reconfiguration from nfd-master and nfd-worker. Also eliminates repeated re-configuration in scenarios where kubelet continuosly touches the (every minute) mounted file (configmap) on the filesystem. Also modifies the Helm and kustomize deployments so that nfd-master, nfd-worker and nfd-topology-updater pods are restarted on configmap updates. In kustomize, the slght downside of this is the name of the config map(s) depends on the content, so every time a user customizes the config data, the old unused configmap will be left and must be garbage-collected manually.
1 parent 4db3216 commit 02b6b73

File tree

15 files changed

+35
-350
lines changed

15 files changed

+35
-350
lines changed

deployment/components/master-config/kustomization.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
apiVersion: kustomize.config.k8s.io/v1alpha1
22
kind: Component
33

4-
generatorOptions:
5-
disableNameSuffixHash: true
6-
74
configMapGenerator:
85
- files:
96
- nfd-master.conf=nfd-master.conf.example

deployment/components/topology-updater-config/kustomization.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
apiVersion: kustomize.config.k8s.io/v1alpha1
22
kind: Component
33

4-
generatorOptions:
5-
disableNameSuffixHash: true
6-
74
configMapGenerator:
85
- files:
96
- nfd-topology-updater.conf=nfd-topology-updater.conf.example

deployment/components/worker-config/kustomization.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
apiVersion: kustomize.config.k8s.io/v1alpha1
22
kind: Component
33

4-
generatorOptions:
5-
disableNameSuffixHash: true
6-
74
configMapGenerator:
85
- files:
96
- nfd-worker.conf=nfd-worker.conf.example

deployment/helm/node-feature-discovery/templates/master.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@ spec:
2323
labels:
2424
{{- include "node-feature-discovery.selectorLabels" . | nindent 8 }}
2525
role: master
26-
{{- with .Values.master.annotations }}
2726
annotations:
27+
checksum/config: {{ include (print $.Template.BasePath "/nfd-master-conf.yaml") . | sha256sum }}
28+
{{- with .Values.master.annotations }}
2829
{{- toYaml . | nindent 8 }}
29-
{{- end }}
30+
{{- end }}
3031
spec:
3132
{{- with .Values.priorityClassName }}
3233
priorityClassName: {{ . }}

deployment/helm/node-feature-discovery/templates/topologyupdater.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ spec:
2222
labels:
2323
{{- include "node-feature-discovery.selectorLabels" . | nindent 8 }}
2424
role: topology-updater
25-
{{- with .Values.topologyUpdater.annotations }}
2625
annotations:
26+
checksum/config: {{ include (print $.Template.BasePath "/nfd-topologyupdater-conf.yaml") . | sha256sum }}
27+
{{- with .Values.topologyUpdater.annotations }}
2728
{{- toYaml . | nindent 8 }}
28-
{{- end }}
29+
{{- end }}
2930
spec:
3031
serviceAccountName: {{ include "node-feature-discovery.topologyUpdater.serviceAccountName" . }}
3132
dnsPolicy: ClusterFirstWithHostNet

deployment/helm/node-feature-discovery/templates/worker.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ spec:
2222
labels:
2323
{{- include "node-feature-discovery.selectorLabels" . | nindent 8 }}
2424
role: worker
25-
{{- with .Values.worker.annotations }}
2625
annotations:
26+
checksum/config: {{ include (print $.Template.BasePath "/nfd-worker-conf.yaml") . | sha256sum }}
27+
{{- with .Values.worker.annotations }}
2728
{{- toYaml . | nindent 8 }}
28-
{{- end }}
29+
{{- end }}
2930
spec:
3031
dnsPolicy: ClusterFirstWithHostNet
3132
{{- with .Values.priorityClassName }}

docs/reference/worker-configuration-reference.md

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,7 @@ core:
151151

152152
### core.klog
153153

154-
The following options specify the logger configuration. Most of which can be
155-
dynamically adjusted at run-time.
154+
The following options specify the logger configuration.
156155

157156
> **NOTE:** The logger options can also be specified via command line flags
158157
> which take precedence over any corresponding config file options.
@@ -163,95 +162,71 @@ If true, adds the file directory to the header of the log messages.
163162

164163
Default: `false`
165164

166-
Run-time configurable: yes
167-
168165
#### core.klog.alsologtostderr
169166

170167
Log to standard error as well as files.
171168

172169
Default: `false`
173170

174-
Run-time configurable: yes
175-
176171
#### core.klog.logBacktraceAt
177172

178173
When logging hits line file:N, emit a stack trace.
179174

180175
Default: *empty*
181176

182-
Run-time configurable: yes
183-
184177
#### core.klog.logDir
185178

186179
If non-empty, write log files in this directory.
187180

188181
Default: *empty*
189182

190-
Run-time configurable: no
191-
192183
#### core.klog.logFile
193184

194185
If non-empty, use this log file.
195186

196187
Default: *empty*
197188

198-
Run-time configurable: no
199-
200189
#### core.klog.logFileMaxSize
201190

202191
Defines the maximum size a log file can grow to. Unit is megabytes. If the
203192
value is 0, the maximum file size is unlimited.
204193

205194
Default: `1800`
206195

207-
Run-time configurable: no
208-
209196
#### core.klog.logtostderr
210197

211198
Log to standard error instead of files
212199

213200
Default: `true`
214201

215-
Run-time configurable: yes
216-
217202
#### core.klog.skipHeaders
218203

219204
If true, avoid header prefixes in the log messages.
220205

221206
Default: `false`
222207

223-
Run-time configurable: yes
224-
225208
#### core.klog.skipLogHeaders
226209

227210
If true, avoid headers when opening log files.
228211

229212
Default: `false`
230213

231-
Run-time configurable: no
232-
233214
#### core.klog.stderrthreshold
234215

235216
Logs at or above this threshold go to stderr (default 2)
236217

237-
Run-time configurable: yes
238-
239218
#### core.klog.v
240219

241220
Number for the log level verbosity.
242221

243222
Default: `0`
244223

245-
Run-time configurable: yes
246-
247224
#### core.klog.vmodule
248225

249226
Comma-separated list of `pattern=N` settings for file-filtered logging.
250227

251228
Default: *empty*
252229

253-
Run-time configurable: yes
254-
255230
## sources
256231

257232
The `sources` section contains feature source specific configuration parameters.

docs/usage/nfd-master.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,29 +32,28 @@ received from nfd-worker instances through
3232

3333
## Master configuration
3434

35-
NFD-Master supports dynamic configuration through a configuration file. The
35+
NFD-Master supports configuration through a configuration file. The
3636
default location is `/etc/kubernetes/node-feature-discovery/nfd-master.conf`,
3737
but, this can be changed by specifying the`-config` command line flag.
38-
Configuration file is re-read whenever it is modified which makes run-time
39-
re-configuration of nfd-master straightforward.
4038

4139
Master configuration file is read inside the container, and thus, Volumes and
4240
VolumeMounts are needed to make your configuration available for NFD. The
4341
preferred method is to use a ConfigMap which provides easy deployment and
4442
re-configurability.
4543

46-
The provided nfd-master deployment templates create an empty configmap and
47-
mount it inside the nfd-master containers. In kustomize deployments,
48-
configuration can be edited with:
49-
50-
```bash
51-
kubectl -n ${NFD_NS} edit configmap nfd-master-conf
52-
```
44+
The provided deployment methods (Helm and Kustomize) create an empty configmap
45+
and mount it inside the nfd-master containers.
5346

5447
In Helm deployments,
5548
[Master pod parameter](../deployment/helm.md#master-pod-parameters)
5649
`master.config` can be used to edit the respective configuration.
5750

51+
In Kustomize deployments, modify the `nfd-master-conf` ConfigMap with a custom
52+
overlay.
53+
54+
> **NOTE:** dynamic run-time reconfiguration was dropped in NFD v0.17.
55+
> Re-configuration is handled by pod restarts.
56+
5857
See
5958
[nfd-master configuration file reference](../reference/master-configuration-reference.md)
6059
for more details.

docs/usage/nfd-topology-updater.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,27 +62,22 @@ NFD-Topology-Updater supports configuration through a configuration file. The
6262
default location is `/etc/kubernetes/node-feature-discovery/topology-updater.conf`,
6363
but, this can be changed by specifying the`-config` command line flag.
6464

65-
> **NOTE:** unlike nfd-worker, dynamic configuration updates are not supported.
66-
6765
Topology-Updater configuration file is read inside the container,
6866
and thus, Volumes and VolumeMounts are needed
6967
to make your configuration available for NFD.
7068
The preferred method is to use a ConfigMap
7169
which provides easy deployment and re-configurability.
7270

73-
The provided nfd-topology-updater deployment templates
74-
create an empty configmap
71+
The provided deployment templates create an empty configmap
7572
and mount it inside the nfd-topology-updater containers.
76-
In kustomize deployments, configuration can be edited with:
77-
78-
```bash
79-
kubectl -n ${NFD_NS} edit configmap nfd-topology-updater-conf
80-
```
8173

8274
In Helm deployments,
8375
[Topology Updater parameters](../deployment/helm.md#topology-updater-parameters)
8476
`toplogyUpdater.config` can be used to edit the respective configuration.
8577

78+
In Kustomize deployments, modify the `nfd-worker-conf` ConfigMap with a custom
79+
overlay.
80+
8681
See
8782
[nfd-topology-updater configuration file reference](../reference/topology-updater-configuration-reference.md)
8883
for more details.

docs/usage/nfd-worker.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,9 @@ This can be changed by using the
1919
[`core.sleepInterval`](../reference/worker-configuration-reference.md#coresleepinterval)
2020
config option.
2121

22-
The worker configuration file is watched and re-read on every change which
23-
provides a mechanism of dynamic run-time reconfiguration. See
24-
[worker configuration](#worker-configuration) for more details.
25-
2622
## Worker configuration
2723

28-
NFD-Worker supports dynamic configuration through a configuration file. The
24+
NFD-Worker supports configuration through a configuration file. The
2925
default location is `/etc/kubernetes/node-feature-discovery/nfd-worker.conf`,
3026
but, this can be changed by specifying the`-config` command line flag.
3127
Configuration file is re-read whenever it is modified which makes run-time
@@ -36,18 +32,19 @@ VolumeMounts are needed to make your configuration available for NFD. The
3632
preferred method is to use a ConfigMap which provides easy deployment and
3733
re-configurability.
3834

39-
The provided nfd-worker deployment templates create an empty configmap and
40-
mount it inside the nfd-worker containers. In kustomize deployments,
41-
configuration can be edited with:
42-
43-
```bash
44-
kubectl -n ${NFD_NS} edit configmap nfd-worker-conf
45-
```
35+
The provided deployment methods (Helm and Kustomize) create an empty configmap
36+
and mount it inside the nfd-master containers.
4637

4738
In Helm deployments,
4839
[Worker pod parameter](../deployment/helm.md#worker-pod-parameters)
4940
`worker.config` can be used to edit the respective configuration.
5041

42+
In Kustomize deployments, modify the `nfd-worker-conf` ConfigMap with a custom
43+
overlay.
44+
45+
> **NOTE:** dynamic run-time reconfiguration was dropped in NFD v0.17.
46+
> Re-configuration is handled by pod restarts.
47+
5148
See
5249
[nfd-worker configuration file reference](../reference/worker-configuration-reference)
5350
for more details.

0 commit comments

Comments
 (0)