vaadin / kubernetes-kit

Other
2 stars 2 forks source link

Redis config examples broken #91

Closed petrixh closed 10 months ago

petrixh commented 10 months ago

While trying out Kubernetes Kit with Redis, it feels like the examples for how to configure the redis enpoint is missing a keyword for Spring:

In our docs: https://vaadin.com/docs/latest/tools/kubernetes/configuration

the instructions say to set in application.properties spring.redis.host: redis-service

However, I could not get this to work... That being said, when using: spring.data.redis.host: kubernetes-kit-redis-service

i.e. adding "data" to the path, it started to work...

I also tried the demo from: https://github.com/vaadin/kubernetes-kit/tree/main/kubernetes-kit-demo

And following the steps, when doing the "Scale the deployment part" my counter was reset... When looking at the logs I did see a exception that it could not connect to Redis on "localhost"... kubekit-redis-stacktrace.txt

When changing the application.yml for the demo app from:

spring:
  redis:
    host: kubernetes-kit-redis-service

to:

spring:
  data:
    redis:
      host: kubernetes-kit-redis-service

The demo started working and I was able to kill the "current pod" without loosing my counter value..

petrixh commented 10 months ago

Quick googling indicates it's a Spring Boot 2.x to Spring Boot 3.x change: https://www.baeldung.com/spring-data-redis-properties