初见

k8s nodePort类型的service,session保持

2020-05-26  本文已影响0人  PENG先森_晓宇
apiVersion: v1
kind: Service
metadata:
  name: helloworldsvc
  labels:
    weblogic-app: helloworld
spec:
  type: NodePort
  ports:
  - port: 7001
    protocol: TCP
    targetPort: 7001
    name: http
    nodePort: 30005
  selector:
    weblogic-app: helloworld
  sessionAffinity: ClientIP

最核心就是最后那句,会基于客户端访问服务的ip进行hash运算后把同一ip的请求路由到同一个pod.这样通过nodePort方式过来的请求就不会到处分发了

上一篇 下一篇

猜你喜欢

热点阅读