zma*_*306 7 kubernetes google-kubernetes-engine
我在开发环境中使用了具有以下配置的minibike的粘性会话:
入口:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: gl-ingress
annotations:
nginx.ingress.kubernetes.io/affinity: cookie
kubernetes.io/ingress.class: "gce"
kubernetes.io/ingress.global-static-ip-name: "projects/oceanic-isotope-199421/global/addresses/web-static-ip"
spec:
backend:
serviceName: gl-ui-service
servicePort: 80
rules:
- http:
paths:
- path: /api/*
backend:
serviceName: gl-api-service
servicePort: 8080
Run Code Online (Sandbox Code Playgroud)
服务:
apiVersion: v1
kind: Service
metadata:
name: gl-api-service
labels:
app: gl-api
annotations:
ingress.kubernetes.io/affinity: 'cookie'
spec:
type: NodePort
ports:
- port: 8080
protocol: TCP
selector:
app: gl-api
Run Code Online (Sandbox Code Playgroud)
现在我已将我的项目部署到GKE粘性会话不再起作用.我相信原因是在GKE中配置的全局负载均衡器与NGINX Ingress控制器没有会话关联.任何人都有运气接线吗?任何帮助,将不胜感激.我想建立会话亲和性:客户端浏览器>负载均衡器>入口>服务.实际会话位于服务后面的pod中.它是一个API网关(用Zuul构建).
会话亲缘关系在GCE / GKE入口控制器中尚不可用。
同时,作为解决方法,您可以直接使用GCE API创建HTTP负载平衡器。请注意,您不能在同一群集中同时使用Ingress。
spec.ports[*].nodePort,否则将分配一个随机值小智 5
好消息!最后,他们支持这些类型的调整作为测试版功能!
从 GKE 版本 1.11.3-gke.18 开始,您可以使用 Ingress 配置后端服务的以下属性:
后端服务的配置信息保存在名为 BackendConfig 的自定义资源中,您可以将其“附加”到 Kubernetes 服务。
与其他甜蜜的测试功能(如 CDN、Armor 等)一起,您可以在这里找到操作指南: https://cloud.google.com/kubernetes-engine/docs/how-to/configure-backend -服务
| 归档时间: |
|
| 查看次数: |
2624 次 |
| 最近记录: |