如何在 Helm NginX Ingress 控制器中使用 ConfigMap 配置

您所在的位置:网站首页 nginx在线升级 如何在 Helm NginX Ingress 控制器中使用 ConfigMap 配置

如何在 Helm NginX Ingress 控制器中使用 ConfigMap 配置

2023-01-14 09:14| 来源: 网络整理| 查看: 265

本文介绍了如何在 Helm NginX Ingress 控制器中使用 ConfigMap 配置 – Kubernetes的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我找到了有关如何使用 ConfigMap 配置 NginX 入口控制器的文档:https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/

I’ve found a documentation about how to configure your NginX ingress controller using ConfigMap: https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/

不幸的是,我不知道也找不到如何从我的 Ingress 控制器加载 ConfigMap.

Unfortunately I’ve no idea and couldn’t find it anywhere how to load that ConfigMap from my Ingress controller.

我的入口控制器:

helm install --name ingress --namespace ingress-nginx --set rbac.create=true,controller.kind=DaemonSet,controller.service.type=ClusterIP,controller.hostNetwork=true stable/nginx-ingress

我的配置图:

kind: ConfigMap apiVersion: v1 metadata: name: ingress-configmap data: proxy-read-timeout: "86400s" client-max-body-size: "2g" use-http2: "false"

我的入口:

apiVersion: extensions/v1beta1 kind: Ingress metadata: name: ingress annotations: nginx.ingress.kubernetes.io/backend-protocol: "HTTPS" spec: tls: - hosts: - my.endpoint.net secretName: ingress-tls rules: - host: my.endpoint.net http: paths: - path: / backend: serviceName: web servicePort: 443 - path: /api backend: serviceName: api servicePort: 443

如何让我的 Ingress 从 ConfigMap 加载配置?

How do I make my Ingress to load the configuration from the ConfigMap?

推荐答案

我已经设法使用以下选项显示 Helm 执行的 YAML:--dry-run --debug 选项helm install 命令结束.然后我注意到控制器是用以下命令执行的: --configmap={namespace-where-the-nginx-ingress-is-deployed}/{name-of-the-helm-chart}-nginx-入口控制器.为了加载你的 ConfigMap,你需要用你自己的(检查命名空间)覆盖它.

I’ve managed to display what YAML gets executed by Helm using the: --dry-run --debug options at the end of helm install command. Then I’ve noticed that there controller is executed with the: --configmap={namespace-where-the-nginx-ingress-is-deployed}/{name-of-the-helm-chart}-nginx-ingress-controller. In order to load your ConfigMap you need to override it with your own (check out the namespace).

kind: ConfigMap apiVersion: v1 metadata: name: {name-of-the-helm-chart}-nginx-ingress-controller namespace: {namespace-where-the-nginx-ingress-is-deployed} data: proxy-read-timeout: "86400" proxy-body-size: "2g" use-http2: "false"

配置属性列表可以在此处.

这篇关于如何在 Helm NginX Ingress 控制器中使用 ConfigMap 配置 – Kubernetes的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,WP2

如何在 Helm NginX Ingress 控制器中使用 ConfigMap 配置 – Kubernetes 为WP2原创文章,链接:https://www.app.wp2.cn/other/%e5%a6%82%e4%bd%95%e5%9c%a8-helm-nginx-ingress-%e6%8e%a7%e5%88%b6%e5%99%a8%e4%b8%ad%e4%bd%bf%e7%94%a8-configmap-%e9%85%8d%e7%bd%ae-kubernetes/



【本文地址】


今日新闻


推荐新闻


    CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3