【发布时间】:2019-06-21 03:58:34
【问题描述】:
我正在尝试使用以下 ConfigMap 文件配置我的 nginx-ingress:
apiVersion: v1
data:
client-body-buffer-size: 32m
client-max-body-size: 16m
hsts: "true"
proxy-body-size: 1g
proxy-buffering: "false"
proxy-read-timeout: "600"
proxy-send-timeout: "600"
server-tokens: "false"
ssl-redirect: "false"
upstream-keepalive-connections: "50"
use-proxy-protocol: "true"
kind: ConfigMap
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"v1","data":{"client-body-buffer-size":"32m","client-max-body-size":"16m","hsts":"true","proxy-body-size":"1g","proxy-buffering":"false","proxy-read-timeout":"600","proxy-send-timeout":"600","server-tokens":"false","ssl-redirect":"false","upstream-keepalive-connections":"50","use-proxy-protocol":"true"},"kind":"ConfigMap","metadata":{"annotations":{},"labels":{"app":"ingress-nginx"},"name":"nginx-configuration","namespace":"default"}}
creationTimestamp: 2018-09-28T10:19:23Z
labels:
app: ingress-nginx
name: nginx-configuration
namespace: default
resourceVersion: "65855983"
selfLink: /api/v1/namespaces/default/configmaps/nginx-configuration
uid: f88fe457-c307-11e8-b14b-42010a800076
但由于某种原因,至少 client-max-body-size 配置不起作用 - 它设置为默认 1m。
我可以清楚地看到新配置在GCP中应用成功,但没有任何效果。它不工作的原因可能是什么?
【问题讨论】:
-
你反弹了 nginx 控制器,如果他们自己接受 ConfigMap 更改,我会感到惊讶。之后,检查任何一个控制器 Pod 上的实际
/etc/nginx/nginx.conf,看看它是否可能将设置放置在您没想到的位置
标签: nginx kubernetes nginx-ingress