Skip to content

Commit

Permalink
Merge pull request #65 from kongfei605/daemonset
Browse files Browse the repository at this point in the history
collect kubelet metrics with daemonset
  • Loading branch information
UlricQin authored Jul 4, 2022
2 parents fc8666e + 74cda67 commit 56b42c7
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions k8s/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ rules:
- nodes/proxy
verbs:
- get
- nonResourceURLs:
- /metrics
verbs:
- get
---
apiVersion: v1
kind: ServiceAccount
Expand Down Expand Up @@ -299,6 +295,26 @@ data:
insecure_skip_verify = true
---
kind: ConfigMap
metadata:
name: input-kubelet-metrics
apiVersion: v1
data:
prometheus.toml: |
# # collect interval
# interval = 15
[[instances]]
# kubelete metrics & cadvisor
urls = ["https://127.0.0.1:10250/metrics", "https://127.0.0.1:10250/metrics/cadvisor"]
bearer_token_file = "/var/run/secrets/kubernetes.io/serviceaccount/token"
use_tls = true
insecure_skip_verify = true
url_label_key = "instance"
url_label_value = "{{.Host}}"
# if you use dashboards, do not delete this label
labels = {job="categraf"}
---
kind: ConfigMap
metadata:
name: input-kernel
apiVersion: v1
Expand Down Expand Up @@ -583,6 +599,8 @@ spec:
name: input-docker
- mountPath: /etc/categraf/conf/input.kubernetes
name: input-kubernetes
- mountPath: /etc/categraf/conf/input.prometheus
name: input-kubelet-metrics
- mountPath: /etc/categraf/conf/input.kernel
name: input-kernel
- mountPath: /etc/categraf/conf/input.kernel_vmstat
Expand Down Expand Up @@ -646,6 +664,10 @@ spec:
defaultMode: 420
name: input-kubernetes
name: input-kubernetes
- configMap:
defaultMode: 420
name: input-kubelet-metrics
name: input-kubelet-mertrics
- configMap:
defaultMode: 420
name: input-kernel
Expand Down

0 comments on commit 56b42c7

Please sign in to comment.