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

Allow for project & region discovery #1370

Conversation

davidcollom
Copy link

Change Description

We have a usecase in which we have multiple CloudSQL instances across various regions, in which we never want to have cross region communications.
Currently when using -dir and -project we have an all or nothing approach.

With the changes proposed here, we are then able to scope project & region as a limiting factor, only creating sockets for those CloudSQL instances within the region in which cloudsql-proxy is running within.

Checklist

  • Make sure to open an issue as a
    bug/issue
    before writing your code! That way we can discuss the change, evaluate
    designs, and agree on the general idea.
  • Ensure the tests and linter pass
  • Appropriate documentation is updated (if necessary)

@davidcollom davidcollom requested a review from a team September 1, 2022 18:25
@google-cla
Copy link

google-cla bot commented Sep 1, 2022

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@enocom
Copy link
Member

enocom commented Sep 1, 2022

Thanks for the PR @davidcollom. We normally like to start stuff like this with an issue, but it looks like a small change.

In v2 we purposely decided not to port the projects flag given its chance of user error (e.g., woops, I didn't want to enable a connection for this instance). Out of curiosity why don't you use explicit instance connection names to solve your use case?

@davidcollom
Copy link
Author

davidcollom commented Sep 1, 2022

Hey @enocom I noticed the issue first once I'd already created the code 🤦‍♂️.

We don't want to specifically name the instances as we dynamically scale up/down read-replicas along with instances as we scale applications within that region.

Additionally we'd like to not restart the proxy when we do this as our applications as this could impact multiple applications at a time and/or additional upstream failures (queries in flight etc)

In terms of V2... It would be nice overall to allow project + labels lookup to give finer grained connections in a dynamic environment.

@enocom
Copy link
Member

enocom commented Sep 1, 2022

Would you mind filing an issue so we can talk about it there? I'd like to land support for what you're requesting on v2 ideally.

Note we have an issue for supporting dynamic config which might be what you're looking for here: #1045.

Either way, right now as written this change only works when the proxy starts up by connecting to instances in the same region.

@enocom
Copy link
Member

enocom commented Sep 7, 2022

I think the dynamic config issue is pretty close to the request here. I'd like to explore the details a bit more before we move to implementation.

@enocom enocom closed this Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants