GithubHelp home page GithubHelp logo

Comments (3)

k8s-ci-robot avatar k8s-ci-robot commented on June 20, 2024

This issue is currently awaiting triage.

If Ingress contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

from ingress-nginx.

strongjz avatar strongjz commented on June 20, 2024

You can expose different ports via a configMap option

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

from ingress-nginx.

shukurew avatar shukurew commented on June 20, 2024

@strongjz thanks for your hint. I fully become familar with documentation.
but I got issue

My Nginx ingress installed via Helm and I'm trying to add TCP/UDP port via values.yaml file

helm upgrade nginx-ingress oci://ghcr.io/nginxinc/charts/nginx-ingress -f values.yaml --set controller.allowSnippetAnnotations=true --version 1.1.3

but after that in SVC I can't see new port bindings

kubectl get svc
nginx-ingress-controller LoadBalancer 10.99.141.133 10.145.160.25 80:31072/TCP,443:32158/TCP 2m12s

I suppose my TCP configs not working in values.yaml

values.yaml

controller:
  name: controller
  tcp:
    6379: default/redis-service:6379
    8443: develop/payment-netcore-service:8443
  service:
    loadBalancerIP: 10.145.160.25
    ports:
      http: 80
      https: 443
      payment-netcore-service: 8443
    targetPorts:
      http: http
      https: https
      payment-netcore-service: payment-netcore-service

kubectl edit deployment nginx-ingress-control

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-ingress-controller
  namespace: default
  uid: 05d8abab-7862-469a-8b8a-357ad88b546c
  resourceVersion: '9968798'
  generation: 22
  creationTimestamp: '2024-04-02T10:57:28Z'
  labels:
    app.kubernetes.io/instance: nginx-ingress
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: nginx-ingress
    app.kubernetes.io/version: 3.4.3
    helm.sh/chart: nginx-ingress-1.1.3
    k8slens-edit-resource-version: v1
  annotations:
    deployment.kubernetes.io/revision: '22'
    meta.helm.sh/release-name: nginx-ingress
    meta.helm.sh/release-namespace: default
  managedFields:
    - manager: helm
      operation: Update
      apiVersion: apps/v1
      time: '2024-04-17T10:12:34Z'
      fieldsType: FieldsV1
      fieldsV1:
        f:metadata:
          f:annotations:
            .: {}
            f:meta.helm.sh/release-name: {}
            f:meta.helm.sh/release-namespace: {}
          f:labels:
            .: {}
            f:app.kubernetes.io/instance: {}
            f:app.kubernetes.io/managed-by: {}
            f:app.kubernetes.io/name: {}
            f:app.kubernetes.io/version: {}
            f:helm.sh/chart: {}
        f:spec:
          f:progressDeadlineSeconds: {}
          f:replicas: {}
          f:revisionHistoryLimit: {}
          f:selector: {}
          f:strategy:
            f:rollingUpdate:
              .: {}
              f:maxSurge: {}
              f:maxUnavailable: {}
            f:type: {}
          f:template:
            f:metadata:
              f:annotations:
                .: {}
                f:prometheus.io/port: {}
                f:prometheus.io/scheme: {}
                f:prometheus.io/scrape: {}
              f:labels:
                .: {}
                f:app.kubernetes.io/instance: {}
                f:app.kubernetes.io/name: {}
            f:spec:
              f:automountServiceAccountToken: {}
              f:containers:
                k:{"name":"nginx-ingress"}:
                  .: {}
                  f:args: {}
                  f:env:
                    .: {}
                    k:{"name":"POD_NAME"}:
                      .: {}
                      f:name: {}
                      f:valueFrom:
                        .: {}
                        f:fieldRef: {}
                    k:{"name":"POD_NAMESPACE"}:
                      .: {}
                      f:name: {}
                      f:valueFrom:
                        .: {}
                        f:fieldRef: {}
                  f:image: {}
                  f:imagePullPolicy: {}
                  f:name: {}
                  f:ports:
                    .: {}
                    k:{"containerPort":80,"protocol":"TCP"}:
                      .: {}
                      f:containerPort: {}
                      f:name: {}
                      f:protocol: {}
                    k:{"containerPort":443,"protocol":"TCP"}:
                      .: {}
                      f:containerPort: {}
                      f:name: {}
                      f:protocol: {}
                    k:{"containerPort":8081,"protocol":"TCP"}:
                      .: {}
                      f:containerPort: {}
                      f:name: {}
                      f:protocol: {}
                    k:{"containerPort":9113,"protocol":"TCP"}:
                      .: {}
                      f:containerPort: {}
                      f:name: {}
                      f:protocol: {}
                  f:readinessProbe:
                    .: {}
                    f:failureThreshold: {}
                    f:httpGet:
                      .: {}
                      f:path: {}
                      f:port: {}
                      f:scheme: {}
                    f:periodSeconds: {}
                    f:successThreshold: {}
                    f:timeoutSeconds: {}
                  f:resources:
                    .: {}
                    f:requests:
                      .: {}
                      f:cpu: {}
                      f:memory: {}
                  f:securityContext:
                    .: {}
                    f:allowPrivilegeEscalation: {}
                    f:capabilities:
                      .: {}
                      f:add: {}
                      f:drop: {}
                    f:readOnlyRootFilesystem: {}
                    f:runAsNonRoot: {}
                    f:runAsUser: {}
                  f:terminationMessagePath: {}
                  f:terminationMessagePolicy: {}
              f:dnsPolicy: {}
              f:restartPolicy: {}
              f:schedulerName: {}
              f:securityContext:
                .: {}
                f:seccompProfile:
                  .: {}
                  f:type: {}
              f:serviceAccount: {}
              f:serviceAccountName: {}
              f:terminationGracePeriodSeconds: {}
    - manager: node-fetch
      operation: Update
      apiVersion: apps/v1
      time: '2024-04-17T10:43:07Z'
      fieldsType: FieldsV1
      fieldsV1:
        f:metadata:
          f:labels:
            f:k8slens-edit-resource-version: {}
        f:spec:
          f:template:
            f:metadata:
              f:annotations:
                f:kubectl.kubernetes.io/restartedAt: {}
            f:spec:
              f:containers:
                k:{"name":"nginx-ingress"}:
                  f:ports:
                    k:{"containerPort":8443,"protocol":"TCP"}:
                      .: {}
                      f:containerPort: {}
                      f:hostPort: {}
                      f:protocol: {}
    - manager: kube-controller-manager
      operation: Update
      apiVersion: apps/v1
      time: '2024-04-17T10:43:09Z'
      fieldsType: FieldsV1
      fieldsV1:
        f:metadata:
          f:annotations:
            f:deployment.kubernetes.io/revision: {}
        f:status:
          f:availableReplicas: {}
          f:conditions:
            .: {}
            k:{"type":"Available"}:
              .: {}
              f:lastTransitionTime: {}
              f:lastUpdateTime: {}
              f:message: {}
              f:reason: {}
              f:status: {}
              f:type: {}
            k:{"type":"Progressing"}:
              .: {}
              f:lastTransitionTime: {}
              f:lastUpdateTime: {}
              f:message: {}
              f:reason: {}
              f:status: {}
              f:type: {}
          f:observedGeneration: {}
          f:readyReplicas: {}
          f:replicas: {}
          f:updatedReplicas: {}
      subresource: status
  selfLink: /apis/apps/v1/namespaces/default/deployments/nginx-ingress-controller
status:
  observedGeneration: 22
  replicas: 1
  updatedReplicas: 1
  readyReplicas: 1
  availableReplicas: 1
  conditions:
    - type: Available
      status: 'True'
      lastUpdateTime: '2024-04-16T09:02:09Z'
      lastTransitionTime: '2024-04-16T09:02:09Z'
      reason: MinimumReplicasAvailable
      message: Deployment has minimum availability.
    - type: Progressing
      status: 'True'
      lastUpdateTime: '2024-04-17T10:43:09Z'
      lastTransitionTime: '2024-04-17T08:44:12Z'
      reason: NewReplicaSetAvailable
      message: >-
        ReplicaSet "nginx-ingress-controller-6f75c87db4" has successfully
        progressed.
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/instance: nginx-ingress
      app.kubernetes.io/name: nginx-ingress
  template:
    metadata:
      creationTimestamp: null
      labels:
        app.kubernetes.io/instance: nginx-ingress
        app.kubernetes.io/name: nginx-ingress
      annotations:
        kubectl.kubernetes.io/restartedAt: '2024-04-17T10:42:30Z'
        prometheus.io/port: '9113'
        prometheus.io/scheme: http
        prometheus.io/scrape: 'true'
    spec:
      containers:
        - name: nginx-ingress
          image: nginx/nginx-ingress:3.4.3
          args:
            - '-nginx-plus=false'
            - '-nginx-reload-timeout=60000'
            - '-enable-app-protect=false'
            - '-enable-app-protect-dos=false'
            - '-nginx-configmaps=$(POD_NAMESPACE)/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-ingress-controller'
            - '-enable-leader-election=true'
            - '-leader-election-lock-name=nginx-ingress-leader'
            - '-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-cert-manager=false'
            - '-enable-oidc=false'
            - '-enable-external-dns=false'
            - '-default-http-listener-port=80'
            - '-default-https-listener-port=443'
            - '-ready-status=true'
            - '-ready-status-port=8081'
            - '-enable-latency-metrics=false'
            - '-ssl-dynamic-reload=true'
          ports:
            - name: http
              containerPort: 80
              protocol: TCP
            - name: https
              containerPort: 443
              protocol: TCP
            - name: prometheus
              containerPort: 9113
              protocol: TCP
            - name: readiness-port
              containerPort: 8081
              protocol: TCP
            - hostPort: 8443
              containerPort: 8443
              protocol: TCP
          env:
            - name: POD_NAMESPACE
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: metadata.namespace
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: metadata.name
          resources:
            requests:
              cpu: 100m
              memory: 128Mi
          readinessProbe:
            httpGet:
              path: /nginx-ready
              port: readiness-port
              scheme: HTTP
            timeoutSeconds: 1
            periodSeconds: 1
            successThreshold: 1
            failureThreshold: 3
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          imagePullPolicy: IfNotPresent
          securityContext:
            capabilities:
              add:
                - NET_BIND_SERVICE
              drop:
                - ALL
            runAsUser: 101
            runAsNonRoot: true
            readOnlyRootFilesystem: false
            allowPrivilegeEscalation: false
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
      dnsPolicy: ClusterFirst
      serviceAccountName: nginx-ingress
      serviceAccount: nginx-ingress
      automountServiceAccountToken: true
      securityContext:
        seccompProfile:
          type: RuntimeDefault
      schedulerName: default-scheduler
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 25%
      maxSurge: 25%
  revisionHistoryLimit: 10
  progressDeadlineSeconds: 600

from ingress-nginx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.