Skip to content

Added option to indicate which address to listen - #2

Closed
jasonjei wants to merge 1 commit into
GoogleCloudPlatform:masterfrom
jasonjei:master
Closed

Added option to indicate which address to listen#2
jasonjei wants to merge 1 commit into
GoogleCloudPlatform:masterfrom
jasonjei:master

Conversation

@jasonjei

@jasonjei jasonjei commented Mar 7, 2016

Copy link
Copy Markdown

In addition to being able to use ./cloud_sql_proxy -dir=/cloudsql -instances=PROJECT:REGION:INSTANCE=tcp:PORT functionality, I think it is important to be able to indicate which ADDRESS to listen with a -instances=PROJECT:REGION:INSTANCE=tcp:PORT:ADDRESS option.

The main use case is using with Docker and GKE. I'd like to be able to use TCP to simplify Docker Google Container Engine deployments and simply have my existing services look for the cloud SQL proxy service.

So now, I can advertise a proxy service with the port 3306 open in my Kubernetes setup. The proxy uses 127.0.0.1, which I think is a good default, but for having a proxy available for use by other Kubernetes services, I'd need to advertise 0.0.0.0.

The alternative options are not good. To use CloudSQL today with Google Container Engine, I would have to have my existing Docker containers to run an additional process (which is against the Docker philosophy of one container one process). Alternatively, one GKE user has proposed using a Docker container called cloudsqlip which polls running GKE nodes every few seconds and adds new entries into the ACL via IP, which I also think is undesirable.

I'd really prefer not to modify my existing Docker containers running on Google Container Engine to include the cloud_sql_proxy binary, so running an additional Docker container to access CloudSQL seems like a decent option. Isn't that the Docker way of doing things?

Let me know what you think.

In addition to being able to use ./cloud_sql_proxy -dir=/cloudsql
-instances=PROJECT:REGION:INSTANCE=tcp:PORT functionality,
I think it is important to be able to indicate which ADDRESS to
listen with a -instances=PROJECT:REGION:INSTANCE=tcp:PORT:ADDRESS
option.

The main use case is using with Docker and GKE. I'd like to be
able to use the TCP to simplify Docker Google Container Engine
deployments and simply have my existing services look for the
proxy service.
@Carrotman42

Copy link
Copy Markdown
Contributor

Thanks for the pull request! I've actually implemented something similar in my pull request [0]. I don't have time to go through it right now, but hopefully the request will be merged by the end of the week.

[0] #1

@Carrotman42

Copy link
Copy Markdown
Contributor

I've merged the other pull request that does the same thing, so I'll close this one.

Thanks again for the contribution! If you have any other features/bugfixes/anything I'd be happy to accept them.

@jasonjei

Copy link
Copy Markdown
Author

No problem, thanks for making this utility and making the source available before the update was pushed. Sure beats managing ACLs!

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