Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated the kubernetes example #79

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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