spring-cloud / spring-cloud-kubernetes

Kubernetes integration with Spring Cloud Discovery Client, Configuration, etc...
Apache License 2.0
3.43k stars 1.03k forks source link

Cannot connect to remote service - SERVICE_UNAVAILABLE #1645

Closed rcbandit111 closed 2 months ago

rcbandit111 commented 2 months ago

I'm trying to make the following test setup: Spring cloud gateway to forward messages internally to internal microservice. I tried this gateway project:

https://github.com/rcbandit111/gateway

Internal microservice:

https://github.com/rcbandit111/mockup

Routes setup into gateway:

    server:
      port: 8888
      servlet:
        context-path: /api
    spring:
      application:
        name: gateway
      cloud:
        gateway:
          routes:
            - id: mockup
              uri: lb://mockup
              predicates:
                - Path=/api/mockup/admin/**
              filters:
                - RemoveRequestHeader=Cookie
                - name: CircuitBreaker
                  args:
                    name: mockup
                - RewritePath=/api/mockup/admin/(?<path>.*), /mockup/admin/$\{path}

          httpclient:
            wiretap: true
          httpserver:
            wiretap: true

    logging:
      level:
        reactor:
          netty: DEBUG
        org:
          springframework:
            cloud:
              gateway: TRACE

Postman configuration for the call:

`curl --location --request POST 'localhost:8888/api/mockup/admin/greeting'

Log files from Gateway:

root@node1:~# kubectl logs gateway-57b7c558bc-ncthg

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v3.2.4)

2024-04-23T16:35:05.883Z  INFO 1 --- [gateway] [           main] org.gateway.Application                  : The following 1 profile is active: "kubernetes"
2024-04-23T16:35:32.887Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.conditional.OnEnabledFilter    : Condition OnEnabledFilter on org.springframework.cloud.gateway.config.GatewayAutoConfiguration$TokenRelayConfiguration matched
2024-04-23T16:35:33.190Z TRACE 1 --- [gateway] [           main] Configuration$OnVerboseDisabledCondition : Condition GatewayAutoConfiguration.OnVerboseDisabledCondition on org.springframework.cloud.gateway.config.GatewayAutoConfiguration$GatewayActuatorConfiguration#gatewayLegacyControllerEndpoint did not match due to NoneNestedConditions 1 matched 0 did not; NestedCondition on GatewayAutoConfiguration.OnVerboseDisabledCondition.VerboseDisabled @ConditionalOnProperty (spring.cloud.gateway.actuator.verbose.enabled) matched
2024-04-23T16:35:33.886Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.c.OnEnabledGlobalFilter        : Condition OnEnabledGlobalFilter on org.springframework.cloud.gateway.config.GatewayAutoConfiguration$NettyConfiguration#routingFilter matched
2024-04-23T16:35:33.888Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.c.OnEnabledGlobalFilter        : Condition OnEnabledGlobalFilter on org.springframework.cloud.gateway.config.GatewayAutoConfiguration$NettyConfiguration#nettyWriteResponseFilter matched
2024-04-23T16:35:33.985Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.c.OnEnabledGlobalFilter        : Condition OnEnabledGlobalFilter on org.springframework.cloud.gateway.config.GatewayAutoConfiguration$NettyConfiguration#reactorNettyWebSocketClient matched
2024-04-23T16:35:33.987Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.c.OnEnabledGlobalFilter        : Condition OnEnabledGlobalFilter on org.springframework.cloud.gateway.config.GatewayAutoConfiguration$NettyConfiguration#reactorNettyRequestUpgradeStrategy matched
2024-04-23T16:35:35.591Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.c.OnEnabledGlobalFilter        : Condition OnEnabledGlobalFilter on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#adaptCachedBodyGlobalFilter matched
2024-04-23T16:35:35.594Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.c.OnEnabledGlobalFilter        : Condition OnEnabledGlobalFilter on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#removeCachedBodyFilter matched
2024-04-23T16:35:35.684Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.c.OnEnabledGlobalFilter        : Condition OnEnabledGlobalFilter on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#routeToRequestUrlFilter matched
2024-04-23T16:35:35.686Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.c.OnEnabledGlobalFilter        : Condition OnEnabledGlobalFilter on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#forwardRoutingFilter matched
2024-04-23T16:35:35.689Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.c.OnEnabledGlobalFilter        : Condition OnEnabledGlobalFilter on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#forwardPathFilter matched
2024-04-23T16:35:35.783Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.c.OnEnabledGlobalFilter        : Condition OnEnabledGlobalFilter on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#webSocketService matched
2024-04-23T16:35:35.784Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.c.OnEnabledGlobalFilter        : Condition OnEnabledGlobalFilter on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#websocketRoutingFilter matched
2024-04-23T16:35:35.785Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.c.OnEnabledPredicate           : Condition OnEnabledPredicate on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#weightCalculatorWebFilter matched
2024-04-23T16:35:35.786Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.c.OnEnabledPredicate           : Condition OnEnabledPredicate on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#afterRoutePredicateFactory matched
2024-04-23T16:35:35.787Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.c.OnEnabledPredicate           : Condition OnEnabledPredicate on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#beforeRoutePredicateFactory matched
2024-04-23T16:35:35.788Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.c.OnEnabledPredicate           : Condition OnEnabledPredicate on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#betweenRoutePredicateFactory matched
2024-04-23T16:35:35.788Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.c.OnEnabledPredicate           : Condition OnEnabledPredicate on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#cookieRoutePredicateFactory matched
2024-04-23T16:35:35.791Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.c.OnEnabledPredicate           : Condition OnEnabledPredicate on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#headerRoutePredicateFactory matched
2024-04-23T16:35:35.883Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.c.OnEnabledPredicate           : Condition OnEnabledPredicate on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#hostRoutePredicateFactory matched
2024-04-23T16:35:35.885Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.c.OnEnabledPredicate           : Condition OnEnabledPredicate on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#methodRoutePredicateFactory matched
2024-04-23T16:35:35.886Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.c.OnEnabledPredicate           : Condition OnEnabledPredicate on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#pathRoutePredicateFactory matched
2024-04-23T16:35:35.887Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.c.OnEnabledPredicate           : Condition OnEnabledPredicate on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#queryRoutePredicateFactory matched
2024-04-23T16:35:35.889Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.c.OnEnabledPredicate           : Condition OnEnabledPredicate on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#readBodyPredicateFactory matched
2024-04-23T16:35:35.890Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.c.OnEnabledPredicate           : Condition OnEnabledPredicate on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#remoteAddrRoutePredicateFactory matched
2024-04-23T16:35:35.890Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.c.OnEnabledPredicate           : Condition OnEnabledPredicate on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#xForwardedRemoteAddrRoutePredicateFactory matched
2024-04-23T16:35:35.984Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.c.OnEnabledPredicate           : Condition OnEnabledPredicate on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#weightRoutePredicateFactory matched
2024-04-23T16:35:35.984Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.c.OnEnabledPredicate           : Condition OnEnabledPredicate on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#cloudFoundryRouteServiceRoutePredicateFactory matched
2024-04-23T16:35:35.985Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.conditional.OnEnabledFilter    : Condition OnEnabledFilter on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#addRequestHeaderGatewayFilterFactory matched
2024-04-23T16:35:35.986Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.conditional.OnEnabledFilter    : Condition OnEnabledFilter on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#addRequestHeadersIfNotPresentGatewayFilterFactory matched
2024-04-23T16:35:36.183Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.conditional.OnEnabledFilter    : Condition OnEnabledFilter on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#mapRequestHeaderGatewayFilterFactory matched
2024-04-23T16:35:36.188Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.conditional.OnEnabledFilter    : Condition OnEnabledFilter on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#addRequestParameterGatewayFilterFactory matched
2024-04-23T16:35:36.191Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.conditional.OnEnabledFilter    : Condition OnEnabledFilter on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#addResponseHeaderGatewayFilterFactory matched
2024-04-23T16:35:36.193Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.conditional.OnEnabledFilter    : Condition OnEnabledFilter on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#modifyRequestBodyGatewayFilterFactory matched
2024-04-23T16:35:36.283Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.conditional.OnEnabledFilter    : Condition OnEnabledFilter on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#dedupeResponseHeaderGatewayFilterFactory matched
2024-04-23T16:35:36.284Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.conditional.OnEnabledFilter    : Condition OnEnabledFilter on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#modifyResponseBodyGatewayFilterFactory matched
2024-04-23T16:35:36.284Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.conditional.OnEnabledFilter    : Condition OnEnabledFilter on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#cacheRequestBodyGatewayFilterFactory matched
2024-04-23T16:35:36.285Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.conditional.OnEnabledFilter    : Condition OnEnabledFilter on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#prefixPathGatewayFilterFactory matched
2024-04-23T16:35:36.286Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.conditional.OnEnabledFilter    : Condition OnEnabledFilter on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#preserveHostHeaderGatewayFilterFactory matched
2024-04-23T16:35:36.288Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.conditional.OnEnabledFilter    : Condition OnEnabledFilter on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#redirectToGatewayFilterFactory matched
2024-04-23T16:35:36.289Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.conditional.OnEnabledFilter    : Condition OnEnabledFilter on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#removeJsonAttributesResponseBodyGatewayFilterFactory matched
2024-04-23T16:35:36.290Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.conditional.OnEnabledFilter    : Condition OnEnabledFilter on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#removeRequestHeaderGatewayFilterFactory matched
2024-04-23T16:35:36.383Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.conditional.OnEnabledFilter    : Condition OnEnabledFilter on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#removeRequestParameterGatewayFilterFactory matched
2024-04-23T16:35:36.387Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.conditional.OnEnabledFilter    : Condition OnEnabledFilter on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#removeResponseHeaderGatewayFilterFactory matched
2024-04-23T16:35:36.885Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.conditional.OnEnabledFilter    : Condition OnEnabledFilter on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#rewritePathGatewayFilterFactory matched
2024-04-23T16:35:36.887Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.conditional.OnEnabledFilter    : Condition OnEnabledFilter on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#retryGatewayFilterFactory matched
2024-04-23T16:35:36.888Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.conditional.OnEnabledFilter    : Condition OnEnabledFilter on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#setPathGatewayFilterFactory matched
2024-04-23T16:35:36.889Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.conditional.OnEnabledFilter    : Condition OnEnabledFilter on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#secureHeadersGatewayFilterFactory matched
2024-04-23T16:35:36.889Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.conditional.OnEnabledFilter    : Condition OnEnabledFilter on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#setRequestHeaderGatewayFilterFactory matched
2024-04-23T16:35:36.890Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.conditional.OnEnabledFilter    : Condition OnEnabledFilter on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#setRequestHostHeaderGatewayFilterFactory matched
2024-04-23T16:35:36.984Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.conditional.OnEnabledFilter    : Condition OnEnabledFilter on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#setResponseHeaderGatewayFilterFactory matched
2024-04-23T16:35:36.987Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.conditional.OnEnabledFilter    : Condition OnEnabledFilter on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#rewriteResponseHeaderGatewayFilterFactory matched
2024-04-23T16:35:36.988Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.conditional.OnEnabledFilter    : Condition OnEnabledFilter on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#rewriteLocationResponseHeaderGatewayFilterFactory matched
2024-04-23T16:35:36.989Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.conditional.OnEnabledFilter    : Condition OnEnabledFilter on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#setStatusGatewayFilterFactory matched
2024-04-23T16:35:37.083Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.conditional.OnEnabledFilter    : Condition OnEnabledFilter on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#saveSessionGatewayFilterFactory matched
2024-04-23T16:35:37.085Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.conditional.OnEnabledFilter    : Condition OnEnabledFilter on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#stripPrefixGatewayFilterFactory matched
2024-04-23T16:35:37.086Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.conditional.OnEnabledFilter    : Condition OnEnabledFilter on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#requestHeaderToRequestUriGatewayFilterFactory matched
2024-04-23T16:35:37.088Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.conditional.OnEnabledFilter    : Condition OnEnabledFilter on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#requestSizeGatewayFilterFactory matched
2024-04-23T16:35:37.089Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.conditional.OnEnabledFilter    : Condition OnEnabledFilter on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#requestHeaderSizeGatewayFilterFactory matched
2024-04-23T16:35:37.089Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.conditional.OnEnabledFilter    : Condition OnEnabledFilter on org.springframework.cloud.gateway.config.GatewayAutoConfiguration#rewriteRequestParameterGatewayFilterFactory matched
2024-04-23T16:35:55.090Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.conditional.OnEnabledFilter    : Condition OnEnabledFilter on org.springframework.cloud.gateway.config.GatewayReactiveOAuth2AutoConfiguration matched
2024-04-23T16:35:55.285Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.conditional.OnEnabledFilter    : Condition OnEnabledFilter on org.springframework.cloud.gateway.config.GatewayResilience4JCircuitBreakerAutoConfiguration#springCloudCircuitBreakerResilience4JFilterFactory matched
2024-04-23T16:35:55.291Z TRACE 1 --- [gateway] [           main] o.s.c.g.c.conditional.OnEnabledFilter    : Condition OnEnabledFilter on org.springframework.cloud.gateway.config.GatewayResilience4JCircuitBreakerAutoConfiguration#fallbackHeadersGatewayFilterFactory matched
2024-04-23T16:36:08.384Z  INFO 1 --- [gateway] [           main] o.s.cloud.context.scope.GenericScope     : BeanFactory id=779ee9dc-c045-333c-94bc-9def797e8ba3
2024-04-23T16:36:54.289Z  INFO 1 --- [gateway] [           main] o.s.c.k.client.KubernetesClientUtils     : Created API client in the cluster.
2024-04-23T16:36:57.992Z  INFO 1 --- [gateway] [oller-V1Service] i.k.client.informer.cache.Controller     : informer#Controller: ready to run resync & reflector runnable
2024-04-23T16:36:57.993Z  INFO 1 --- [gateway] [oller-V1Service] i.k.client.informer.cache.Controller     : informer#Controller: resync skipped due to 0 full resync period
2024-04-23T16:36:57.993Z  INFO 1 --- [gateway] [ler-V1Endpoints] i.k.client.informer.cache.Controller     : informer#Controller: ready to run resync & reflector runnable
2024-04-23T16:36:57.995Z  INFO 1 --- [gateway] [ler-V1Endpoints] i.k.client.informer.cache.Controller     : informer#Controller: resync skipped due to 0 full resync period
2024-04-23T16:36:58.183Z  INFO 1 --- [gateway] [s.V1Endpoints-1] i.k.c.informer.cache.ReflectorRunnable   : class io.kubernetes.client.openapi.models.V1Endpoints#Start listing and watching...
2024-04-23T16:36:58.190Z  INFO 1 --- [gateway] [els.V1Service-1] i.k.c.informer.cache.ReflectorRunnable   : class io.kubernetes.client.openapi.models.V1Service#Start listing and watching...
2024-04-23T16:36:59.086Z  INFO 1 --- [gateway] [pool-8-thread-1] s.c.k.c.d.KubernetesDiscoveryClientUtils : Waiting for the cache of informers to be fully loaded..
2024-04-23T16:37:00.183Z  INFO 1 --- [gateway] [pool-8-thread-1] s.c.k.c.d.KubernetesDiscoveryClientUtils : Waiting for the cache of informers to be fully loaded..
2024-04-23T16:37:00.994Z  INFO 1 --- [gateway] [pool-8-thread-1] s.c.k.c.d.KubernetesDiscoveryClientUtils : Waiting for the cache of informers to be fully loaded..
2024-04-23T16:37:01.994Z  INFO 1 --- [gateway] [pool-8-thread-1] s.c.k.c.d.KubernetesDiscoveryClientUtils : Waiting for the cache of informers to be fully loaded..
2024-04-23T16:37:03.282Z  INFO 1 --- [gateway] [pool-8-thread-1] s.c.k.c.d.KubernetesDiscoveryClientUtils : Waiting for the cache of informers to be fully loaded..
2024-04-23T16:37:04.083Z  INFO 1 --- [gateway] [pool-8-thread-1] s.c.k.c.d.KubernetesDiscoveryClientUtils : Waiting for the cache of informers to be fully loaded..
2024-04-23T16:37:04.996Z  INFO 1 --- [gateway] [pool-8-thread-1] s.c.k.c.d.KubernetesDiscoveryClientUtils : Waiting for the cache of informers to be fully loaded..
2024-04-23T16:37:06.083Z  INFO 1 --- [gateway] [pool-8-thread-1] s.c.k.c.d.KubernetesDiscoveryClientUtils : Waiting for the cache of informers to be fully loaded..
2024-04-23T16:37:06.994Z  INFO 1 --- [gateway] [pool-8-thread-1] s.c.k.c.d.KubernetesDiscoveryClientUtils : Waiting for the cache of informers to be fully loaded..
2024-04-23T16:37:07.994Z  INFO 1 --- [gateway] [pool-8-thread-1] s.c.k.c.d.KubernetesDiscoveryClientUtils : Waiting for the cache of informers to be fully loaded..
2024-04-23T16:37:09.089Z  INFO 1 --- [gateway] [pool-8-thread-1] s.c.k.c.d.KubernetesDiscoveryClientUtils : Waiting for the cache of informers to be fully loaded..
2024-04-23T16:37:10.083Z  INFO 1 --- [gateway] [pool-8-thread-1] s.c.k.c.d.KubernetesDiscoveryClientUtils : Waiting for the cache of informers to be fully loaded..
2024-04-23T16:37:11.083Z  INFO 1 --- [gateway] [pool-8-thread-1] s.c.k.c.d.KubernetesDiscoveryClientUtils : Waiting for the cache of informers to be fully loaded..
2024-04-23T16:37:12.086Z  INFO 1 --- [gateway] [pool-8-thread-1] s.c.k.c.d.KubernetesDiscoveryClientUtils : Waiting for the cache of informers to be fully loaded..
2024-04-23T16:37:13.087Z  INFO 1 --- [gateway] [pool-8-thread-1] s.c.k.c.d.KubernetesDiscoveryClientUtils : Waiting for the cache of informers to be fully loaded..
2024-04-23T16:37:13.997Z  INFO 1 --- [gateway] [pool-8-thread-1] s.c.k.c.d.KubernetesDiscoveryClientUtils : Waiting for the cache of informers to be fully loaded..
2024-04-23T16:37:15.083Z  INFO 1 --- [gateway] [pool-8-thread-1] s.c.k.c.d.KubernetesDiscoveryClientUtils : Waiting for the cache of informers to be fully loaded..
2024-04-23T16:37:16.087Z  INFO 1 --- [gateway] [pool-8-thread-1] s.c.k.c.d.KubernetesDiscoveryClientUtils : Waiting for the cache of informers to be fully loaded..
2024-04-23T16:37:16.994Z  INFO 1 --- [gateway] [pool-8-thread-1] s.c.k.c.d.KubernetesDiscoveryClientUtils : Waiting for the cache of informers to be fully loaded..
2024-04-23T16:37:17.089Z  INFO 1 --- [gateway] [           main] s.c.k.c.d.KubernetesDiscoveryClientUtils : Cache fully loaded (total 6 services), discovery client is now available
2024-04-23T16:37:27.694Z DEBUG 1 --- [gateway] [           main] o.s.c.gateway.config.GatewayProperties   : Routes supplied from Gateway Properties: [RouteDefinition{id='mockup', predicates=[PredicateDefinition{name='Path', args={_genkey_0=/api/mockup/admin/**}}], filters=[FilterDefinition{name='RemoveRequestHeader', args={_genkey_0=Cookie}}, FilterDefinition{name='CircuitBreaker', args={name=mockup}}, FilterDefinition{name='RewritePath', args={_genkey_0=/api/mockup/admin/(?<path>.*), _genkey_1=/mockup/admin/$\{path}}}], uri=lb://mockup, order=0, metadata={}}]
2024-04-23T16:37:33.083Z  INFO 1 --- [gateway] [           main] o.s.c.g.r.RouteDefinitionRouteLocator    : Loaded RoutePredicateFactory [After]
2024-04-23T16:37:33.084Z  INFO 1 --- [gateway] [           main] o.s.c.g.r.RouteDefinitionRouteLocator    : Loaded RoutePredicateFactory [Before]
2024-04-23T16:37:33.084Z  INFO 1 --- [gateway] [           main] o.s.c.g.r.RouteDefinitionRouteLocator    : Loaded RoutePredicateFactory [Between]
2024-04-23T16:37:33.084Z  INFO 1 --- [gateway] [           main] o.s.c.g.r.RouteDefinitionRouteLocator    : Loaded RoutePredicateFactory [Cookie]
2024-04-23T16:37:33.084Z  INFO 1 --- [gateway] [           main] o.s.c.g.r.RouteDefinitionRouteLocator    : Loaded RoutePredicateFactory [Header]
2024-04-23T16:37:33.084Z  INFO 1 --- [gateway] [           main] o.s.c.g.r.RouteDefinitionRouteLocator    : Loaded RoutePredicateFactory [Host]
2024-04-23T16:37:33.084Z  INFO 1 --- [gateway] [           main] o.s.c.g.r.RouteDefinitionRouteLocator    : Loaded RoutePredicateFactory [Method]
2024-04-23T16:37:33.084Z  INFO 1 --- [gateway] [           main] o.s.c.g.r.RouteDefinitionRouteLocator    : Loaded RoutePredicateFactory [Path]
2024-04-23T16:37:33.085Z  INFO 1 --- [gateway] [           main] o.s.c.g.r.RouteDefinitionRouteLocator    : Loaded RoutePredicateFactory [Query]
2024-04-23T16:37:33.182Z  INFO 1 --- [gateway] [           main] o.s.c.g.r.RouteDefinitionRouteLocator    : Loaded RoutePredicateFactory [ReadBody]
2024-04-23T16:37:33.183Z  INFO 1 --- [gateway] [           main] o.s.c.g.r.RouteDefinitionRouteLocator    : Loaded RoutePredicateFactory [RemoteAddr]
2024-04-23T16:37:33.183Z  INFO 1 --- [gateway] [           main] o.s.c.g.r.RouteDefinitionRouteLocator    : Loaded RoutePredicateFactory [XForwardedRemoteAddr]
2024-04-23T16:37:33.183Z  INFO 1 --- [gateway] [           main] o.s.c.g.r.RouteDefinitionRouteLocator    : Loaded RoutePredicateFactory [Weight]
2024-04-23T16:37:33.183Z  INFO 1 --- [gateway] [           main] o.s.c.g.r.RouteDefinitionRouteLocator    : Loaded RoutePredicateFactory [CloudFoundryRouteService]
2024-04-23T16:37:41.589Z  INFO 1 --- [gateway] [           main] o.s.b.a.e.web.EndpointLinksResolver      : Exposing 1 endpoint(s) beneath base path '/actuator'
2024-04-23T16:37:57.786Z DEBUG 1 --- [gateway] [           main] o.s.c.g.r.RouteDefinitionRouteLocator    : RouteDefinition mockup applying {_genkey_0=/api/mockup/admin/**} to Path
2024-04-23T16:37:59.286Z DEBUG 1 --- [gateway] [           main] o.s.c.g.r.RouteDefinitionRouteLocator    : RouteDefinition mockup applying filter {_genkey_0=Cookie} to RemoveRequestHeader
2024-04-23T16:37:59.789Z DEBUG 1 --- [gateway] [           main] o.s.c.g.r.RouteDefinitionRouteLocator    : RouteDefinition mockup applying filter {name=mockup} to CircuitBreaker
2024-04-23T16:37:59.993Z DEBUG 1 --- [gateway] [           main] o.s.c.g.r.RouteDefinitionRouteLocator    : RouteDefinition mockup applying filter {_genkey_0=/api/mockup/admin/(?<path>.*), _genkey_1=/mockup/admin/$\{path}} to RewritePath
2024-04-23T16:38:00.287Z DEBUG 1 --- [gateway] [           main] o.s.c.g.r.RouteDefinitionRouteLocator    : RouteDefinition matched: mockup
2024-04-23T16:38:00.693Z DEBUG 1 --- [gateway] [           main] o.s.c.g.filter.GatewayMetricsFilter      : New routes count: 1
2024-04-23T16:38:00.885Z DEBUG 1 --- [gateway] [           main] o.s.c.g.r.RouteDefinitionRouteLocator    : RouteDefinition mockup applying {_genkey_0=/api/mockup/admin/**} to Path
2024-04-23T16:38:00.984Z DEBUG 1 --- [gateway] [           main] o.s.c.g.r.RouteDefinitionRouteLocator    : RouteDefinition mockup applying filter {_genkey_0=Cookie} to RemoveRequestHeader
2024-04-23T16:38:00.986Z DEBUG 1 --- [gateway] [           main] o.s.c.g.r.RouteDefinitionRouteLocator    : RouteDefinition mockup applying filter {name=mockup} to CircuitBreaker
2024-04-23T16:38:01.084Z DEBUG 1 --- [gateway] [           main] o.s.c.g.r.RouteDefinitionRouteLocator    : RouteDefinition mockup applying filter {_genkey_0=/api/mockup/admin/(?<path>.*), _genkey_1=/mockup/admin/$\{path}} to RewritePath
2024-04-23T16:38:01.087Z DEBUG 1 --- [gateway] [           main] o.s.c.g.r.RouteDefinitionRouteLocator    : RouteDefinition matched: mockup
2024-04-23T16:38:01.183Z DEBUG 1 --- [gateway] [           main] o.s.c.g.filter.GatewayMetricsFilter      : New routes count: 1
2024-04-23T16:38:10.891Z  INFO 1 --- [gateway] [           main] o.s.b.web.embedded.netty.NettyWebServer  : Netty started on port 8888
2024-04-23T16:38:11.684Z DEBUG 1 --- [gateway] [           main] o.s.c.g.r.RouteDefinitionRouteLocator    : RouteDefinition mockup applying {_genkey_0=/api/mockup/admin/**} to Path
2024-04-23T16:38:11.784Z DEBUG 1 --- [gateway] [           main] o.s.c.g.r.RouteDefinitionRouteLocator    : RouteDefinition mockup applying filter {_genkey_0=Cookie} to RemoveRequestHeader
2024-04-23T16:38:11.790Z DEBUG 1 --- [gateway] [           main] o.s.c.g.r.RouteDefinitionRouteLocator    : RouteDefinition mockup applying filter {name=mockup} to CircuitBreaker
2024-04-23T16:38:11.793Z DEBUG 1 --- [gateway] [           main] o.s.c.g.r.RouteDefinitionRouteLocator    : RouteDefinition mockup applying filter {_genkey_0=/api/mockup/admin/(?<path>.*), _genkey_1=/mockup/admin/$\{path}} to RewritePath
2024-04-23T16:38:11.884Z DEBUG 1 --- [gateway] [           main] o.s.c.g.r.RouteDefinitionRouteLocator    : RouteDefinition matched: mockup
2024-04-23T16:38:11.886Z DEBUG 1 --- [gateway] [           main] o.s.c.g.filter.GatewayMetricsFilter      : New routes count: 1
2024-04-23T16:38:11.984Z  INFO 1 --- [gateway] [           main] org.gateway.Application                  : Started Application in 238.21 seconds (process running for 264.79)
2024-04-23T16:38:24.883Z TRACE 1 --- [gateway] [     parallel-1] o.s.c.g.f.WeightCalculatorWebFilter      : Weights attr: {}
2024-04-23T16:38:24.994Z TRACE 1 --- [gateway] [     parallel-1] o.s.c.g.h.p.PathRoutePredicateFactory    : Pattern "/api/mockup/admin/**" matches against value "/api/mockup/admin/greeting"
2024-04-23T16:38:25.082Z DEBUG 1 --- [gateway] [     parallel-1] o.s.c.g.h.RoutePredicateHandlerMapping   : Route matched: mockup
2024-04-23T16:38:25.184Z DEBUG 1 --- [gateway] [     parallel-1] o.s.c.g.h.RoutePredicateHandlerMapping   : Mapping [Exchange: POST http://11.1.1.1.:30055/api/mockup/admin/greeting] to Route{id='mockup', uri=lb://mockup, order=0, predicate=Paths: [/api/mockup/admin/**], match trailing slash: true, gatewayFilters=[[[RemoveRequestHeader name = 'Cookie'], order = 1], [[SpringCloudCircuitBreakerResilience4JFilterFactory name = 'mockup', fallback = [null]], order = 2], [[RewritePath /api/mockup/admin/(?<path>.*) = '/mockup/admin/${path}'], order = 3]], metadata={}}
2024-04-23T16:38:25.185Z DEBUG 1 --- [gateway] [     parallel-1] o.s.c.g.h.RoutePredicateHandlerMapping   : [7cc8013d-1] Mapped to org.springframework.cloud.gateway.handler.FilteringWebHandler@6368358
2024-04-23T16:38:25.186Z DEBUG 1 --- [gateway] [     parallel-1] o.s.c.g.handler.FilteringWebHandler      : Sorted gatewayFilterFactories: [[GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.RemoveCachedBodyFilter@2b464384}, order = -2147483648], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.AdaptCachedBodyGlobalFilter@701c482e}, order = -2147482648], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.NettyWriteResponseFilter@43cf5bff}, order = -1], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.ForwardPathFilter@4ede8888}, order = 0], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.GatewayMetricsFilter@65a2755e}, order = 0], [[RemoveRequestHeader name = 'Cookie'], order = 1], [[SpringCloudCircuitBreakerResilience4JFilterFactory name = 'mockup', fallback = [null]], order = 2], [[RewritePath /api/mockup/admin/(?<path>.*) = '/mockup/admin/${path}'], order = 3], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.RouteToRequestUrlFilter@681b42d3}, order = 10000], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.config.GatewayNoLoadBalancerClientAutoConfiguration$NoLoadBalancerClientFilter@2b3242a5}, order = 10150], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.WebsocketRoutingFilter@571db8b4}, order = 2147483646], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.NettyRoutingFilter@5f781173}, order = 2147483647], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.ForwardRoutingFilter@77f7352a}, order = 2147483647]]
2024-04-23T16:38:25.987Z TRACE 1 --- [gateway] [     parallel-1] o.s.c.g.filter.RouteToRequestUrlFilter   : RouteToRequestUrlFilter start
2024-04-23T16:38:28.491Z TRACE 1 --- [gateway] [     parallel-1] o.s.c.g.filter.GatewayMetricsFilter      : spring.cloud.gateway.requests tags: [tag(httpMethod=POST),tag(httpStatusCode=503),tag(outcome=SERVER_ERROR),tag(routeId=mockup),tag(routeUri=lb://mockup),tag(status=SERVICE_UNAVAILABLE)]
2024-04-23T16:39:26.926Z TRACE 1 --- [gateway] [     parallel-1] o.s.c.g.f.WeightCalculatorWebFilter      : Weights attr: {}
2024-04-23T16:39:26.984Z TRACE 1 --- [gateway] [     parallel-1] o.s.c.g.h.p.PathRoutePredicateFactory    : Pattern "/api/mockup/admin/**" matches against value "/api/mockup/admin/greeting"
2024-04-23T16:39:26.985Z DEBUG 1 --- [gateway] [     parallel-1] o.s.c.g.h.RoutePredicateHandlerMapping   : Route matched: mockup
2024-04-23T16:39:26.985Z DEBUG 1 --- [gateway] [     parallel-1] o.s.c.g.h.RoutePredicateHandlerMapping   : Mapping [Exchange: POST http://1.1.1.1.1:30055/api/mockup/admin/greeting] to Route{id='mockup', uri=lb://mockup, order=0, predicate=Paths: [/api/mockup/admin/**], match trailing slash: true, gatewayFilters=[[[RemoveRequestHeader name = 'Cookie'], order = 1], [[SpringCloudCircuitBreakerResilience4JFilterFactory name = 'mockup', fallback = [null]], order = 2], [[RewritePath /api/mockup/admin/(?<path>.*) = '/mockup/admin/${path}'], order = 3]], metadata={}}
2024-04-23T16:39:26.985Z DEBUG 1 --- [gateway] [     parallel-1] o.s.c.g.h.RoutePredicateHandlerMapping   : [7cc8013d-2] Mapped to org.springframework.cloud.gateway.handler.FilteringWebHandler@6368358
2024-04-23T16:39:26.986Z DEBUG 1 --- [gateway] [     parallel-1] o.s.c.g.handler.FilteringWebHandler      : Sorted gatewayFilterFactories: [[GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.RemoveCachedBodyFilter@2b464384}, order = -2147483648], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.AdaptCachedBodyGlobalFilter@701c482e}, order = -2147482648], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.NettyWriteResponseFilter@43cf5bff}, order = -1], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.ForwardPathFilter@4ede8888}, order = 0], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.GatewayMetricsFilter@65a2755e}, order = 0], [[RemoveRequestHeader name = 'Cookie'], order = 1], [[SpringCloudCircuitBreakerResilience4JFilterFactory name = 'mockup', fallback = [null]], order = 2], [[RewritePath /api/mockup/admin/(?<path>.*) = '/mockup/admin/${path}'], order = 3], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.RouteToRequestUrlFilter@681b42d3}, order = 10000], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.config.GatewayNoLoadBalancerClientAutoConfiguration$NoLoadBalancerClientFilter@2b3242a5}, order = 10150], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.WebsocketRoutingFilter@571db8b4}, order = 2147483646], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.NettyRoutingFilter@5f781173}, order = 2147483647], [GatewayFilterAdapter{delegate=org.springframework.cloud.gateway.filter.ForwardRoutingFilter@77f7352a}, order = 2147483647]]
2024-04-23T16:39:26.988Z TRACE 1 --- [gateway] [     parallel-1] o.s.c.g.filter.RouteToRequestUrlFilter   : RouteToRequestUrlFilter start
2024-04-23T16:39:27.091Z TRACE 1 --- [gateway] [     parallel-1] o.s.c.g.filter.GatewayMetricsFilter      : spring.cloud.gateway.requests tags: [tag(httpMethod=POST),tag(httpStatusCode=503),tag(outcome=SERVER_ERROR),tag(routeId=mockup),tag(routeUri=lb://mockup),tag(status=SERVICE_UNAVAILABLE)]

Microservice logs:

root@node1:~# kubectl logs mockup-6c5cfb4677-gjtxq
Standard Commons Logging discovery in action with spring-jcl: please remove commons-logging.jar from classpath in order to avoid potential conflicts

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v3.2.4)

2024-04-23T16:24:27.754Z  INFO 1 --- [mockup-test] [           main] com.mockup.mockup.MockupApplication      : The following 1 profile is active: "kubernetes"
2024-04-23T16:25:11.355Z  INFO 1 --- [mockup-test] [           main] o.s.cloud.context.scope.GenericScope     : BeanFactory id=9caa440b-0f6a-3d84-8563-fc56c1328493
2024-04-23T16:25:23.048Z  WARN 1 --- [mockup-test] [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.client.loadbalancer.LoadBalancerAutoConfiguration$DeferringLoadBalancerInterceptorConfig' of type [org.springframework.cloud.client.loadbalancer.LoadBalancerAutoConfiguration$DeferringLoadBalancerInterceptorConfig] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). The currently created BeanPostProcessor [lbRestClientPostProcessor] is declared through a non-static factory method on that class; consider declaring it as static instead.
2024-04-23T16:25:23.247Z  WARN 1 --- [mockup-test] [           main] trationDelegate$BeanPostProcessorChecker : Bean 'deferringLoadBalancerInterceptor' of type [org.springframework.cloud.client.loadbalancer.DeferringLoadBalancerInterceptor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [lbRestClientPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
2024-04-23T16:25:35.151Z  INFO 1 --- [mockup-test] [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port 8761 (http)
2024-04-23T16:25:35.650Z  INFO 1 --- [mockup-test] [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2024-04-23T16:25:35.651Z  INFO 1 --- [mockup-test] [           main] o.apache.catalina.core.StandardEngine    : Starting Servlet engine: [Apache Tomcat/10.1.19]
2024-04-23T16:25:39.254Z  INFO 1 --- [mockup-test] [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2024-04-23T16:25:39.347Z  INFO 1 --- [mockup-test] [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 69803 ms
Standard Commons Logging discovery in action with spring-jcl: please remove commons-logging.jar from classpath in order to avoid potential conflicts
2024-04-23T16:26:26.363Z  INFO 1 --- [mockup-test] [           main] o.s.c.k.client.KubernetesClientUtils     : Created API client in the cluster.
2024-04-23T16:26:38.752Z  WARN 1 --- [mockup-test] [           main] .s.s.UserDetailsServiceAutoConfiguration :

Using generated security password: 8507cd38-99c5-44e8-b74b-c2dcfe32a35b

This generated password is for development use only. Your security configuration must be updated before running your application in production.

2024-04-23T16:26:42.851Z  INFO 1 --- [mockup-test] [           main] o.s.b.a.e.web.EndpointLinksResolver      : Exposing 1 endpoint(s) beneath base path '/actuator'
2024-04-23T16:26:44.250Z  INFO 1 --- [mockup-test] [           main] o.s.s.web.DefaultSecurityFilterChain     : Will secure any request with [org.springframework.security.web.session.DisableEncodeUrlFilter@31cddb11, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@510bd87a, org.springframework.security.web.context.SecurityContextHolderFilter@38c1b1a7, org.springframework.security.web.header.HeaderWriterFilter@5b643d6e, org.springframework.web.filter.CorsFilter@3d213a2b, org.springframework.security.web.csrf.CsrfFilter@16c1d11, org.springframework.security.web.authentication.logout.LogoutFilter@18301763, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@5ef7ae2f, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter@2bc0603f, org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter@27691ee8, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@b791e6e, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@125a8ab6, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@31f9f9b3, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@78a34c47, org.springframework.security.web.access.ExceptionTranslationFilter@34001c5d, org.springframework.security.web.access.intercept.AuthorizationFilter@15fd3088]
2024-04-23T16:26:55.549Z  INFO 1 --- [mockup-test] [oller-V1Service] i.k.client.informer.cache.Controller     : informer#Controller: ready to run resync & reflector runnable
2024-04-23T16:26:55.549Z  INFO 1 --- [mockup-test] [oller-V1Service] i.k.client.informer.cache.Controller     : informer#Controller: resync skipped due to 0 full resync period
2024-04-23T16:26:55.554Z  INFO 1 --- [mockup-test] [ler-V1Endpoints] i.k.client.informer.cache.Controller     : informer#Controller: ready to run resync & reflector runnable
2024-04-23T16:26:55.554Z  INFO 1 --- [mockup-test] [ler-V1Endpoints] i.k.client.informer.cache.Controller     : informer#Controller: resync skipped due to 0 full resync period
2024-04-23T16:26:55.746Z  INFO 1 --- [mockup-test] [els.V1Service-1] i.k.c.informer.cache.ReflectorRunnable   : class io.kubernetes.client.openapi.models.V1Service#Start listing and watching...
2024-04-23T16:26:55.747Z  INFO 1 --- [mockup-test] [s.V1Endpoints-1] i.k.c.informer.cache.ReflectorRunnable   : class io.kubernetes.client.openapi.models.V1Endpoints#Start listing and watching...
2024-04-23T16:26:56.551Z  INFO 1 --- [mockup-test] [pool-6-thread-1] s.c.k.c.d.KubernetesDiscoveryClientUtils : Waiting for the cache of informers to be fully loaded..
2024-04-23T16:26:57.546Z  INFO 1 --- [mockup-test] [pool-6-thread-1] s.c.k.c.d.KubernetesDiscoveryClientUtils : Waiting for the cache of informers to be fully loaded..
2024-04-23T16:26:58.460Z  INFO 1 --- [mockup-test] [pool-6-thread-1] s.c.k.c.d.KubernetesDiscoveryClientUtils : Waiting for the cache of informers to be fully loaded..
2024-04-23T16:26:59.460Z  INFO 1 --- [mockup-test] [pool-6-thread-1] s.c.k.c.d.KubernetesDiscoveryClientUtils : Waiting for the cache of informers to be fully loaded..
2024-04-23T16:27:00.460Z  INFO 1 --- [mockup-test] [pool-6-thread-1] s.c.k.c.d.KubernetesDiscoveryClientUtils : Waiting for the cache of informers to be fully loaded..
2024-04-23T16:27:01.546Z  INFO 1 --- [mockup-test] [pool-6-thread-1] s.c.k.c.d.KubernetesDiscoveryClientUtils : Waiting for the cache of informers to be fully loaded..
2024-04-23T16:27:02.546Z  INFO 1 --- [mockup-test] [pool-6-thread-1] s.c.k.c.d.KubernetesDiscoveryClientUtils : Waiting for the cache of informers to be fully loaded..
2024-04-23T16:27:03.558Z  INFO 1 --- [mockup-test] [pool-6-thread-1] s.c.k.c.d.KubernetesDiscoveryClientUtils : Waiting for the cache of informers to be fully loaded..
2024-04-23T16:27:04.546Z  INFO 1 --- [mockup-test] [pool-6-thread-1] s.c.k.c.d.KubernetesDiscoveryClientUtils : Waiting for the cache of informers to be fully loaded..
2024-04-23T16:27:05.547Z  INFO 1 --- [mockup-test] [pool-6-thread-1] s.c.k.c.d.KubernetesDiscoveryClientUtils : Waiting for the cache of informers to be fully loaded..
2024-04-23T16:27:06.546Z  INFO 1 --- [mockup-test] [pool-6-thread-1] s.c.k.c.d.KubernetesDiscoveryClientUtils : Waiting for the cache of informers to be fully loaded..
2024-04-23T16:27:07.547Z  INFO 1 --- [mockup-test] [pool-6-thread-1] s.c.k.c.d.KubernetesDiscoveryClientUtils : Waiting for the cache of informers to be fully loaded..
2024-04-23T16:27:08.546Z  INFO 1 --- [mockup-test] [pool-6-thread-1] s.c.k.c.d.KubernetesDiscoveryClientUtils : Waiting for the cache of informers to be fully loaded..
2024-04-23T16:27:09.546Z  INFO 1 --- [mockup-test] [pool-6-thread-1] s.c.k.c.d.KubernetesDiscoveryClientUtils : Waiting for the cache of informers to be fully loaded..
2024-04-23T16:27:10.460Z  INFO 1 --- [mockup-test] [pool-6-thread-1] s.c.k.c.d.KubernetesDiscoveryClientUtils : Waiting for the cache of informers to be fully loaded..
2024-04-23T16:27:11.460Z  INFO 1 --- [mockup-test] [pool-6-thread-1] s.c.k.c.d.KubernetesDiscoveryClientUtils : Waiting for the cache of informers to be fully loaded..
2024-04-23T16:27:12.546Z  INFO 1 --- [mockup-test] [pool-6-thread-1] s.c.k.c.d.KubernetesDiscoveryClientUtils : Waiting for the cache of informers to be fully loaded..
2024-04-23T16:27:13.460Z  INFO 1 --- [mockup-test] [pool-6-thread-1] s.c.k.c.d.KubernetesDiscoveryClientUtils : Waiting for the cache of informers to be fully loaded..
2024-04-23T16:27:13.549Z  INFO 1 --- [mockup-test] [           main] s.c.k.c.d.KubernetesDiscoveryClientUtils : Cache fully loaded (total 6 services), discovery client is now available
2024-04-23T16:27:28.151Z  INFO 1 --- [mockup-test] [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port 8761 (http) with context path ''
2024-04-23T16:27:29.050Z  INFO 1 --- [mockup-test] [           main] com.mockup.mockup.MockupApplication      : Started MockupApplication in 230.599 seconds (process running for 253.897)
Starting EventListener when ApplicationReadyEvent !!!
Kubernetes services size 2
Discovered service mockup
Discovered service gateway
root@node1:~#

For some reason mockup microservice is not found. Do you know what might be the issue?

rcbandit111 commented 2 months ago

@wind57 Do you need additional information?

wind57 commented 2 months ago
  1. there are no deployment files in your samples
  2. even if I create RBAC files and deployment files and try to deploy it:
***************************
APPLICATION FAILED TO START
***************************

Description:

Config data resource 'file [/home/config/gateway-configuration.yml]' via location 'file:/home/config/gateway-configuration.yml' does not exist

Please create a sample that is reproducible. Thank you

rcbandit111 commented 2 months ago

@wind57 I have updated the config files. I used helm charts. Please try to reuse your deployment files and RBAC files.

wind57 commented 2 months ago

First a disclaimer: I am not an employee of Spring team. I do this on my own time, without being payed. I hope you understand that. So every time I am asking for a reproducible/simple sample, is because that will save me a lot of time when investigating these kind of issues. That being said, your samples are by far not simple: I can't figure out the templating in helm (neither I should be doing that is a sample), so provide plain deployments/RBAC (I have been asking for this numerous times on your issues, all my requests where ignored); your application has far too many dependencies: vault, security, POST where a simple GET is needed, so on and so forth. Just strip down your application to the minimum.

I already explained what such a sample is on a different issue you opened, but here is a reminder: https://github.com/wind57/gateway-demo. This is what I am expecting, but not only me, any person willing to help you.

Here is what I had to do to re-produce the issue and fix:


management:
  endpoints:
    web:
      exposure:
        include: gateway, health
  endpoint:
    gateway:
      enabled: true

This is needed so that I could go to /actuator/gateway and see what routes are there.

@RestController
@RequestMapping(value = "/admin")
public class Endpoint {

    @GetMapping("/greeting")
    public @ResponseBody String greeting()
    {
        return "test response";
    }

}
spring:
  application:
    name: int-test-project
  jackson:
    time-zone: UTC

server:
  port: 8761

Then I deployed the apps, did a :

root@kind-control-plane:/# kubectl get pods -o wide
NAME                           READY   STATUS    RESTARTS   AGE     IP            NODE                 NOMINATED NODE   READINESS GATES
gateway-demo-775cb8956-rmmzk   1/1     Running   0          3s      10.244.0.14   kind-control-plane   <none>           <none>
mockup-786c547bcc-67cd2        1/1     Running   0          6m41s   10.244.0.12   kind-control-plane   <none>           <none>

and:

root@kind-control-plane:/# curl 10.244.0.14:8888/mockup/admin/greeting
test responseroot@kind-control-plane:/#

The most probably cause of your problem is that you are missing a dependency in gateway, read this issue (bottom comments)

rcbandit111 commented 2 months ago

@wind57 Thanks. I removed much of the code that I have. Can you show me your rotes definition into gateway, please?

wind57 commented 2 months ago

In my sample, I don't have any explicit routes, all are created by the gateway based on the discovery client. You can see them by going to /actuator/gateway once you enable that endpoint (I showed above how to do that)

rcbandit111 commented 2 months ago

@wind57 I tried this:

spring:
  application:
    name: gateway
  cloud:
    gateway:
      routes:
        - id: mockup
          uri: lb://mockup
          predicates:
            - Path=/mockup/**

But when I do GET <host>:8888/mockup/admin/greeting I get Not Found. Maybe I need to define it some other way?

I get these rotes:

[
    {
        "href": "/actuator/gateway/routedefinitions",
        "methods": [
            "GET"
        ]
    },
    {
        "href": "/actuator/gateway/globalfilters",
        "methods": [
            "GET"
        ]
    },
    {
        "href": "/actuator/gateway/routefilters",
        "methods": [
            "GET"
        ]
    },
    {
        "href": "/actuator/gateway/routes/mockup/combinedfilters",
        "methods": [
            "GET"
        ]
    },
    {
        "href": "/actuator/gateway/routes",
        "methods": [
            "POST",
            "GET"
        ]
    },
    {
        "href": "/actuator/gateway/routes/mockup",
        "methods": [
            "POST",
            "DELETE",
            "GET"
        ]
    },
    {
        "href": "/actuator/gateway/",
        "methods": [
            "GET"
        ]
    },
    {
        "href": "/actuator/gateway/routepredicates",
        "methods": [
            "GET"
        ]
    },
    {
        "href": "/actuator/gateway/refresh",
        "methods": [
            "POST"
        ]
    }
]

PS

/actuator/gateway/routes
[
    {
        "predicate": "Paths: [/mockup/**], match trailing slash: true",
        "route_id": "mockup",
        "filters": [],
        "uri": "lb://mockup",
        "order": 0
    }
]
wind57 commented 2 months ago

what if you delete your explicit routes?

rcbandit111 commented 2 months ago

@wind57 Again not found with removed rotes. Is it possible that services cannot communicate due to blocked access between pods?

wind57 commented 2 months ago

I dont understand what "blocked access" is, to be honest. Can you access the mockup pod by IP on its /admin/greeting from within the cluster? I will have another look at your samples in the upcoming days, if I get some time.

rcbandit111 commented 2 months ago

@wind57

root@node1:~# curl 10.233.75.7:8888/actuator/gateway/routes
[{"predicate":"Paths: [/mockup/**], match trailing slash: true","route_id":"mockup","filters":[],"uri":"lb://mockup","order":0}]
root@node1:~#
root@node1:~#
root@node1:~# curl 10.233.75.7:8888/mockup/admin/greeting
{"timestamp":"2024-04-24T21:08:12.783+00:00","status":404,"error":"Not Found","path":"/mockup/admin/greeting"}
root@node1:~#
root@node1:~#
wind57 commented 2 months ago

You are calling the endpoint from the gateway. I said from the mockup ( on port 8761 ). Can you reach the mockup itself? Does that make sense? But still, something is off, you get a 404, not a 503. This means you cant even reach your gateway endpoint, to begin with. Didn't you have a context path root defined in gateway? Like /api/mockup....

rcbandit111 commented 2 months ago

@wind57 Yes I can call directly gateway and mockup microservice from kubernetes CLI:

root@node1:~# curl 10.233.102.169:8761/admin/greeting
test response
root@node1:~#

But CLI -> gateway -> mockup is not working

I commended the /api context: https://github.com/rcbandit111/gateway/blob/main/src/main/resources/application.yml

rcbandit111 commented 2 months ago

@wind57 I have an idea what might be wrong. When I deploy the projects via helm charts I use these configurations:

apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: role-full-access-to-secrets
rules:
  - apiGroups: [""]   # access secret - regcred
    resources: ["secrets"]
    resourceNames: ["regcred"]
    verbs: ["delete"]
  - apiGroups: [""]
    resources: ["secrets"]
    verbs: ["create"]
  - apiGroups: [""]
    resources: ["nodes", "services", "pods", "endpoints"]
    verbs: ["get", "list", "watch"]
  - apiGroups: [""]
    resources: ["configmaps"]
    verbs: ["get"]
  - apiGroups: ["extensions"]
    resources: ["deployments"]
    verbs: ["get", "list", "watch"]

Any idea which one of those I need?

wind57 commented 2 months ago

that's not it, those rules are only needed in order to be able to "get" the services. In other words, if those would not be correct, your gateway app would not even start.

The problem is elsewhere. I don't have the time in the upcoming days to figure it out, may be in a week or so, but not promising.

wind57 commented 2 months ago

I took your sample, and it works if I strip it down even more and add one thing to it:

spring:
  cloud:
    gateway:
      discovery:
        locator:
          enabled: true

This is present in at least 4 places now that you are aware of :)

rcbandit111 commented 2 months ago

@wind57 Thank you this solves the issue. Previously this setting was not necessary when I used Eureka to discover services with Spring Gateway when I was not using Kubernetes.

wind57 commented 2 months ago

you can close the issue then...