[英]nginx ingress controller not reading configmap
我在我使用官方指南配置的 aks 上有一个 nginx 入口 controller 。 我还想配置 nginx 以允许 header 中的下划线,所以我写下了以下配置图
apiVersion: v1
kind: ConfigMap
data:
enable-underscores-in-headers: "true"
metadata:
name: nginx-configuration
请注意,我使用 nginx 的默认命名空间。 然而,应用 configmap 似乎没有发生任何事情。 我没有看到任何事件。 我在这里做错了什么?
Name: nginx-configuration
Namespace: default
Labels: <none>
Annotations: kubectl.kubernetes.io/last-applied-configuration:
{"apiVersion":"v1","data":{"enable-underscores-in-headers":"true"},"kind":"ConfigMap","metadata":{"annotations":{},"name":"nginx-configura...
Data
====
enable-underscores-in-headers:
----
true
Events: <none>
nginx 入口 controller 部署是指可以通过描述部署来检查的 ConfigMap。
args:
- /nginx-ingress-controller
- --configmap=$(POD_NAMESPACE)/nginx-configuration
您需要编辑该 configMap 并添加该参数,而不是创建新参数。
kubectl edit cm nginx-configuration -n namespacename
解决方案是正确命名 configmap,首先我做了kubectl describe deploy nginx-ingress-controller
,其中包含此部署正在寻找的 configmap。 就我而言,它类似于--configmap=default/nginx-ingress-controller
。 我将 configmap 的名称更改为nginx-ingress-controller
。 一旦我这样做了,controller 从我的 configmap 中获取数据并更改了我的 nginx pod 中的配置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.