1
0
Fork 0
mirror of https://github.com/prometheus-operator/prometheus-operator.git synced 2025-04-21 03:38:43 +00:00

Merge pull request from mxinden/node-exporter-host-port

kube-prometheus: Run node-exporter in host network
This commit is contained in:
Max Inden 2018-06-15 13:37:26 +02:00 committed by GitHub
commit 97bcd7df40
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 3 deletions
Documentation/user-guides
Makefile
contrib/kube-prometheus
jsonnet/kube-prometheus/node-exporter
manifests

View file

@ -185,6 +185,7 @@ spec:
name: kube-rbac-proxy
ports:
- containerPort: 9100
hostPort: 9100
name: https
resources:
limits:
@ -193,6 +194,8 @@ spec:
requests:
cpu: 10m
memory: 20Mi
hostNetwork: true
hostPID: true
nodeSelector:
beta.kubernetes.io/os: linux
securityContext:

View file

@ -89,7 +89,7 @@ generate-in-docker: hack/jsonnet-docker-image
.PHONY: kube-prometheus
kube-prometheus:
cd contrib/kube-prometheus; $(MAKE) generate
cd contrib/kube-prometheus && $(MAKE) generate
example/prometheus-operator-crd/**.crd.yaml: pkg/client/monitoring/v1/openapi_generated.go $(PO_CRDGEN_BINARY)
po-crdgen prometheus > example/prometheus-operator-crd/prometheus.crd.yaml

View file

@ -90,7 +90,7 @@ local k = import 'ksonnet/ksonnet.beta.3/k.libsonnet';
'--secure-listen-address=:9100',
'--upstream=http://127.0.0.1:9101/',
]) +
container.withPorts(containerPort.newNamed('https', 9100)) +
container.withPorts(containerPort.new(9100) + containerPort.withHostPort(9100) + containerPort.withName('https')) +
container.mixin.resources.withRequests({ cpu: '10m', memory: '20Mi' }) +
container.mixin.resources.withLimits({ cpu: '20m', memory: '40Mi' });
@ -108,7 +108,9 @@ local k = import 'ksonnet/ksonnet.beta.3/k.libsonnet';
daemonset.mixin.spec.template.spec.withVolumes([procVolume, sysVolume]) +
daemonset.mixin.spec.template.spec.securityContext.withRunAsNonRoot(true) +
daemonset.mixin.spec.template.spec.securityContext.withRunAsUser(65534) +
daemonset.mixin.spec.template.spec.withServiceAccountName('node-exporter'),
daemonset.mixin.spec.template.spec.withServiceAccountName('node-exporter') +
daemonset.mixin.spec.template.spec.withHostPid(true) +
daemonset.mixin.spec.template.spec.withHostNetwork(true),
serviceAccount:
local serviceAccount = k.core.v1.serviceAccount;

View file

@ -42,6 +42,7 @@ spec:
name: kube-rbac-proxy
ports:
- containerPort: 9100
hostPort: 9100
name: https
resources:
limits:
@ -50,6 +51,8 @@ spec:
requests:
cpu: 10m
memory: 20Mi
hostNetwork: true
hostPID: true
nodeSelector:
beta.kubernetes.io/os: linux
securityContext: