Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for reloading application running in a container instead of rolling update #33

Open
rasheedamir opened this issue Dec 4, 2018 · 5 comments
Labels
kind/enhancement New feature or request workflow/todo

Comments

@rasheedamir
Copy link
Member

Suggested by Marton Szucs in slack channel:

For applications that supports updating configuration at runtime, like pgbouncer or nginx, it would be nice to just reload the application inside a running container. Instead of restarting the whole Pod using a rolling update.

This is how I do it manually:

  • Change configmap/secret and apply it to the cluster
  • Exec into the container that has mounted the configmap/secret as a file.
  • Check if the mounted file is updated inside the container
  • reload application with kill -SIGHUP 1 or nginx -s reload or some other application specific command.

Questions:

  • Will it be safe?
  • Look into how does nginx ingress controller does it right now? It indeed never does rolling update but does have new configs!
@rasheedamir
Copy link
Member Author

Yes it will be awesome to have this feature in place! e.g. in case of fluentd assume we have 50 nodes then it will take too much for rolling update of all pods in the daemonset; but if have restart of process then it will happen at sametime in all

@waseem-h
Copy link
Contributor

Here's how vmware does it in their fluentd operator: https://github.com/vmware/kube-fluentd-operator/blob/master/config-reloader/fluentd/reloader.go#L26

Basically we have to enable rpc endpoint for fluentfd as mentioned here: https://docs.fluentd.org/v1.0/articles/rpc#configuration

In general, we can add support for reloading applications via RPC endpoint

  • An application will contain annotation with the RPC endpoint to call
  • Instead of rolling update, we can call the RPC endpoint mentioned (in all pods)

@grzesuav
Copy link

Question : how it will guarantee HA of application? Will it respect deployment settings during restarting?

@mrmuli
Copy link

mrmuli commented May 13, 2019

I would also like to put in consideration for applications with required bootstrapping on start or restart. Unless this will be implemented towards very specifically defined apps or those running behind process managers. I'm not sure how this would work out, seems very diverse?

@ankon
Copy link

ankon commented Oct 29, 2019

We're using https://github.com/weaveworks/watch for this purpose:

  1. Mount the configmap as volume into a side-car running watch
  2. Watch the mount point/files in it
  3. Trigger the reload by issueing a curl command to the actual app

@rasheedamir rasheedamir added the kind/enhancement New feature or request label Nov 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request workflow/todo
Projects
None yet
Development

No branches or pull requests

5 participants