k8s ingress 配置问题

 

1、文件太大

413:Request Entity Too Large

metadata:
  annotations:
    nginx.ingress.kubernetes.io/proxy-body-size: 1024m

2、上传超时

504:Gateway Timeout

metadata:
  annotations:
    nginx.ingress.kubernetes.io/proxy-read-timeout: "600"
    nginx.ingress.kubernetes.io/proxy-send-timeout: "600"
    nginx.ingress.kubernetes.io/proxy_connect_timeout: "600"

 

3、Nginx常用配置

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: ingress-dt
  annotations:
    kubernetes.io/ingress.class: "nginx"
    nginx.ingress.kubernetes.io/configuration-snippet: |
        proxy_set_header Upgrade $http_upgrade;
        proxy_http_version 1.1;
        proxy_set_header X-Forwarded-Host $http_host;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header Host $host;
        proxy_set_header Connection "upgrade";
        proxy_cache_bypass $http_upgrade;

转:Kubernetes Ingress Nginx常用配置参数设置

 

k8s参考资料 :https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/

你可能感兴趣的:(k8s,nginx,负载均衡,负载均衡,nginx,k8s)