Skip to content

Commit

Permalink
jsonnet: Node exporter init collectors must be privileged
Browse files Browse the repository at this point in the history
dmidecode (used by the VM type detection) requires access to
/dev/mem which requires privileged. Only the init container gets
that permission. Blocks being able to read physical machine BIOS
info.
  • Loading branch information
smarterclayton committed Feb 6, 2020
1 parent 406d03c commit e4714f3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions assets/node-exporter/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ spec:
name: init-textfile
resources: {}
securityContext:
privileged: true
runAsUser: 0
terminationMessagePolicy: FallbackToLogsOnError
volumeMounts:
Expand Down
1 change: 1 addition & 0 deletions assets/node-exporter/security-context-constraints.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ allowHostDirVolumePlugin: true
allowHostNetwork: true
allowHostPID: true
allowHostPorts: true
allowPrivilegedContainer: true
apiVersion: security.openshift.io/v1
kind: SecurityContextConstraints
metadata:
Expand Down
2 changes: 2 additions & 0 deletions jsonnet/node-exporter.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ local tlsVolumeName = 'node-exporter-tls';
allowHostNetwork: true,
allowHostPID: true,
allowHostPorts: true,
allowPrivilegedContainer: true,
apiVersion: 'security.openshift.io/v1',
kind: 'SecurityContextConstraints',
metadata: {
Expand Down Expand Up @@ -90,6 +91,7 @@ local tlsVolumeName = 'node-exporter-tls';
image: $._config.imageRepos.nodeExporter + ':' + $._config.versions.nodeExporter,
resources: {},
securityContext: {
privileged: true,
runAsUser: 0,
},
terminationMessagePolicy: 'FallbackToLogsOnError',
Expand Down
8 changes: 4 additions & 4 deletions pkg/manifests/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e4714f3

Please sign in to comment.