Answers: <p>As per your ingress configuration, the ingress object is listening to pm.mycompany.com and it will route traffic to the service.</p>
  <p>Apart from this you need to have ingress controller running in the cluster.
  You would also need a DNS record as pm.mycompany.com to point to the Node of the node where this service pods are running.</p>
  <p>Once this thing is done, you should be able to ping pm.mycompany.com:8443.</p>
  <p>Please read more about ingress here:  <a href="https://k21academy.com/docker-kubernetes/kubernetes-ingress-controllers/" rel="nofollow noreferrer">https://k21academy.com/docker-kubernetes/kubernetes-ingress-controllers/</a></p>
  
Answers: CC BY-SA 4.0
Answers: 2024-04-17T07:08:02.987Z
Answers: 2024-04-17T07:08:02.987Z
Answers: Pankaj Pal
Body: <p>Guys I'm trying to make my service accessable by domain_name with port ex: <code>mycompany.com:8443</code>
  Is this possible? or any alternative ways to do?</p>
  <p>But my ingress service not listening port and my service not available on <code>mycompany.com:8443</code> but it's acceessable on <code>mycompany.com</code></p>
  <p>I did't change anything on Ingress its default ingress installed.</p>
  <p>Here is my SVC and Ingress rule</p>
  <pre><code>apiVersion: v1
  kind: Service
  metadata:
    name: payment-netcore-service
    namespace: develop
  spec:
    selector:
      app: payment-netcore
    ports:
      - name: http
      #- protocol: TCP
        port: 8443
        targetPort: 8443
    type: NodePort
  
  ---
  apiVersion: networking.k8s.io/v1
  kind: Ingress
  metadata:
    name: payment-netcore-ingress
    annotations:
      kubernetes.io/ingress.class: &quot;nginx&quot;
  
  spec:
    tls:
    - hosts:
      - pm.mycompany.com
      secretName: ssl-for-develop
    rules:
    - host: pm.mycompany.com
      http:
        paths:
        - path: /
          pathType: Prefix
          backend:
            service:
              name: payment-netcore-service
              port:
                number: 8443
    - host: &quot;www.pm.mycompany.com&quot;
      http:
        paths:
        - path: /
          pathType: Prefix
          backend:
            service:
              name: payment-netcore-service
              port:
                number: 8443
  </code></pre>
  
Tags: <kubernetes><ingress-nginx>
Title: NGINX ingress not listening custom port
UserDisplayName: Breaking News
ThreadText: # NGINX ingress not listening custom port
  
  (Asked by: username_0 on 2024-04-15)
  
  Guys I'm trying to make my service accessable by domain\_name with port ex: `mycompany.com:8443`
  Is this possible? or any alternative ways to do?
  
  But my ingress service not listening port and my service not available on `mycompany.com:8443` but it's acceessable on `mycompany.com`
  
  I did't change anything on Ingress its default ingress installed.
  
  Here is my SVC and Ingress rule
  
  ```
  apiVersion: v1
  kind: Service
  metadata:
    name: payment-netcore-service
    namespace: develop
  spec:
    selector:
      app: payment-netcore
    ports:
      - name: http
      #- protocol: TCP
        port: 8443
        targetPort: 8443
    type: NodePort
  
  ---
  apiVersion: networking.k8s.io/v1
  kind: Ingress
  metadata:
    name: payment-netcore-ingress
    annotations:
      kubernetes.io/ingress.class: "nginx"
  
  spec:
    tls:
    - hosts:
      - pm.mycompany.com
      secretName: ssl-for-develop
    rules:
    - host: pm.mycompany.com
      http:
        paths:
        - path: /
          pathType: Prefix
          backend:
            service:
              name: payment-netcore-service
              port:
                number: 8443
    - host: "www.pm.mycompany.com"
      http:
        paths:
        - path: /
          pathType: Prefix
          backend:
            service:
              name: payment-netcore-service
              port:
                number: 8443
  
  ```
  
  **Tags:** kubernetes, ingress-nginx
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2024-04-17. Score: 0
  
  As per your ingress configuration, the ingress object is listening to pm.mycompany.com and it will route traffic to the service.
  
  Apart from this you need to have ingress controller running in the cluster.
  You would also need a DNS record as pm.mycompany.com to point to the Node of the node where this service pods are running.
  
  Once this thing is done, you should be able to ping pm.mycompany.com:8443.
  
  Please read more about ingress here: <https://k21academy.com/docker-kubernetes/kubernetes-ingress-controllers/>
  
  
  ---
  
  