apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: hommer
|
|
labels:
|
|
app: hommer
|
|
spec:
|
|
selector:
|
|
matchLabels:
|
|
app: hommer
|
|
replicas: 1 # You could also consider elastic scaling for this deployment
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: hommer
|
|
spec:
|
|
restartPolicy: Always
|
|
volumes:
|
|
- name: git-repo-volume
|
|
emptyDir: {}
|
|
initContainers:
|
|
- name: git-cloner
|
|
image: alpine/git:latest
|
|
command:
|
|
- sh
|
|
- -c
|
|
- | # <--- This indicates a multi-line string. Indent the lines below it.
|
|
rm -rf /shared-git-data/Homepage-Dashboard && \
|
|
git clone https://git.anpham.me/DurianLAB/Homepage-Dashboard.git /shared-git-data/Homepage-Dashboard
|
|
volumeMounts:
|
|
- name: git-repo-volume
|
|
mountPath: /shared-git-data
|
|
containers:
|
|
- name: hommer
|
|
image: b4bz/homer:v23.09.1
|
|
volumeMounts:
|
|
- name: git-repo-volume
|
|
mountPath: /www/assets
|
|
subPath: Homepage-Dashboard/assets
|
|
ports:
|
|
- containerPort: 8080
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /
|
|
port: 8080
|
|
initialDelaySeconds: 10
|
|
periodSeconds: 10
|
|
timeoutSeconds: 5
|
|
failureThreshold: 15
|
|
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: hommer-dashboard
|
|
spec:
|
|
selector:
|
|
app: hommer
|
|
ports:
|
|
- port: 82
|
|
targetPort: 8080
|