IMIO / helm-plausible-analytics

Helm Chart for Plausible Analytics
Apache License 2.0
9 stars 8 forks source link

Liveness probe prematurely kills Plausible #11

Open reknih opened 2 months ago

reknih commented 2 months ago

Describe the bug

When first starting Plausible from the chart, the liveness probe reliably kills the plausible-analytics deployment before it has a chance to complete its initial migrations and become ready.

Version of Helm, Kubernetes and the plausible-analytics chart:

$ kubectl version  
Client Version: v1.29.1
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.28.5

$ helm version
version.BuildInfo{Version:"v3.13.2", GitCommit:"2a2fb3b98829f1e0be6fb18af2f6599e0f4e8243", GitTreeState:"clean", GoVersion:"go1.21.4"}

I used version 0.2.4 of the plausible-analytics chart

What happened:

Kubernetes kills Plausible when the logs reach this state:

Loading plausible..
Starting dependencies..
Starting repos..
create Plausible.Repo database if it doesn't exist
create Plausible.IngestRepo database if it doesn't exist
Creation of Db successful!
+ /entrypoint.sh db migrate
Loading plausible..
Starting dependencies..
Starting repos..
Running migrations for Elixir.Plausible.Repo

What you expected to happen:

A startup probe or a configurable initialDelaySeconds on the liveness probe allow the pod to take extra time to start up. Ideally, I can configure the probes in the values file.

How to reproduce it (as minimally and precisely as possible):

Have a slow server and start with an empty database. I pull the Maxmind GeoIP database and limit to 100m CPU, that may help reproducing this.

alexnuttinck commented 2 weeks ago

@reknih you can now define the livenessProbe and readinessProbe in the values.yaml. Does it work for you?