skip to Main Content

look doc https://kubernetes.github.io/ingress-nginx/user-guide/exposing-tcp-udp-services/

alter nginx helm deploymet as follows:

    Args:
      -nginx-plus=false
      -nginx-reload-timeout=60000
      -enable-app-protect=false
      -enable-app-protect-dos=false
      -nginx-configmaps=$(POD_NAMESPACE)/nginx-helm-pkg-nginx-ingress
      -ingress-class=nginx
      -health-status=false
      -health-status-uri=/nginx-health
      -nginx-debug=false
      -v=1
      -nginx-status=true
      -nginx-status-port=8080
      -nginx-status-allow-cidrs=127.0.0.1
      -report-ingress-status
      -external-service=nginx-helm-pkg-nginx-ingress-controller
      -enable-leader-election=true
      -leader-election-lock-name=nginx-helm-pkg-nginx-ingress-leader-election
      -enable-prometheus-metrics=true
      -prometheus-metrics-listen-port=9113
      -prometheus-tls-secret=
      -enable-service-insight=false
      -service-insight-listen-port=9114
      -service-insight-tls-secret=
      -enable-custom-resources=true
      -enable-snippets=false
      -include-year=false
      -disable-ipv6=false
      -enable-tls-passthrough=false
      -enable-preview-policies=false
      -enable-cert-manager=false
      -enable-oidc=false
      -enable-external-dns=false
      -ready-status=true
      -ready-status-port=8081
      -enable-latency-metrics=false
      -tcp-services-configmap=default/tcpservercm
    State:          Waiting
      Reason:       CrashLoopBackOff
    Last State:     Terminated
      Reason:       Error
      Exit Code:    2

but error happened,check log:

[root@k8smasternode ~]# kubectl logs  nginx-helm-pkg-nginx-ingress-controller-5d54f5c744-4xkd5 -n nginx
NGINX Ingress Controller Version=3.2.1 Commit=2fa43089c21fdff5725af692c08d6fc91ca74640 Date=2023-08-18T01:04:50Z DirtyState=false Arch=linux/amd64 Go=go1.21.0
flag provided but not defined: -tcp-services-configmap
Usage of /nginx-ingress:
  -alsologtostderr
        log to standard error as well as files
  -app-protect-dos-debug
        Enable debugging for App Protect Dos. Requires -nginx-plus and -enable-app-protect-dos.
  -app-protect-dos-max-daemons int
        Max number of ADMD instances. Requires -nginx-plus and -enable-app-protect-dos.
  -app-protect-dos-max-workers int
        Max number of nginx processes to support. Requires -nginx-plus and -enable-app-protect-dos.

error message flag provided but not defined: -tcp-services-configmap

docker images

nginx/nginx-ingress                                                           3.2.1     c97648faa8a0   2 weeks ago     301MB

can anyone help me?

2

Answers


  1. You should replace -tcp-services-configmap with --tcp-services-configmap.

    refer to exposing-tcp-udp-services.

    Login or Signup to reply.
  2. Here there is a typo error where the args are --tcp-services-configmap, instead you are using -tcp-services-configmap.

    –tcp-services-configmap flag is used to specify the name of the ConfigMap containing the definition of the TCP services to expose. The key in the map indicates the external port to be used. The value is a reference to a Service in the form "namespace/name:port", where "port" can either be a port number or name. TCP ports 80 and 443 are reserved by the controller for servicing HTTP traffic.

    Further, the tcp value allows you to set a key configMapNamespace. So if you were to set this key only, then the flag would be used as per paramaters helpers.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search