Parcourir la source

add shelly exporter

Josh Bicking il y a 3 mois
Parent
commit
ba05f9d6ed

+ 2 - 0
gogs.yaml

@@ -25,6 +25,8 @@ spec:
         env:
         - name: SOCAT_LINK
           value: "false"
+          name: DISABLE_REGISTRATION
+          value: "true"
         ports:
         - containerPort: 22
           name: ssh-svc

+ 3 - 3
monitoring/prometheus/prometheus.yaml

@@ -5,7 +5,7 @@ metadata:
   namespace: monitoring
 spec:
   replicas: 1
-  retention: 7d
+  retention: 365d
   resources:
     requests:
       memory: 400Mi
@@ -25,7 +25,7 @@ spec:
       - traefik
       - rook-ceph-mgr
       - cloudflared
-      - shelly-plug-prometheus
+      - shelly-plug-exporter
   serviceMonitorNamespaceSelector:
     matchExpressions:
     - key: kubernetes.io/metadata.name
@@ -40,4 +40,4 @@ spec:
         storageClassName: ceph-block
         resources:
           requests:
-            storage: 50Gi
+            storage: 100Gi

+ 18 - 0
monitoring/targets/shelly-plug-exporter.yaml

@@ -0,0 +1,18 @@
+apiVersion: monitoring.coreos.com/v1
+kind: ServiceMonitor
+metadata:
+  labels:
+    app: shelly-plug-exporter
+    name: shelly-plug-exporter
+  name: shelly-plug-exporter
+  namespace: monitoring
+spec:
+  endpoints:
+  - port: metrics
+    path: /probe
+  namespaceSelector:
+    matchNames:
+    - homeassistant
+  selector:
+    matchLabels:
+      app: shelly-plug-exporter

+ 54 - 0
shelly-plug-exporter.yaml

@@ -0,0 +1,54 @@
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: shelly-plug-exporter
+  namespace: homeassistant
+  annotations:
+    prometheus.io/path: /probe
+    prometheus.io/port: "8080"
+    prometheus.io/scrape: "true"
+spec:
+  selector:
+    matchLabels:
+      app: shelly-plug-exporter
+  replicas: 1
+  template:
+    metadata:
+      labels:
+        app: shelly-plug-exporter
+    spec:
+      containers:
+      - name: shelly-plug-exporter
+        image: jibby0/shelly-plug-exporter:24.2.0-fork
+        ports:
+        - containerPort: 8080
+          name: metrics
+        env:
+        - name: SHELLY_HOST_SHELLYPLUSES
+          value: 172.16.69.85,172.16.69.173
+        - name: SHELLY_AUTH_USERNAME
+          value: admin
+        - name: SHELLY_AUTH_PASSWORD
+          valueFrom:
+            secretKeyRef:
+              name: shelly-plug-exporter
+              key: password
+              optional: false
+---
+apiVersion: v1
+kind: Service
+metadata:
+  name: shelly-plug-exporter
+  namespace: homeassistant
+  labels:
+    app: shelly-plug-exporter
+spec:
+  selector:
+    app: shelly-plug-exporter
+  type: ClusterIP
+  ports:
+  - name: metrics
+    protocol: TCP
+    port: 8080
+    targetPort: metrics

+ 1 - 0
traefik-helmchartconfig.yaml

@@ -35,6 +35,7 @@ spec:
     ports:
       metrics:
         expose: true
+        exposedPort: 9101
     volumes:
       - name: traefik-config
         mountPath: "/config"