diff --git a/clusters/cl01tl/monitoring/shelly-plug/Chart.yaml b/clusters/cl01tl/monitoring/shelly-plug/Chart.yaml new file mode 100644 index 000000000..f3c215708 --- /dev/null +++ b/clusters/cl01tl/monitoring/shelly-plug/Chart.yaml @@ -0,0 +1,20 @@ +apiVersion: v2 +name: shelly-plug +version: 1.0.0 +description: Shelly Plug +keywords: + - shelly-plug + - metrics +home: https://wiki.alexlebens.dev/s/18b5575c-3a57-4515-89a0-b23d6df8dec4 +sources: + - https://github.com/geerlingguy/shelly-plug-prometheus + - https://hub.docker.com/_/php + - https://github.com/bjw-s/helm-charts/blob/main/charts/other/app-template/values.yaml +maintainers: + - name: alexlebens +dependencies: + - name: app-template + alias: shelly-plug + repository: https://bjw-s-labs.github.io/helm-charts/ + version: 4.0.1 +appVersion: 1.0.0 diff --git a/clusters/cl01tl/monitoring/shelly-plug/templates/external-secret.yaml b/clusters/cl01tl/monitoring/shelly-plug/templates/external-secret.yaml new file mode 100644 index 000000000..5fb51c129 --- /dev/null +++ b/clusters/cl01tl/monitoring/shelly-plug/templates/external-secret.yaml @@ -0,0 +1,28 @@ +apiVersion: external-secrets.io/v1 +kind: ExternalSecret +metadata: + name: shelly-plug-config-secret + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: shelly-plug-config-secret + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/part-of: {{ .Release.Name }} +spec: + secretStoreRef: + kind: ClusterSecretStore + name: vault + data: + - secretKey: SHELLY_HTTP_USERNAME + remoteRef: + conversionStrategy: Default + decodingStrategy: None + key: /shelly-plug/auth/it05sp + metadataPolicy: None + property: SHELLY_HTTP_USERNAME + - secretKey: SHELLY_HTTP_PASSWORD + remoteRef: + conversionStrategy: Default + decodingStrategy: None + key: /shelly-plug/auth/it05sp + metadataPolicy: None + property: SHELLY_HTTP_PASSWORD diff --git a/clusters/cl01tl/monitoring/shelly-plug/templates/service-monitor.yaml b/clusters/cl01tl/monitoring/shelly-plug/templates/service-monitor.yaml new file mode 100644 index 000000000..e2070e4a4 --- /dev/null +++ b/clusters/cl01tl/monitoring/shelly-plug/templates/service-monitor.yaml @@ -0,0 +1,19 @@ +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: shelly-plug + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: shelly-plug + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/part-of: {{ .Release.Name }} +spec: + selector: + matchLabels: + app.kubernetes.io/name: shelly-plug + app.kubernetes.io/instance: {{ .Release.Name }} + endpoints: + - port: metrics + interval: 30s + scrapeTimeout: 10s + path: /metrics diff --git a/clusters/cl01tl/monitoring/shelly-plug/values.yaml b/clusters/cl01tl/monitoring/shelly-plug/values.yaml new file mode 100644 index 000000000..4b7dbb80e --- /dev/null +++ b/clusters/cl01tl/monitoring/shelly-plug/values.yaml @@ -0,0 +1,63 @@ +shelly-plug: + controllers: + main: + type: deployment + replicas: 1 + strategy: Recreate + revisionHistoryLimit: 3 + initContainers: + init-clone-repo: + securityContext: + runAsUser: 0 + image: + repository: alpine/git + tag: 1.37.0 + pullPolicy: IfNotPresent + args: + - clone + - '--single-branch' + - '--' + - 'https://github.com/geerlingguy/shelly-plug-prometheus.git' + - '/var/www/html' + resources: + requests: + cpu: 10m + memory: 128Mi + containers: + main: + image: + repository: php + tag: 8.2.28-apache-bookworm + pullPolicy: IfNotPresent + env: + - name: SHELLY_HOSTNAME + value: it05sp.alexlebens.net + envFrom: + - secretRef: + name: shelly-plug-config-secret + resources: + requests: + cpu: 10m + memory: 64Mi + service: + main: + controller: main + ports: + metrics: + port: 80 + targetPort: 80 + protocol: TCP + persistence: + script: + storageClass: ceph-block + accessMode: ReadWriteOnce + size: 1Gi + retain: true + advancedMounts: + main: + init-clone-repo: + - path: /var/www/html + readOnly: false + main: + - path: /var/www/html + readOnly: false