-
Notifications
You must be signed in to change notification settings - Fork 349
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
feat: add support for wait command #2041
Conversation
eac44ac
to
2bdc963
Compare
To help ensure the Proxy is up and ready, this commit adds a wait command with an optional `--max` flag to set the maximum time to wait. By default when invoking this command: ./cloud-sql-proxy wait The Proxy will wait up to the maximum time for the /startup endpoint to respond. This command requires that the Proxy be started in another process with the HTTP health check enabled. If an alternate health check port or address is used, as in: ./cloud-sql-proxy <INSTANCE_CONNECTION_NAME> --http-address 0.0.0.0 \ --http-port 9191 Then the wait command must also be told to use the same custom values: ./cloud-sql-proxy wait --http-address 0.0.0.0 \ --http-port 9191 By default the wait command will wait 30 seconds. To alter this value, use: ./cloud-sql-proxy wait --max 10s Fixes #1117
2bdc963
to
73c556a
Compare
cmd/root.go
Outdated
|
||
Sometimes it is necessary to wait for the Proxy to start. | ||
|
||
To help ensure the Proxy is up and ready, the Proxy includes adds a wait |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To help ensure the Proxy is up and ready, the Proxy includes adds a wait | |
To help ensure the Proxy is up and ready, the Proxy includes a wait |
cmd/root.go
Outdated
To help ensure the Proxy is up and ready, the Proxy includes adds a wait | ||
subcommand with an optional --max flag to set the maximum time to wait. | ||
|
||
By default when invoking this command: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is slightly confusing ... reads a little funny
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Hi @enocom , is this feature also added in cloud-sql-proxy v1? |
@vvxxvvxx The wait command is not supported in the v1 version of the Cloud SQL Proxy. We highly recommend upgrading to v2 to take advantage of new features as v1 is mostly in maintenance mode (bug fixes and dep updates only). You can check out the migration guide for more detailed steps to do so. If there is anything holding you back from migrating, please let us know 😄 |
hi @enocom could you update the examples or provide an example of how this would work with a poststart hook? I've been struggling to get it to work as described |
Hi @mdering! Now that k8s supports sidecar configurations I would recommend taking a look at and using the Cloud SQL Proxy as an |
hi @jackwotherspoon, thanks for your help! I was interested in using it as a sidecar for jobs and services, is that no longer the pattern you recommend? It seems like the regular application won't start until the EDIT: It does indeed seem like I'm missing something! |
Hi @mdering, the new official "sidecar container" support in K8S is indeed a bit misleading, as it requires using |
To help ensure the Proxy is up and ready, this commit adds a wait command with an optional
--max
flag to set the maximum time to wait.By default when invoking this command:
The Proxy will wait up to the maximum time for the /startup endpoint to respond. This command requires that the Proxy be started in another process with the HTTP health check enabled. If an alternate health check port or address is used, as in:
Then the wait command must also be told to use the same custom values:
By default the wait command will wait 30 seconds. To alter this value, use:
Fixes #1117