rstudio / helm

Helm Resources for RStudio Products
MIT License
32 stars 28 forks source link

Allow overriding prestart scripts? #467

Open pat-s opened 6 months ago

pat-s commented 6 months ago

The prestart scripts do not work in all environments, especially not in ones where one is not running as root and cannot execute commands like update-ca-certificates or perform custom mount operations.

A config option which allows specifying the contents of prestart verbatim would be good to have. So far, we need to fork/deviate from the helm chart to be able to override/customize prestart scripts.

Would you be open for a PR which allows this?

colearendt commented 5 months ago

Thanks so much for your PR in #453 !

Do you still need more flexibility on the prestart scripts?

We are definitely open to adding more flexibility here!

For what it's worth, the way things currently work:

flowchart TB;
  k8s("k8s pod - cmd")-->supervisord
  supervisord-->workbench-unit
  workbench-unit-->workbench-prestart
  supervisord-->launcher-unit
  launcher-unit-->launcher-prestart
  workbench-prestart-->wait-for-launcher
  wait-for-launcher-->workbench
  launcher-prestart-->launcher
  launcher-->wait-for-launcher

One way to create an escape hatch is by customizing the unit files (mounting over them, changing the config of supervisord directly / mounting over /etc/supervisord.conf, etc.):

flowchart TB;
  k8s("k8s pod - cmd")-->supervisord
  supervisord-->custom-workbench-unit
  custom-workbench-unit-->custom-workbench-prestart
  supervisord-->custom-launcher-unit
  custom-launcher-unit-->custom-launcher-prestart
  custom-workbench-prestart-->wait-for-launcher
  wait-for-launcher-->workbench
  custom-launcher-prestart-->launcher
  launcher-->wait-for-launcher

It's a bit tedious, so I definitely can see the argument for an easier way to customize the prestart scripts! Is #453 sufficient for you or do you still need a better escape hatch?

pat-s commented 5 months ago

453 helped to allow using RHEL-based images. Yet to debug and try things out I had to fork and customize the chart source locally as I couldn't overwrite the prestart scripts inline.

I am not sure if this is needed again at some point, but adding the possibility to have an inline override would surely make things easier for users in such cases.