Connect consul application with microservice in google cloud run
lacerdanycolas opened this issue · 0 comments
Category:
Kubernetes apps
Type:
- Bug
- Feature Request
- [ X ] Process
I implemented the consul application available in the google marketplace, and created a microservice with gcloud run that should register in consul. However, the microservice does not recognize the name of the consul service on the network. I have already connected to a shared VPC so that both can see each other, but it presents the error below.
Caused by: java.net.UnknownHostException: consul: Name or service not known
.
And my deployment code is as follows
gcloud run deploy bpms-gateway --image $CONTAINER_REGISTRY/$GCP_PROJECT_ID/$IMAGE_REPOSITORY/bpms-gateway:0.0.2 --platform managed --region $RUN_REGION --port 8080 --vpc-connector=vcp-p2f-connector --update-env-vars SPRING_CLOUD_CONSUL_HOST=consul --allow-unauthenticated
And a tried:
-
Replicate exactly what I did in my local environment (using docker-compose) by creating an environment variable SPRING_CLOUD_CONSUL_HOST passing the name of the service to it;
-
Pass in the variable the value consul-shared-consul-server (Consul HTTP API) but not solved;
Image with info from components application
Any ideias to solve this? Thanks.