Ingress配置笔记

记录了一些自己在使用ingress所用到的ConfigMap

相关官方文档
https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/

413 Request Entity Too Large

  • nginx-configuration

proxy-body-size: 0

根据实际情况修改大小

API的访问控制

  • nginx-configuration
1
add-headers: ingress-nginx/custom-headers

custom-headers为自定义ConfigMap名字,命名空间与ingress所在的相同

  • custom-headers
1
2
3
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Access-Control-Allow-Origin: $http_origin

四层负载均衡设置

  • tcp-services & udp-services
1
2
3
# 端口号: 命名空间/服务:端口
# e.g.
"80": namespace/service:80

Ingress配置笔记
https://blog.new-page.xyz/2019/12/18/Ingress配置笔记/
作者
Gunslinger
发布于
2019年12月18日
许可协议