apiVersion: apps/v1 kind: Deployment metadata: name: shelly-plug labels: app.kubernetes.io/controller: main app.kubernetes.io/instance: shelly-plug app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: shelly-plug helm.sh/chart: shelly-plug-4.6.2 namespace: shelly-plug spec: revisionHistoryLimit: 3 replicas: 1 strategy: type: Recreate selector: matchLabels: app.kubernetes.io/controller: main app.kubernetes.io/name: shelly-plug app.kubernetes.io/instance: shelly-plug template: metadata: labels: app.kubernetes.io/controller: main app.kubernetes.io/instance: shelly-plug app.kubernetes.io/name: shelly-plug spec: enableServiceLinks: false serviceAccountName: default automountServiceAccountToken: true hostIPC: false hostNetwork: false hostPID: false dnsPolicy: ClusterFirst initContainers: - command: - /bin/sh - -ec - | cd /var/www/html if [ -d ".git" ]; then echo "Git repository found. Pulling latest changes..." git pull else echo "Not a git repository. Initializing ..." git init git remote add origin https://github.com/geerlingguy/shelly-plug-prometheus.git git fetch origin git checkout origin/master -ft fi image: alpine/git:2.52.0@sha256:d453f54c83320412aa89c391b076930bd8569bc1012285e8c68ce2d4435826a3 name: init-fetch-repo securityContext: runAsUser: 0 volumeMounts: - mountPath: /var/www/html name: script containers: - env: - name: SHELLY_HOSTNAME value: it05sp.alexlebens.net - name: SHELLY_GENERATION value: "2" envFrom: - secretRef: name: shelly-plug-config-secret image: php:8.5.4-apache@sha256:e55a9f8e4caa09c6a31ec752b307675d847bb8546d975f379128cb2a99842b96 name: main resources: requests: cpu: 1m memory: 20Mi volumeMounts: - mountPath: /var/www/html name: script volumes: - name: script persistentVolumeClaim: claimName: shelly-plug