fix(homarr): patch probes via PostSync hook

Chart v8.23.0 (homarr-labs/charts) doesn't support probe customization.
All attempts failed:
- probes.liveness.spec: ignored
- controller.probes: ignored
- livenessProbe.enabled: ignored

Solution: PostSync hook Job patches deployment after Helm sync.

Probe config:
- Liveness: 60s initial, 30s period, 5s timeout
- Readiness: 45s initial, 15s period, 5s timeout

App needs 30-45s for DB migrations, Redis, icon cache (27k+ icons).
This commit is contained in:
Story Crater Bot
2026-07-22 10:55:33 -07:00
parent e2c246cfcd
commit ce7a8bad81
3 changed files with 93 additions and 24 deletions
@@ -0,0 +1,90 @@
# PostSync hook to patch Homarr deployment probes
# Chart v8.23.0 doesn't support probe customization via values
apiVersion: batch/v1
kind: Job
metadata:
name: homarr-fix-probes
namespace: dashboard
annotations:
argocd.argoproj.io/hook: PostSync
argocd.argoproj.io/hook-delete-policy: BeforeHookCreation
spec:
backoffLimit: 3
template:
spec:
restartPolicy: Never
serviceAccountName: homarr-probe-patcher
containers:
- name: patch
image: bitnami/kubectl:1.31
command:
- /bin/bash
- -c
- |
set -e
echo "Patching Homarr deployment probes..."
kubectl -n dashboard patch deployment homarr --type=json -p='[
{
"op": "replace",
"path": "/spec/template/spec/containers/0/livenessProbe/initialDelaySeconds",
"value": 60
},
{
"op": "replace",
"path": "/spec/template/spec/containers/0/livenessProbe/periodSeconds",
"value": 30
},
{
"op": "replace",
"path": "/spec/template/spec/containers/0/livenessProbe/timeoutSeconds",
"value": 5
},
{
"op": "replace",
"path": "/spec/template/spec/containers/0/readinessProbe/initialDelaySeconds",
"value": 45
},
{
"op": "replace",
"path": "/spec/template/spec/containers/0/readinessProbe/periodSeconds",
"value": 15
},
{
"op": "replace",
"path": "/spec/template/spec/containers/0/readinessProbe/timeoutSeconds",
"value": 5
}
]'
echo "Probes patched successfully"
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: homarr-probe-patcher
namespace: dashboard
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: homarr-probe-patcher
namespace: dashboard
rules:
- apiGroups: ["apps"]
resources: ["deployments"]
verbs: ["get", "patch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: homarr-probe-patcher
namespace: dashboard
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: homarr-probe-patcher
subjects:
- kind: ServiceAccount
name: homarr-probe-patcher
namespace: dashboard
+2 -22
View File
@@ -1,5 +1,5 @@
# Homarr landing page
# Chart version: 8.23.0 from homarr-labs/charts
# Homarr landing page - minimal config
# Probes patched via PostSync hook (chart doesn't support customization)
image:
repository: ghcr.io/homarr-labs/homarr
@@ -8,26 +8,6 @@ image:
replicaCount: 1
# Override probe timing - app needs 30-45s to fully initialize
controller:
probes:
liveness:
enabled: true
custom: false
spec:
initialDelaySeconds: 60
periodSeconds: 30
timeoutSeconds: 5
failureThreshold: 3
readiness:
enabled: true
custom: false
spec:
initialDelaySeconds: 45
periodSeconds: 15
timeoutSeconds: 5
failureThreshold: 3
tolerations:
- key: node-role.kubernetes.io/control-plane
operator: Exists
+1 -2
View File
@@ -3,5 +3,4 @@ kind: Kustomization
namespace: dashboard
resources:
- homarr-secrets.enc.yaml
# Homarr deployed via Helm chart (values in 60-applications.yaml multi-source Application).
# This kustomization just holds the SOPS-encrypted secrets.
- fix-probes-job.yaml