K8S INGRESS

在K8S中ingress实现7层流量分发实现方案有很多,在用官方的ingress-nginx的时候会碰到header被丢,上传文件太大被拒绝的问题

ingress-nginx挂载的cm配置文件ingress-nginx-controller中添加配置: enable-underscores-in-headers: 'true' proxy-body-size: 100m 后重启pod后可以解决这2个问题

cm的yaml文件


apiVersion: v1
data:
enable-underscores-in-headers: 'true'
proxy-body-size: 100m
kind: ConfigMap
metadata:
annotations: {}
labels:
app.kubernetes.io/component: controller
app.kubernetes.io/instance: ingress-nginx
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: ingress-nginx
app.kubernetes.io/version: 0.48.1
helm.sh/chart: ingress-nginx-3.34.0
name: ingress-nginx-controller
namespace: ingress-nginx
resourceVersion: '6470800409'

posted @ 2021-08-03 11:41  长风七万里  阅读(212)  评论(0编辑  收藏  举报