Skip to content

Commit

Permalink
updated the kubernetes example
Browse files Browse the repository at this point in the history
Signed-off-by: Luuk van den Maagdenberg <[email protected]>
  • Loading branch information
Luukvdm committed Jan 18, 2023
1 parent 9f476c6 commit f2a0985
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
15 changes: 6 additions & 9 deletions examples/kubernetes/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,33 @@ kind: DaemonSet
metadata:
name: systemd-exporter
labels:
name: systemd-exporter
app.kubernetes.io/name: systemd-exporter
spec:
selector:
matchLabels:
k8s-app: systemd-exporter
app.kubernetes.io/name: systemd-exporter
updateStrategy:
rollingUpdate:
maxUnavailable: 100%
type: RollingUpdate
template:
metadata:
labels:
k8s-app: systemd-exporter
annotations:
prometheus.io/scrape: "true"
prometheus.io/path: "/metrics"
prometheus.io/port: "9558"
app.kubernetes.io/name: systemd-exporter
spec:
securityContext:
runAsUser: 0
hostPID: true
hostNetwork: true
containers:
- name: systemd-exporter
image: quay.io/prometheuscommunity/systemd-exporter:master
image: prometheuscommunity/systemd-exporter
securityContext:
privileged: true
args:
- --log.level=info
- --path.procfs=/host/proc
- --collector.unit-whitelist=kubelet.service|docker.service
- --systemd.collector.unit-include=kubelet.service|docker.service|containerd.service
ports:
- name: metrics
containerPort: 9558
Expand Down
17 changes: 17 additions & 0 deletions examples/kubernetes/podmonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# requires that you have deployed the PodMonitor CRD (comes with Prometheus)
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: systemd-exporter
labels:
app.kubernetes.io/name: systemd-exporter-podmonitor
spec:
podMetricsEndpoints:
- port: metrics
path: "/metrics"
interval: 30s
scrapeTimeout: 10s
jobLabel: systemd-exporter
selector:
matchLabels:
app.kubernetes.io/name: systemd-exporter

0 comments on commit f2a0985

Please sign in to comment.