Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Kubernetes 如何配置没有会话关联的ClusterIP类型的OpenShift群集?_Kubernetes_Openshift_Load Balancing - Fatal编程技术网

Kubernetes 如何配置没有会话关联的ClusterIP类型的OpenShift群集?

Kubernetes 如何配置没有会话关联的ClusterIP类型的OpenShift群集?,kubernetes,openshift,load-balancing,Kubernetes,Openshift,Load Balancing,我已将以下服务部署到openshift apiVersion: v1 kind: Service metadata: labels: app: tika-server template: tika-server-template name: tika-server namespace: testns spec: clusterIP: None ports: - name: manager port: 8889 protocol:

我已将以下
服务部署到openshift

apiVersion: v1
kind: Service
metadata:
  labels:
    app: tika-server
    template: tika-server-template
  name: tika-server
  namespace: testns
spec:
  clusterIP: None
  ports:
    - name: manager
      port: 8889
      protocol: TCP
      targetPort: 8889
    - name: worker
      port: 9001
      protocol: TCP
      targetPort: 9001
  selector:
    app: tika-server
  sessionAffinity: None
  type: ClusterIP
status:
  loadBalancer: {}
我希望此服务具有会话关联性

所以我有

  sessionAffinity: None
  type: ClusterIP
我希望它能告诉OpenShift,我希望能够在完全没有会话关联的情况下访问此服务器。来自pod的每个请求都应该命中所有服务器

但当我使用这个服务时,从其他pod中,我仍然看到基于cookie的会话关联正在发生。换句话说,每个请求都会返回一个cookie,例如:

Cookie: 7110c3e5...6aa9f40c9=97f1b6daf76...18a6
因此,使用此服务的每个pod都会绑定到一个节点,在我的例子中,这是不可取的行为。作为解决办法,我必须禁用cookies

当我禁用cookie时,我得到了预期的负载平衡


我错过了什么?是否需要其他配置参数来禁用此会话关联?

服务级别上的会话关联不使用Cookie,而是使用ip地址作为关联。与Cookie的会话关联性很可能是由入口控制器引起的。您使用的入口控制器是什么?你能为此服务提供ingress对象yaml吗?我不使用ingress。这只是群集中的点对点通信。服务级别上的sessionAffinity不使用Cookie,而是使用ip地址作为关联。与Cookie的会话关联性很可能是由入口控制器引起的。您使用的入口控制器是什么?你能为此服务提供ingress对象yaml吗?我不使用ingress。这只是集群内的点对点通信量。