使用应用程序网关启用基于 Cookie 的相关性Enable Cookie based affinity with an Application Gateway

Azure 应用程序网关文档中所述,应用程序网关支持基于 Cookie 的相关性,这意味着它可以将后续流量从用户会话定向到同一服务器进行处理。As outlined in the Azure Application Gateway Documentation, Application Gateway supports cookie based affinity, which means it can direct subsequent traffic from a user session to the same server for processing.

示例Example

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: guestbook
  annotations:
    kubernetes.io/ingress.class: azure/application-gateway
    appgw.ingress.kubernetes.io/cookie-based-affinity: "true"
spec:
  rules:
  - http:
      paths:
      - backend:
          serviceName: frontend
          servicePort: 80