Load balancer does not contain an instance for the service [kubernetes environment]

Viewed 121

I have few services deployed in EKS and some of them have issues to be reached.

I have this exception:

2022-06-01 11:27:39.383  WARN 1 --- [nio-8080-exec-3] o.s.c.l.core.RoundRobinLoadBalancer      : No servers available for service: backend-service
2022-06-01 11:27:39.383  WARN 1 --- [nio-8080-exec-3] .s.c.o.l.FeignBlockingLoadBalancerClient : Load balancer does not contain an instance for the service backend-service
2022-06-01 11:27:39.385 ERROR 1 --- [nio-8080-exec-3] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is feign.FeignException$ServiceUnavailable: [503] during [GET] to [http://backend-service/api/v1/provider?areas&services=103] [ServicesProxy#findProvidersByLocationAndService(Integer[],Integer[])]: [Load balancer does not contain an instance for the service backend-service]] with root cause

feign.FeignException$ServiceUnavailable: [503] during [GET] to [http://backend-service/api/v1/provider?areas&services=103] [ServicesProxy#findProvidersByLocationAndService(Integer[],Integer[])]: [Load balancer does not contain an instance for the service services-service]
        at feign.FeignException.serverErrorStatus(FeignException.java:237) ~[feign-core-10.12.jar:na]

caller application.yaml:

server:
  port: 8080
  shutdown: graceful
spring:
  config:
    activate:
      on-profile: prod
  lifecycle:
    timeout-per-shutdown-phase: 10s
feign:
  client:
    config:
      default:
        connectTimeout: 10000
        readTimeout: 50000

I also added both annotations to main class:

@EnableDiscoveryClient
@EnableFeignClients("com.wheels.search")

caller class:

@FeignClient(name="backend-service")
public interface ServicesProxy {...}

here is an extract of the pom:

<spring-cloud.version>2020.0.4</spring-cloud.version>
spring boot v <version>2.5.5</version>

<dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-openfeign</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-kubernetes-all</artifactId>
            <version>1.1.10.RELEASE</version>
        </dependency>
0 Answers
Related