ribbon.mode SERVICE doesn't work
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
What version of Spring Cloud are you using?
springCloudVersion = 'Greenwich.SR2' springBootVersion = '2.1.6.RELEASE'
This project no longer has direct ribbon integration
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?
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
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>
when using spring-cloud-starter-loadbalancer,how to use SERVICE mode?
@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).