diff --git a/manifests/kube-state-metrics/kustomization.yaml b/manifests/kube-state-metrics/kustomization.yaml new file mode 100644 index 0000000..b30f242 --- /dev/null +++ b/manifests/kube-state-metrics/kustomization.yaml @@ -0,0 +1,7 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: monitoring + +resources: + - git@github.com:kubernetes/kube-state-metrics/examples/standard?ref=v2.14.0 + - servicemonitor.yaml diff --git a/manifests/kube-state-metrics/servicemonitor.yaml b/manifests/kube-state-metrics/servicemonitor.yaml new file mode 100644 index 0000000..1fb7400 --- /dev/null +++ b/manifests/kube-state-metrics/servicemonitor.yaml @@ -0,0 +1,13 @@ +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: kube-state-metrics + namespace: monitoring +spec: + selector: + matchLabels: + app.kubernetes.io/component: exporter + app.kubernetes.io/name: kube-state-metrics + endpoints: + - port: http-metrics + path: /metrics diff --git a/manifests/kustomization.yaml b/manifests/kustomization.yaml index 8afc7ec..688c2c3 100644 --- a/manifests/kustomization.yaml +++ b/manifests/kustomization.yaml @@ -10,3 +10,4 @@ resources: - prometheus - grafana - node-exporter + - kube-state-metrics diff --git a/manifests/node-exporter/daemonset.yaml b/manifests/node-exporter/daemonset.yaml index 14c1d0c..6e1e2a7 100644 --- a/manifests/node-exporter/daemonset.yaml +++ b/manifests/node-exporter/daemonset.yaml @@ -22,8 +22,7 @@ spec: - --path.sysfs=/host/sys - --path.rootfs=/host/root - --no-collector.wifi - - --no-collector.hwmon - - --collector.filesystem.ignored-mount-points=^/(dev|proc|sys|var/lib/docker/.+|var/lib/kubelet/pods/.+)($|/) + - --collector.filesystem.ignored-mount-points=^/(dev|proc|var/lib/docker/.+|var/lib/kubelet/pods/.+)($|/) - --collector.netclass.ignored-devices=^(veth.*)$ name: node-exporter image: prom/node-exporter diff --git a/manifests/node-exporter/servicemonitor.yaml b/manifests/node-exporter/servicemonitor.yaml index 4818379..7957945 100644 --- a/manifests/node-exporter/servicemonitor.yaml +++ b/manifests/node-exporter/servicemonitor.yaml @@ -11,3 +11,6 @@ spec: endpoints: - port: node-exporter path: /metrics + relabelings: + - sourceLabels: [__meta_kubernetes_pod_node_name] + targetLabel: instance