Comments (6)
My K8s skills are not at top level, I'll ask if some of our experts could some time to build a working setup for Okteto.
from base-starter-flow-quarkus.
My quick guess is that the ingress/loadbalancer in your K8s clusters needs to be configured for session affinity aka sticky sessions. This is what start.vaadin.com generates for Spring Boot apps, something similar might work in your setup (I have never used Okteto).
apiVersion: v1
kind: Service
metadata:
name: myapp-balancer
spec:
selector:
app: myapp
ports:
- protocol: TCP
port: 8000 # The port to expose to the outside
targetPort: 8080 # The port the application is running on in the pods
type: LoadBalancer
sessionAffinity: ClientIP
from base-starter-flow-quarkus.
Unfortunately, the change you suggested seems to not fix the issue.
I initially didn't think, indeed, of the Docker/Kubernetes files provided by SpringBoot-based skeletons created on start.vaadin.com
.
As they are generated from vaadin/skeleton-starter-flow-spring
template, I forked it and just adapted the Docker/Kubernetes files for a deployment to Okteto (like I did here for the Vaadin-Quarkus)
So that, at the end, the issue root cause seems more general and not only related to Quarkus or Spring Boot support.
By the way, do you think I should then open issue on the main Vaadin Flow repository?
Here below are URLs serving UIs showing this wrong behaviour, and whether it's within:
vaadin-quarkus
sample: https://vaadin-quarkus-cernier.cloud.okteto.net, which has been loaded with my2-dockerized-pods
branch of my fork ofvaadin/base-starter-flow-quarkus
(you can deploy to your own Okteto namespace from it)vaadin-spring
sample: https://vaadin-spring-cernier.cloud.okteto.net, which has been loaded with my2-dockerized-pods
branch of my fork ofvaadin/skeleton-starter-flow-spring
(you can deploy to your own Okteto namespace from it)
Okteto is just a platform allowing to deploy easily to a Kubernetes cluster in the cloud, especially for basic testing purpose with a free pricing.
If you prefer a reproducer on another platform(s), feel free to tell me, I will adapt also to it (them).
from base-starter-flow-quarkus.
No need to create a separate issue, the team can move the issue to Flow repository if they find some issue to work with from here.
I still believe this is an issue in cluster configuration. I quickly used browser inspector and curl against your deployments and it looks like the session cookie changes on every request, even if you provided the session cookie that the server provides in previous request. So either the request goes to a different node on each request (round robin instead of session affinity) or the cookie is dropped by the front proxy.
from base-starter-flow-quarkus.
Here is the output with curl. With properly working setup, the second request shouldn't set the cookie anymore:
mstahv@MatinPikkuRakkine ~ % curl --head https://vaadin-quarkus-cernier.cloud.okteto.net
HTTP/2 200
date: Fri, 18 Feb 2022 08:49:31 GMT
content-type: text/html;charset=utf-8
content-length: 821
set-cookie: JSESSIONID=ngNZQD8kQeravD89N05muhOn0YweOEbROj5dvDPB; path=/
set-cookie: csrfToken=ce5a9570-742e-4679-b285-aa31d292197e; path=/
strict-transport-security: max-age=15724800; includeSubDomains
mstahv@MatinPikkuRakkine ~ % curl --cookie "JSESSIONID=ngNZQD8kQeravD89N05muhOn0YweOEbROj5dvDPB; path=/" --head https://vaadin-quarkus-cernier.cloud.okteto.net
HTTP/2 200
date: Fri, 18 Feb 2022 08:50:02 GMT
content-type: text/html;charset=utf-8
content-length: 821
set-cookie: JSESSIONID=RRUsHVyMzKk2g-sVmbtGpdJRWaizTxYR4nAPUJlA; path=/
set-cookie: csrfToken=36aaa8fd-ad07-458a-ae38-d436373da211; path=/
strict-transport-security: max-age=15724800; includeSubDomains
from base-starter-flow-quarkus.
Yeah, it is round robin. If you make a third request with the initially returned cookie, then it works, but naturally browser then thinks that the session is expired and reloads.
from base-starter-flow-quarkus.
Related Issues (18)
- Generate a Gradle branch for starter HOT 1
- PiT: set execution permissions to the `gradlew` in gradle branch HOT 1
- The outdated mvnw breaks the project with Quarkus CLI HOT 1
- PiT: project in dev-mode does not work in gitpod HOT 4
- PiT: gradle branch does not work HOT 3
- Issue with adding a specific `I18NProvider` implementation HOT 3
- JNA class not found and websocket warnings on startup HOT 3
- PiT v23: project not running HOT 2
- Missing pnpm dependencies when building Quarkus starter on Jenkins using Gradle HOT 12
- Update Quarkus to latest version
- OIDC Authentication HOT 5
- CDI issue HOT 3
- Vaadin Fusion + Quarkus
- Undertow NoClassDefFoundError HOT 2
- Task vaadinBuildFrontend fails on Gitlab Pipeline with dependency error HOT 3
- PiT: define a defaultGoal in pom
- PiT: add the maven wrapper to the project
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from base-starter-flow-quarkus.