From b8e08002dd2dcefdef47eebc2c95f4a5fe62d488 Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Sat, 20 Sep 2025 10:57:39 +0100 Subject: [PATCH] Added ephemeral-storage-exporter Signed-off-by: Marcus Noble --- .../ephemeral-storage-exporter.yaml | 142 ++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 manifests/monitoring/ephemeral-storage-exporter.yaml diff --git a/manifests/monitoring/ephemeral-storage-exporter.yaml b/manifests/monitoring/ephemeral-storage-exporter.yaml new file mode 100644 index 0000000..9f461a3 --- /dev/null +++ b/manifests/monitoring/ephemeral-storage-exporter.yaml @@ -0,0 +1,142 @@ +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + labels: + app.kubernetes.io/name: k8s-ephemeral-storage-metrics + name: k8s-ephemeral-storage-metrics + namespace: monitoring +--- +kind: ClusterRole +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: k8s-ephemeral-storage-metrics + labels: + app.kubernetes.io/name: k8s-ephemeral-storage-metrics +rules: + - apiGroups: [""] + resources: ["nodes","nodes/proxy", "nodes/stats", "pods"] + verbs: ["get","list", "watch"] +--- +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: k8s-ephemeral-storage-metrics + labels: + app.kubernetes.io/name: k8s-ephemeral-storage-metrics +subjects: + - kind: ServiceAccount + name: k8s-ephemeral-storage-metrics + namespace: monitoring +roleRef: + kind: ClusterRole + name: k8s-ephemeral-storage-metrics + apiGroup: rbac.authorization.k8s.io +--- +apiVersion: v1 +kind: Service +metadata: + name: k8s-ephemeral-storage-metrics + namespace: monitoring + labels: + app.kubernetes.io/name: k8s-ephemeral-storage-metrics + annotations: + prometheus.io/scrape: "true" + prometheus.io/port: "9100" +spec: + type: ClusterIP + selector: + app.kubernetes.io/name: k8s-ephemeral-storage-metrics + ports: + - name: metrics + port: 9100 + protocol: TCP + targetPort: metrics +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: k8s-ephemeral-storage-metrics + namespace: monitoring + labels: + app.kubernetes.io/name: k8s-ephemeral-storage-metrics +spec: + replicas: 1 + revisionHistoryLimit: 3 + selector: + matchLabels: + app.kubernetes.io/name: k8s-ephemeral-storage-metrics + template: + metadata: + labels: + app.kubernetes.io/name: k8s-ephemeral-storage-metrics + spec: + serviceAccountName: k8s-ephemeral-storage-metrics + securityContext: + runAsNonRoot: true + seccompProfile: + type: RuntimeDefault + containers: + - name: metrics + image: ghcr.io/jmcgrath207/k8s-ephemeral-storage-metrics:1.18.2 + imagePullPolicy: IfNotPresent + ports: + - name: metrics + containerPort: 9100 + protocol: TCP + livenessProbe: + failureThreshold: 10 + httpGet: + path: /metrics + port: 9100 + scheme: HTTP + initialDelaySeconds: 10 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 30 + readinessProbe: + failureThreshold: 10 + httpGet: + path: /metrics + port: 9100 + scheme: HTTP + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 1 + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: + - ALL + privileged: false + readOnlyRootFilesystem: false + runAsNonRoot: true + env: + - name: DEPLOY_TYPE + value: "Deployment" + - name: SCRAPE_INTERVAL + value: "15" + - name: MAX_NODE_CONCURRENCY + value: "10" + - name: CLIENT_GO_QPS + value: "5" + - name: CLIENT_GO_BURST + value: "10" + - name: LOG_LEVEL + value: "info" + - name: EPHEMERAL_STORAGE_POD_USAGE + value: "true" + - name: EPHEMERAL_STORAGE_NODE_AVAILABLE + value: "true" + - name: EPHEMERAL_STORAGE_NODE_CAPACITY + value: "true" + - name: EPHEMERAL_STORAGE_NODE_PERCENTAGE + value: "true" + - name: EPHEMERAL_STORAGE_CONTAINER_LIMIT_PERCENTAGE + value: "true" + - name: EPHEMERAL_STORAGE_CONTAINER_VOLUME_USAGE + value: "true" + - name: EPHEMERAL_STORAGE_CONTAINER_VOLUME_LIMITS_PERCENTAGE + value: "true" + - name: EPHEMERAL_STORAGE_INODES + value: "true"