outline-helm-chart icon indicating copy to clipboard operation
outline-helm-chart copied to clipboard

Refactor to allow dedicated collaboration service

Open hwuethrich opened this issue 1 year ago • 5 comments

For real-time collaboration to work, the collaboration service is limited to a single replica: https://github.com/outline/outline/blob/main/docs/SERVICES.md

This PR refactors the chart to allow running a dedicated collaboration deployment (with 1 replica) and allows scaling the main deployment (with 1+ replicas).

Other changes:

  • Add cronjob to trigger Outline schedule jobs
  • Split the templates into separate files
  • Run database migration as helm hook instead of init container
  • Adapt chart to follow charts generated with chart create ...
  • Use shared helper for environment variables

Because I updated the spec.selector (which is immutable) you may have to delete the deployment first when upgrading:

kubectl delete deployment outline --cascade=orphan

hwuethrich avatar Mar 14 '23 10:03 hwuethrich

Thanks for your contribution @hwuethrich ! I'll review it and merge very soon since we also wanted to upgrade the chart to newer app versions and pattern. Since you already did a lot of this work it's helping this project really and we can skip some of the improvements we had to do.

PatrickHuetter avatar Mar 14 '23 11:03 PatrickHuetter

You're welcome! Some ideas for improvements:

  • Allow to use secrets for SECRET_KEY and UTILS_SECRET
  • Allow to use separate deployments for workers (and maybe other services), not only collaboration
  • Maybe the readiness/liveness probes are not configured correctly? It looks like pods are restarted a few times when the pod is starting... maybe add initial delay or startup probe.
  • Run curl as a CronJob to run scheduled jobs: https://wiki.generaloutline.com/s/hosting/doc/scheduled-jobs-RhZzCt770H

hwuethrich avatar Mar 14 '23 11:03 hwuethrich

@PatrickHuetter Please don't merge yet. I'll add some improvements.

hwuethrich avatar Mar 14 '23 11:03 hwuethrich

@PatrickHuetter I have added a cronjob to trigger scheduled jobs and made some smaller modifications. Feel free to review and merge

hwuethrich avatar Mar 14 '23 14:03 hwuethrich

@hwuethrich sorry, I didn't realise there was an open pull request on the branch :see_no_evil: I just reverted my commits.

Although https://github.com/zebbra/outline-helm-chart/commit/b4dde00325133dbc5d45bac042e5d55c59b42a0a could be applied without regression, the other https://github.com/encircle360-oss/outline-helm-chart/pull/7/commits/da4531c280609bf96b3a24ee6b9a67eaf81ea27b would have implications... but updating the dependent Charts would still be great, since the ones in the repo are rather old (e.g. PostgreSQL 11 is EOL)

Be aware that the helm hook breaks ArgoCD deployment because the hook depends on resources created afterwards (serviceAccount)

maetthu avatar Apr 30 '24 12:04 maetthu