我有一个部署,其中包含 2 个 pod,其中有一个 webapp。安装 Nginx 入口控制器以使用 tls-passthrough 公开这两个 pod。我曾尝试使用注释来设置粘性会话,但无济于事。标头中没有 cookie,因此没有粘性。我该怎么做才能让它发挥作用?非常感谢您的明智回答。
我创建的入口:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ingress
annotations:
# nginx.ingress.kubernetes.io/secure-backends: "true"
# nginx.ingress.kubernetes.io/ssl-passthrough: "true"
# nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
# nginx.ingress.kubernetes.io/rewrite-target: /
nginx.ingress.kubernetes.io/affinity: "cookie"
nginx.ingress.kubernetes.io/affinity-mode: "persistent"
nginx.ingress.kubernetes.io/session-cookie-name: "wabam"
nginx.ingress.kubernetes.io/session-cookie-expires: "172800"
nginx.ingress.kubernetes.io/session-cookie-max-age: "172800"
namespace: default
spec:
rules:
- host: wabam.moulip.lan
http:
paths:
- backend:
serviceName: wabam-ingress-svc
servicePort: 443
path: /