75 lines
1.9 KiB
YAML
75 lines
1.9 KiB
YAML
shelly-plug:
|
|
controllers:
|
|
main:
|
|
type: deployment
|
|
replicas: 1
|
|
strategy: Recreate
|
|
revisionHistoryLimit: 3
|
|
initContainers:
|
|
init-fetch-repo:
|
|
securityContext:
|
|
runAsUser: 0
|
|
image:
|
|
repository: alpine/git
|
|
tag: latest
|
|
pullPolicy: IfNotPresent
|
|
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
|
|
resources:
|
|
requests:
|
|
cpu: 10m
|
|
memory: 128Mi
|
|
containers:
|
|
main:
|
|
image:
|
|
repository: php
|
|
tag: 8.4.10-apache-bookworm
|
|
pullPolicy: IfNotPresent
|
|
env:
|
|
- name: SHELLY_HOSTNAME
|
|
value: it05sp.alexlebens.net
|
|
- name: SHELLY_GENERATION
|
|
value: 2
|
|
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-fetch-repo:
|
|
- path: /var/www/html
|
|
readOnly: false
|
|
main:
|
|
- path: /var/www/html
|
|
readOnly: false
|