【发布时间】:2021-11-23 09:16:26
【问题描述】:
我有一个 ingressroute 配置:
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: demo-rr-camunda-bpm-platform-app-ingress-route1
namespace: bpm
spec:
entryPoints:
- bpm
routes:
- kind: Rule
match: PathPrefix(`/bpm/demo-rr-camunda-bpm-platform-app`)
services:
- kind: Service
name: demo-rr-camunda-bpm-platform-app-service1
port: 5000
tls:
secretName: k8s-code-ru-tls
使用此配置,如果两个副本正在运行,当您尝试请求登录时,页面会从一个 pod 显示,而授权尝试会飞到另一个 pod(并且不起作用)。登录页面和授权 URL 必须在同一个 pod 上工作。
如果我没记错的话,那么这个问题的解决方法就是使用Stickinesshttps://doc.traefik.io/traefik/routing/services/
如果是这样,那么我无法弄清楚如何将此代码应用于我上面描述的现有 ingressroute:
## Dynamic configuration
http:
services:
my-service:
loadBalancer:
sticky:
cookie: {}
【问题讨论】:
-
我找到了解决方案community.traefik.io/t/…
标签: kubernetes traefik traefik-ingress