I have a kubernetes job on GKE that uses cloudsql-proxy as a sidecar. I am using workloadIdentity for the connection:
I have the GSA and KSA setup, and cloudsql-proxy works for the deployment but does not work for the jobs in the same namespaces and using the same serviceaccounts.
I keep getting this error:
error checking scopes: *url.Error Get http://169.254.169.254/computeMetadata/v1/instance/service-accounts/default/scopes: net/http: timeout awaiting response headers | Get http://169.254.169.254/computeMetadata/v1/instance/service-accounts/default/scopes: net/http: timeout awaiting response headers
I am not sure what the issue is. I need help.
This is pod container template for cloudsql-proxy:
{{ if $global.Values.cloudsql.enabled }}
- name: cloudsql-proxy
image: gcr.io/cloudsql-docker/gce-proxy:1.15
command: [sh, -c]
args:
- |
/cloud_sql_proxy -instances={{ $global.Values.cloudsql.connection_string }}=tcp:{{ $global.Values.cloudsql.port }} -term_timeout=30s -log_debug_stdout=true &
CHILD_PID=$!
ls -al
(while true; do if [[ -f "/signals/finished" ]]; then kill $CHILD_PID; fi; sleep 1; done) &
wait $CHILD_PID
if [[ -f "/signals/finished" ]]; then exit 0; fi
volumeMounts:
- name: ssl-certs
mountPath: "/etc/ssl/certs"
- name: signals
mountPath: "/signals"
{{- end }}