GoogleCloudPlatform / GoogleCloudPlatform/cloud-sql-proxy
Add support for dynamically updating instance config
- Lingua principale
- Go
- Stelle
- 1.4k
- Fork
- 352
- Merge medio
- 14h 54m
- PR unite (30g)
- 5
Descrizione
Hello. While many of our applications are container based with fixed topologies, we have several use cases that would greatly benefit from dynamic updates. We spoke with @ jonpjenkins from the Google Team and agreed to enter a feature request.
One such use case is a auditing system that needs to scan all of our databases for PII. This system will need to connect to many systems, and the list will need to be updated as new databases are added or switched. The scanners run in GKE, but for some bewildering reason or another, they are persistent and do not run on a 1:1 scanner to job model.
The most basic and effective model that we see is to:
- Define the configuration as a bucket, GSM or other object that is hosted on a central object service.
- Provide for a customer to define the object address at startup so that the appropriate configuration flexibility is maintained.
- Retrieve the configuraion every X seconds or minutes and perform a hot start if it changes.
- Limit hot starts so as to not cause a restart loop
Many popular servers such as TCP proxies allow for hot restarting by receiving a signal and then:
(a) running a lint check on the new configuration
(b) terminating the listener. Existing connections should continue to persist, using the old configuration and state, but the old daemon cannot receive new connections
(c) starting a new listener and worker pool that will receive new connections with the new configuration.
Apache, Sendmail, squid, Envoy and other processes use this basic reload feature for non-disruptive uploads.
Most of these examples provide easy to replicate hot restarts. I can give you the envoy hot restarted code if you're looking for an example of that. Their documentation is horrendous, but we're running it as a MySQL proxy on prem and we non-disruptively update the entire configuration this way out of the box!
Oh, one more thing:
For containers, it would be great if the configuration checker would kick off the hot restart. Same for GCE, but if you could allow a user to update the local config and manually kick off a hot restart, that would be extra great.
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.