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

re-configure envoy without restart? #424

Open
eitansuez opened this issue Feb 3, 2022 · 6 comments
Open

re-configure envoy without restart? #424

eitansuez opened this issue Feb 3, 2022 · 6 comments
Labels
enhancement New feature or request

Comments

@eitansuez
Copy link

Is your feature request related to a problem? Please describe.
no.

Describe the solution you'd like
when we run an envoy with func-e run -c <configfile>, if i later make a change to my config, the procedure is to ctrl+c the current envoy, and re-run the command. since envoy by default supports "hot reloading" of configuration, it would be cool if all one had to do was edit and save the config file for the changes to get picked up by func-e to push the updated config to envoy, without a restart.

Describe alternatives you've considered
ctrl+c and re-run the command.

Additional context
none

@eitansuez eitansuez added the enhancement New feature or request label Feb 3, 2022
@codefromthecrypt
Copy link
Contributor

hi there. I recall at some point we indirected the config file, but now we have tests that we don't mess with it. IOTW -c passes that arg directly to envoy and doesn't change the path to the config at all (it can even be in the current directory).

I also became confused as to what envoy actually supports vs what is done with scripts, and seem not alone envoyproxy/envoy#19515

It appears at first glance that it doesn't internally use inotify rather scripts to do that... That's an uneducated guess as I have no idea why you would need a script if it supported it internal. We probably need an envoy expert to answer that or docs to be clarified on the above envoy issue about if 'hot restart' support really means a python script. If that's all it means, then probably we could consider externalizing that here, but if internally it already does it and just no one knows how, maybe we can make an example instead

@dio
Copy link
Collaborator

dio commented Feb 4, 2022

Not sure if it is related, but we could possibly use dynamic configuration from filesystem: https://www.envoyproxy.io/docs/envoy/latest/start/quick-start/configuration-dynamic-filesystem, also see: https://www.tetrate.io/blog/envoy-101-file-based-dynamic-configurations/.

@eitansuez
Copy link
Author

thank you for sharing your thoughts. this came up in a chat earlier today and it initially sounded very interesting and i wanted to make sure and capture it. i suppose the value of such a feature depends on the use case. if func-e is used in the context of experimenting with different configurations / learning, i'm starting to realize this "feature" is largely superfluous. in other contexts such as when envoy is an active participant in a larger system (i.e. a mesh) then leaning on its configuration api becomes important. and istio already does that.

@eitansuez
Copy link
Author

thanks dio for the links.

@dio
Copy link
Collaborator

dio commented Feb 4, 2022

⚠️ This is a sketch ☢️

Please don't hate me because I do a silly thing like this 🙏🏽.

I'm starting to realize this "feature" is largely superfluous

@eitansuez So do you mean editing a "static"-config only scenario, is it the one we should have?

How about this: so when you have a valid config, for example from https://raw.githubusercontent.com/envoyproxy/envoy/main/configs/envoyproxy_io_proxy.yaml, you can do:

go run github.com/dio/pc@main func-e run -c ./envoyproxy_io_proxy.yaml

Then edit the YAML, Envoy will get a new config (see on the video I updated www.envoyproxy.io to www.google.com).

A complete command (download and run):

curl https://raw.githubusercontent.com/envoyproxy/envoy/main/configs/envoyproxy_io_proxy.yaml > config.yaml && \
go run github.com/dio/pc@main func-e run -c ./config.yaml
Screen.Recording.2022-02-04.at.18.05.27.mov

Also, the cmd+C sometimes doesn't cleanly stop envoy on macOS, haha. ps aux | grep func-e to help.

@eitansuez
Copy link
Author

wow, that was easy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants