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: volumes: - name: git-repo-volume emptyDir: {} # - name: config-volume # configMap: # name: homer-config # Define init container initContainers: - name: git-cloner image: alpine/git:latest command: ["git", "clone", "https://git.anpham.me/DurianLAB/Homepage-Dashboard.git", "/shared-git-data/Homepage-Dashboard"] volumeMounts: - name: git-repo-volume mountPath: /shared-git-data livenessProbe: exec: command: - ls - /shared-git-data/Homepage-Dashboard/.git # Check for a file/directory inside the cloned repo initialDelaySeconds: 5 # Wait 5 seconds before the first probe periodSeconds: 10 # Check every 10 seconds timeoutSeconds: 5 # Probe times out after 5 seconds failureThreshold: 3 # After 3 failed attempts, consider the container unhealthy containers: - name: hommer image: b4bz/homer:v23.09.1 volumeMounts: - name: git-repo-volume mountPath: /www/assets subPath: Homepage-Dashboard/assets # - name: config-volume # mountPath: /www/assets ports: - containerPort: 8080 --- apiVersion: v1 kind: Service metadata: name: hommer-dashboard spec: selector: app: hommer ports: - port: 82 targetPort: 8080