【问题标题】:How to Add a third party module for nginxinc/nginx-ingress configuration in kubernetes?如何在 kubernetes 中为 nginxinc/nginx-ingress 配置添加第三方模块?
【发布时间】:2020-09-04 02:05:29
【问题描述】:

目标:

我正在尝试包含一个 Http_more_headers 的第三方模块,以便在标头中为服务器提供自定义名称。

我可以build a custom controller image 安装带有稍微调整的 DockerFile 的模块。

问题:

要启用这个第三方模块,我需要在 nginx.conf 中添加 load_module 指令,但是我对入口控制器如何解释 nginx.conf 文件感到困惑。如果我在 server-sn-p 注释中添加 load_module ,它会起作用吗?还是我必须修改 .tmpl 文件才能启用第三方模块?或者我应该只修改 nginx.conf 并在图像构建过程中使用 COPY 吗?哪种方式是实现目标的最佳方式?

【问题讨论】:

    标签: nginx kubernetes google-kubernetes-engine kubernetes-ingress nginx-ingress


    【解决方案1】:

    使用“data”下的“main-sn-ps”configMap键,后跟值“load_module

    示例:

    kind: ConfigMap
    apiVersion: v1
    data:
      main-snippet: load_module /usr/lib/modules/xyz_module.so
    

    查看文档here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-08-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-08-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多