mirror of
https://github.com/go-admin-team/go-admin.git
synced 2026-09-21 02:04:09 +00:00
The manifest in this repository had no probes at all. A pod was sent traffic as soon as its container was running, whether or not the database it needs was reachable, and it was stopped with whatever grace period Kubernetes defaults to rather than one chosen against what this process actually spends shutting down. It now mounts both probes, at the endpoint that answers each question: readiness at /ready, which fails while a dependency is unreachable, and liveness at /health, which is a bare 200 because restarting a process whose database is down turns one outage into a crash loop. Both skip the rate limiter, which is why that had to land first. timeoutSeconds is 3, not the default 1. The handler allows its checks two seconds, so at the default a database answering in 1.2s would be recorded as a failed check while the handler was returning 200 - the probe would be failing on the orchestrator's stopwatch, not on its own. The comment beside that constant said the constraint was the polling period; the constraint is the per-check timeout, and it is now written down correctly. terminationGracePeriodSeconds is 30, against a shipped budget of 0 + 5 + 3. Raising drain means raising this too, in the same commit; the check that notices when somebody does not arrives two commits from here. replicas stays at 1, and the comment says why that makes the drain window worth nothing: there is nowhere to send the traffic this pod stops taking. Raising it needs one more change than the number - the volume is shared by every replica and the log path lives on it, so a second pod would append to the same rotating file. The reason not to raise it is not the one the review assumed: the claim was that the PVC is ReadWriteOnce, and it is not, it is ReadWriteMany on nfs-csi. There is no preStop hook. How long one should sleep depends on how fast the thing in front removes this instance, which the repository cannot know, and a manifest carrying both a preStop sleep and a drain window is the double-counting trap - the budget would be spent twice and the start-up line would report half of it.