使用 NGINX Ingress Controller 执行命令行参数的命令是什么?

What is the command to execute command line arguments with NGINX Ingress Controller?

我觉得我在这里缺少一些非常基本的东西,但找不到我要找的东西。

参考有关 command line arguments 的 NGINX Ingress Controller 文档,您将如何使用它们?您是否使用这些参数在 nginx-ingress-controller pod 上调用命令?如果是这样,命令名称是什么?

你能举个例子吗?

Ingress 控制器接受命令行参数 executable.This 可以在 nginx-ingress-controller 部署清单的容器规范中设置。

注释文档列表:

https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/nginx-configuration/annotations.md

命令行参数文档:

https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/cli-arguments.md

如果你会 运行 命令

kubectl describe deployment/nginx-ingress-controller --namespace

你会发现这个片段:

Args:
  --default-backend-service=$(POD_NAMESPACE)/default-http-backend
  --tcp-services-configmap=$(POD_NAMESPACE)/tcp-services
  --annotations-prefix=nginx.ingress.kubernetes.io

这些都是 nginx 的命令行参数,如 suggested.From 这里你也可以从这里更改 --annotations-prefix=nginx.ingress.kubernetes.io

nginx 中的默认注释是 nginx.ingress.kubernetes.io

!!! note注解前缀可以使用command line argument里面的--annotations-prefix来改变,但是默认是nginx.ingress.kubernetes.io.

如果您正在使用 the Helm chart,那么您只需在部署入口控制器的同一命名空间中创建一个名为 {{ include "ingress-nginx.fullname" . }}-tcp 的配置映射。 (不幸的是,我无法弄清楚 ingress-nginx.fullname 的默认值是什么...抱歉。如果有人知道,请随时编辑此答案。)

如果您需要为 configmap 指定不同的命名空间,那么您可以使用 .Values.tcp.configMapNamespace property,但老实说,我无法在代码的任何地方找到它,所以 YMMV .

  ## Allows customization of the tcp-services-configmap
  ##
  tcp:
    configMapNamespace: ""   # defaults to .Release.Namespace
    ## Annotations to be added to the tcp config configmap
    annotations: {}