Skip to content

Support configuring proxy with environment variables #225

Description

@micheas

With instances being a command line argument I cannot use k8s secrets to set the instance and then recycle the same deployment.yaml file between environments, but rather resort to a generator for the k8s config.

An example can be found at:

https://github.com/itkj/docker-cloud-sql-proxy/blob/master/Dockerfile#L10

from itkj/docker-cloud-sql-proxy on docker hub.

Activity

  1. added
    type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.
    on Nov 27, 2018
  2. self-assigned this
    on Dec 13, 2018
  3. removed their assignment
    on Nov 19, 2019
  4. added
    priority: p3Desirable enhancement or fix. May not be included in next release.
    on Feb 9, 2021
  5. enocom commented on Feb 10, 2021

    @enocom
    Member

    We're working on some major structural improvements to the proxy. Once those are complete, we'll come back to address this issue.

  6. changed the title [-]Ideally Instances would be a variable in the docker container.[/-] [+]Support configuring proxy with environment variables[/+] on Aug 29, 2022
  7. enocom commented on Aug 29, 2022

    @enocom
    Member

    The new v2 proxy uses cobra and makes it easy to integrate with viper. Now that the v2 proxy is out, I have this in my backlog.

  8. added
    priority: p0Highest priority. Critical issue. P0 implies highest priority.
    and removed
    priority: p3Desirable enhancement or fix. May not be included in next release.
    on Aug 29, 2022
  9. enocom commented on Aug 29, 2022

    @enocom
    Member

    This work will unblock #1045.

  10. hessjcg commented on Aug 31, 2022

    @hessjcg
    Member

    What if we did a kind of naming scheme for the environment variables:

    # global flag
    CLOUD_SQL_PROXY_PORT=5000 
    CLOUD_SQL_PROXY_CREDENTIALS_FILE=./keys/service_account.json # global flag
    
    # instance specific flags
    CLOUD_SQL_PROXY_INSTANCE_1=hello:world:db1 # instance flag
    CLOUD_SQL_PROXY_INSTANCE_1_PORT=8080
    CLOUD_SQL_PROXY_INSTANCE_1_PRIVATE_IP=true #Boolean env var?
    
    CLOUD_SQL_PROXY_INSTANCE_2=hello:world:db2
    CLOUD_SQL_PROXY_INSTANCE_2_PORT=8081
    CLOUD_SQL_PROXY_INSTANCE_2_USE_IAM_AUTHN=true
    
    
  11. enocom commented on Sep 24, 2022

    @enocom
    Member

    I think we should make the list of instance connection names zero indexed and also define an INSTANCE_CONNECTION_NAME variable for the first instance, for the cases when someone is connecting to only a single instance:

    CLOUD_SQL_PROXY_INSTANCE_CONNECTION_NAME=proj:reg:myinst
    CLOUD_SQL_PROXY_INSTANCE_0=proj:reg:myinst
    CLOUD_SQL_PROXY_INSTANCE_1=proj:reg:myotherinst
    
  12. self-assigned this
    on Oct 3, 2022
  13. enocom commented on Oct 25, 2022

    @enocom
    Member

    Also, to configure individual instances, we'll continue to use query params:

    CLOUD_SQL_AUTO_IAM_AUTHN=true
    CLOUD_SQL_PROXY_INSTANCE_0=proj:reg:myinst?auto-iam-authn=false
    
  14. added 2 commits that reference this issue on Oct 26, 2022
    666d684
    1dada5b
  15. added a commit that references this issue on Nov 7, 2022
    007f267
  16. added a commit that references this issue on Nov 7, 2022
    2a9d9a2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

priority: p0Highest priority. Critical issue. P0 implies highest priority.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions