gpt4 book ai didi

azure - nginx 入口 Controller 不读取 configmap

转载 作者:行者123 更新时间:2023-12-02 06:14:16 25 4
gpt4 key购买 nike

我在 aks 上有一个 nginx 入口 Controller ,我使用 official guide 配置了它。我还想配置 nginx 以允许 header 中使用下划线,因此我写下了以下配置映射

apiVersion: v1
kind: ConfigMap
data:
enable-underscores-in-headers: "true"
metadata:
name: nginx-configuration

请注意,我使用的是 nginx 的默认命名空间。然而应用配置映射似乎没有发生任何事情。我没有看到任何事件。我在这里做错了什么?

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>

最佳答案

解决方案是正确命名configmap,首先我做了kubectl描述部署nginx-ingress-controller,其中包含此部署正在寻找的configmap。就我而言,它类似于 --configmap=default/nginx-ingress-controller。我将配置映射的名称更改为 nginx-ingress-controller。一旦我这样做, Controller 就会从我的 configmap 中获取数据并更改我的 nginx pod 内的配置。

关于azure - nginx 入口 Controller 不读取 configmap,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61093560/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com