处理服务中的长Pod响应时间

时间:2018-05-24 12:06:32

标签: service deployment kubernetes httprequest kubernetes-ingress

给出以下配置:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
spec:
  replicas: 4
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
        - image: nginx
          name: nginx
          ports:
            - containerPort: 80
      restartPolicy: Always

---

apiVersion: v1
kind: Service
metadata:
  name: nginx-service
spec:
  type: NodePort
  ports:
    - port: 80
      nodePort: 30001
      name: server
selector:
  app: nginx

如何在此配置服务和部署(或者如果需要,如果是Ingress对象),以便当Pod超过 n 秒返回HTTP响应时,服务将尝试请求另一个nginx-deployment Pod?

1 个答案:

答案 0 :(得分:0)

Kubernetes服务基于简单的iptables规则。 流量仅限NAT到目标广告连播。您无法调整任何图层,例如超时和基于它的服务质量设置。