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

Viewed 1828

I feel like I'm missing something pretty basic here, but can't find what I'm looking for.

Referring to the NGINX Ingress Controller documentation regarding command line arguments how exactly would you use these? Are you calling a command on the nginx-ingress-controller pod with these arguments? If so, what is the command name?

Can you provide an example?

2 Answers

Command line arguments are accepted by the Ingress controller executable.This can be set in container spec of the nginx-ingress-controller Deployment manifest.

List of annotation document :

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

Command line argument document:

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

If you will run the command

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

You will find this snip :

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

Where these all are command line arguments of nginx as suggested.From here you can also change the --annotations-prefix=nginx.ingress.kubernetes.io from here.

Default annotation in nginx is nginx.ingress.kubernetes.io.

!!! note The annotation prefix can be changed using the --annotations-prefix inside command line argument, but the default is nginx.ingress.kubernetes.io.

If you are using the Helm chart, then you can simply create a configmap named {{ include "ingress-nginx.fullname" . }}-tcp in the same namespace where the ingress controller is deployed. (Unfortunately, I wasn't able to figure out what the default value is for ingress-nginx.fullname... sorry. If someone knows, feel free to edit this answer.)

If you need to specify a different namespace for the configmap, then you might be able to use the .Values.tcp.configMapNamespace property, but honestly, I wasn't able to find it applied anywhere in the code, so YMMV.

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