Search code examples
google-cloud-platformgoogle-kubernetes-enginekubernetes-helmcloud-sql-proxy

"/cloud_sql_proxy": no such file or directory: unknown


I want to move from cloud sql proxy version 1.11 to 2.6.0

I am using helm charts to deploy kubes in gcp

old helm yaml spec:

.....
    image: "{{ .Values.cloudSQL.repository }}:{{ .Values.cloudSQL.tag }}"
    imagePullPolicy: {{ .Values.cloudSQL.pullPolicy }}
    command: ["/cloud_sql_proxy", "-dir=/cloudsql", "-instances=$(GCP_PROJECT):$(GCP_REGION):$(CLOUD_SQL_DATABASE)=tcp:0.0.0.0:5432", "-credential_file=/credentials/credentials.json"]
.....

values -

cloudSQL:
  repository: b.gcr.io/cloudsql-docker/gce-proxy
  tag: 1.11

New changes -

cloudSQL:
  repository: gcr.io/cloud-sql-connectors/cloud-sql-proxy
  tag: 2.6.0
.... [remains same]
image: "{{ .Values.cloudSQL.repository }}:{{ .Values.cloudSQL.tag }}"
          imagePullPolicy: {{ .Values.cloudSQL.pullPolicy }}
          command: ["/cloud_sql_proxy", "--unix-socket /cloudsql", "--address 0.0.0.0", "--private-ip", "$(GCP_PROJECT):$(GCP_REGION):$(CLOUD_SQL_DATABASE)", "--credentials-file /credentials/credentials.json"]

.... [remains same]

I get the following error -

failed to create container task: failed to create shim task: OCI runtime create failed: runc create failed:unable to start container process: exec: "/cloud_sql_proxy": stat "/cloud_sql_proxy":  no such file or directory: unknown

[image pull policy is the same] Command was working fine with 1.11 and image is pulled for 2.6 but says cloud_sql_proxy not found with new version.

I followed the migration guide for these changes


Solution

  • The binary in the gcr.io/cloud-sql-connectors/cloud-sql-proxy image is named /cloud-sql-proxy with hyphens and not underscores, while the old image is using underscores.