1

I am running hyness/spring-cloud-config-server as a docker image as below, and it works fine.

docker run -it -p 8888:8888 \
    -v /etc/springboot_configs/application.yaml:/config/application.yaml \
      hyness/spring-cloud-config-server:3.0.5

Invoking the below command works and it fetches the values from the git as expected.

curl http://localhost:8888/spboot-sink/gcpnpr

Now, I am trying to run this container to run as a cloud run service, and the application.yaml is provided as a secret and expected to work as a volume in the cloud run.

Here is how, I am running the cloud run command:

gcloud run deploy spring-cloud-config-server \
--image=us-west1-docker.pkg.dev/gcp-demo-prj/testrepo/spring-cloud-config-server@sha256:xxxxxxx \
--vpc-connector=projects/gcp-demo-prj/locations/us-west1/connectors/serverless-connector \
--allow-unauthenticated \
--port=8888 \
--service-account=xxxx-compute@developer.gserviceaccount.com \
--memory=1Gi \
--min-instances=1 \
--max-instances=2 \
--set-secrets=/config/application.yaml=configserver:latest \
--region=us-west1 \
--project=gcp-demo-prj

However it does not work. The service is running fine, but I am not able to fetch the details from the git.

I tried to follow this article and GCP official document on how to mount volumes as secret in cloud run, however I was not successful.

Here is a snippet of error log:

Could not open file at path /config/application-default.yml. The path is in a mounted secrets volume, but the exact path does not correspond to any secret specified in the mount configuration.

Appreciate any help on this.

Chandan Patra
  • 491
  • 2
  • 9
  • 18

0 Answers0