spring-cloud-kubernetes icon indicating copy to clipboard operation
spring-cloud-kubernetes copied to clipboard

ribbon.mode SERVICE doesn't work

Open DmitryevichD opened this issue 5 years ago • 8 comments

Describe the bug I sets a ribbon property spring.cloud.kubernetes.ribbon.mode: SERVICE to my application.yml, but my client sends request by Pod IP address. After that I downloads this project and don't find KubernetesRibbonMode in the code. Also I don't find in the code SERVICE and POD rules.
I looked at examples from the documentation but I didn't find the use of these setting.

Please, explain how it work or give a link to the code with KubernetesRibbonMode

springCloudVersion = 'Greenwich.SR2' springBootVersion = '2.1.6.RELEASE'

Thanks.

Sample

spring:
  profiles:
    active: dev
  application:
    name: otp
  cloud:
    kubernetes:
      ribbon:
        mode: SERVICE

DmitryevichD avatar Apr 28 '20 23:04 DmitryevichD

What version of Spring Cloud are you using?

ryanjbaxter avatar Apr 28 '20 23:04 ryanjbaxter

springCloudVersion = 'Greenwich.SR2' springBootVersion = '2.1.6.RELEASE'

DmitryevichD avatar Apr 28 '20 23:04 DmitryevichD

This project no longer has direct ribbon integration

spencergibb avatar Apr 28 '20 23:04 spencergibb

Thanks. Now I'm updating my spring cloud version and try it. I want to understand how it work. but I can't find source code for POD or SERVICE mode. I was looking in this project and spring-cloud-commons and kubernetes-client-project, but nothing. Can you help me find these sources?

DmitryevichD avatar Apr 29 '20 00:04 DmitryevichD

I update spring version to

  • springBootVersion = '2.2.6.RELEASE'
  • springCloudVersion = 'Hoxton.SR4' but nothing changed

When my service is starting my request to config service performed by POD IP, but I set mode: SERVICE

Starting log: c.c.c.ConfigServicePropertySourceLocator : Fetching config from server at : http://10.34.192.45:8080/

Endpoint list:

{
  "kind": "EndpointsList",
  "apiVersion": "v1",
  "metadata": {
    "selfLink": "/api/v1/namespaces/default/endpoints",
    "resourceVersion": "245817222"
},
"items": [
{
      "metadata": {
        "name": "config",
        "namespace": "default",
        "selfLink": "/api/v1/namespaces/default/endpoints/config",
        "uid": "20a39110-7e61-11ea-bc7e-005056b72fea",
        "resourceVersion": "226027737",
        "creationTimestamp": "2020-04-14T15:03:41Z",
        "labels": {
          "app.kubernetes.io/instance": "config"
        },
        "annotations": {
          "endpoints.kubernetes.io/last-change-trigger-time": "2020-04-17T07:55:24Z"
        }
      },
      "subsets": [
        {
          "addresses": [
            {
              "ip": "10.34.192.45",
              "nodeName": "tst-efr003",
              "targetRef": {
                "kind": "Pod",
                "namespace": "default",
                "name": "config-86df5f867b-qqxrg",
                "uid": "a4a86b1f-8080-11ea-8e53-005056b71a69",
                "resourceVersion": "226027735"
              }
            }
          ],
          "ports": [
            {
              "port": 8080,
              "protocol": "TCP"
            }
          ]
        }
      ]
    },

k8s services: config ClusterIP 10.110.174.199 <none> 8080/TCP 22d

DmitryevichD avatar May 07 '20 13:05 DmitryevichD

Hi @spencergibb - Thanks for indicating that ribbon is not supported. Please can you advice any specific reason why this was removed? This was working with the below versions,

        springBootVersion = '2.2.4.RELEASE'
        springCloudVersion = 'Hoxton.SR1'

We upgraded our application to the below versions and found that k8s integration is broken,

        springBootVersion = '2.2.7.RELEASE'
        springCloudVersion = 'Hoxton.SR4'

Also please advice what we can do to support ribbon discovery client with k8s as below dependency is no longer there in kubernetes-all ?

<dependency>	
    <groupId>org.springframework.cloud</groupId>	
    <artifactId>spring-cloud-starter-kubernetes-ribbon</artifactId>	
</dependency>

nilavalagansugumaran avatar May 28 '20 11:05 nilavalagansugumaran

when using spring-cloud-starter-loadbalancer,how to use SERVICE mode?

jayzch avatar Jul 14 '20 12:07 jayzch

@jayzch this got just merged into master and we are also working to get it available for the coming Hoxton release (https://github.com/spring-cloud/spring-cloud-kubernetes/pull/610).

OlgaMaciaszek avatar Aug 27 '20 16:08 OlgaMaciaszek