简体   繁体   English

如何在 kube.netes 中为 nginxinc/nginx-ingress 配置添加第三方模块?

[英]How to Add a third party module for nginxinc/nginx-ingress configuration in kubernetes?

Goal:目标:

I am trying to include a thirdparty module a Http_more_headers to provide a custom name to the server in the headers.我正在尝试包含一个第三方模块 Http_more_headers 以在标头中为服务器提供自定义名称。

I am able to build a custom controller image with the module installed with a slightly tweaked DockerFile.我能够构建一个自定义 controller 图像,其中安装的模块稍微调整了 DockerFile。

Issue:问题:

To enable this third party module I need to add the load_module directive in the nginx.conf I am however confused on how the ingress controller interprets the nginx.conf file.要启用此第三方模块,我需要在 nginx.conf 中添加 load_module 指令,但我对入口 controller 如何解释 nginx.conf 文件感到困惑。 If I add the load_module in the server-snippet annotation, will it work?如果我在 server-snippet 注释中添加 load_module,它会起作用吗? or do I have to modify the.tmpl file to enable the third party module?还是必须修改 .tmpl 文件才能启用第三方模块? or should I just modify the nginx.conf and use a COPY during the image build itself?或者我应该只修改 nginx.conf 并在图像构建过程中使用 COPY? which would be the best way to achieve the goal?哪种方法是实现目标的最佳方式?

Use the "main-snippets" configMap key under "data" followed by the value "load_module <module_path>"使用“data”下的“main-snippets”configMap 键,后跟值“load_module <module_path>”

example:例子:

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

Check the documentation here .此处查看文档。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Kubernetes - nginx-ingress 在通过 php 上传文件后崩溃 - Kubernetes - nginx-ingress is crashing after file upload via php Kube.netes - Ingress-nginx 路由错误(无法将前端连接到后端) - Kubernetes - Ingress-nginx routing error (Cannot connect frontend to backend) 如何在 nginx 入口上添加自定义安全策略和引用策略 - how to add custom security policy and referrer policy on nginx ingress Kubernetes 入口:SSL(HTTP -&gt; HTTPS)重定向不起作用(Nginx Docker) - Kubernetes Ingress: SSL (HTTP -> HTTPS) redirect not working (Nginx Docker) 错误:gcloud 加载失败:没有名为“googlecloudsdk.third_party.apis.binaryauthorization.v1alpha2.binaryauthorization_v1alpha2_messages”的模块 - ERROR: gcloud failed to load: No module named 'googlecloudsdk.third_party.apis.binaryauthorization.v1alpha2.binaryauthorization_v1alpha2_messages' 如何在单个 GKE 集群和命名空间中为内部和外部使用 Nginx 入口服务 - How to use Nginx ingress service for internal and external in a single GKE cluster and namespace 如何在nginx ingress中根据http header重定向URL? - How to redirect URL based on http header in nginx ingress? 如何使用 Google 计算云在 kubernetes_ingress_v1 中自动从 http 重定向到 https? - How to redirect from http to https automatically in kubernetes_ingress_v1 with Google compute cloud? 将第三方 VPC 与现有 VPC 网络对等设置连接 - GCP - Connect a third party VPC with existing VPC Network Peering setup - GCP GCE 第三方自动化(快照/图像等...) - GCE Third Party for automation (snapshots/images etc...)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM