Ingress giving 503 error

Cluster information:

Kubernetes version:
Cloud being used: bare-metal
Installation method: helm
Host OS: CentOS 7.9
CNI and version: Calico
CRI and version: docker://20.10.13

I’m trying to expose an application via a service and ingress, and have the following yaml:

apiVersion: v1
kind: Service
  name: api-gateway 
  namespace: namespace-here 
  - name: http 
    port: 6764 
    protocol: TCP
    targetPort: http
  selector: api-gateway instance-here app-here 
  type: NodePort

A describe of the service is as follows:

Name:                     api-gateway
Namespace:                namespace-here 
Labels:                   <none>
Selector:       ,,
Type:                     NodePort
IP Family Policy:         SingleStack
IP Families:              IPv4
IP:                       x.y.z.190
IPs:                      x.y.z.190
Port:                     http  6764/TCP
TargetPort:               http/TCP
NodePort:                 http  32458/TCP
Endpoints:                <none>
Session Affinity:         None
External Traffic Policy:  Cluster
Events:                   <none>

So, I realize there should be endpoints listed, but I’m not sure why they’re not, as the fields in the selector match those of the pods, so that I do see the expected pod when I run the command here:

% k get pods -l,,
NAME                              READY   STATUS    RESTARTS   AGE
api-gateway-5b788dc6d6-hk5h9      1/1     Running   0          92m

I can also use k9s to forward the port for both this pod and this service to localhost:6764, and access the expected webpage.

So, while the page at Debug Services | Kubernetes says I should have endpoints listed (i.e. not None), I’m not so sure this is valid. Given this, it would seem to me that the pod and service are working OK.

I have the following ingress yaml that references the above service, along with the describe output of the ingress implemented with that yaml:

kind: Ingress
  name: api-ingress
  namespace: namespace-here 
  ingressClassName: nginx
  - host: fqdn-of-hostname-here 
      - backend:
            name: api-gateway 
              number: 6764 
        path: /
        pathType: ImplementationSpecific
  - hosts:
    - fqdn-of-hostname-here

%  k describe ing -n namespace-here
Name:             api-ingress
Labels:           <none>
Namespace:        namespace-here
Address:          ip-address-removed 
Ingress Class:    nginx
Default backend:  <default>
  SNI routes fqdn-of-ingress-here
  Host                  Path  Backends
  ----                  ----  --------
                        /   api-gateway:6764 (<none>)
  Type    Reason  Age                    From                      Message
  ----    ------  ----                   ----                      -------
  Normal  Sync    2m51s (x3 over 2m56s)  nginx-ingress-controller  Scheduled for sync
  Normal  Sync    2m51s (x3 over 2m56s)  nginx-ingress-controller  Scheduled for sync

There are no network policies defined in this namespace.

From what I can tell, everything is set up properly. Yet, I’m still seeing a HTTP 503 error when I try to access https://fqdn-of-ingress-here. Any thoughts as to why?

Resolved, had the port (should have been 80) and targetPort (should have been 6764) switched.