sorry-cypress / charts

A Kubernetes Helm Chart for Sorry Cypress, an open-source on-premise, self-hosted alternative to cypress dashboard.
https://sorry-cypress.dev
MIT License
42 stars 79 forks source link

Internal mongo db does not recover on pod restarts #183

Open luischre opened 1 year ago

luischre commented 1 year ago

Summary

Currently if using the internal mongo db, the deployment works fine. However as soon as some pod of the replicaset has a restart for whatever reason, the replicaset never manages to get functional again.

I've looked into it and it seems to be due to the externalAccess being set to true for the mongo deployment (https://github.com/sorry-cypress/charts/blob/main/charts/sorry-cypress/values.yaml#L350).

Due to this setting MONGODB_ADVERTISED_HOSTNAME is not set and from my understanding this is required for a replicaset to recover (https://github.com/bitnami/charts/blob/main/bitnami/mongodb/templates/replicaset/statefulset.yaml#L237-L240).

I've now come up with the following workaround:

mongodb:
  internal_db:
    enabled: true
  externalAccess:
    enabled: false
  mongoConnectionString: "mongodb://sorry-cypress-2-mongodb-headless:27017/sorry-cypress?replicaSet=rs0"

As disabling the external access causes some sorry-cypress pods to not be able to start up, I also had to adjust the mongo connection string.

What I do not yet get is why the externalAccess is required in the first place? As said I now disabled this and with the adjusted connection string it just seem to work fine. Are there any consequences that I am currently missing?

Otherwise I would propose to adjust the values accordingly.

How to reproduce

Deploy sorry-cypress with an internal mongo db and restart any of the mongo db pods.

Environment