<p>I am recently new to Kubernetes and Docker in general and am experiencing issues.</p>
<p>I am running a single local Kubernetes cluster via Docker and am using skaffold to control the build up and teardown of objects within the cluster. When I run <code>skaffold dev</code> the build seems successful, yet when I attempt to make a request to my cluster via Postman the request hangs. I am using an ingress-nginx controller and I feel the bug lies somewhere here. My request handling logic is simple and so I feel the issue is not in the route handling but the configuration of my cluster, specifically with the ingress controller. I will post below my skaffold yaml config and my ingress yaml config.</p>
<p>Any help is greatly appreciated as I have struggled with this bug for sometime.</p>
<p>ingress yaml config :</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-service
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/use-regex: 'true'
spec:
  rules:
    - host: ticketing.dev
      http:
        paths:
          - path: /api/users/?(.*)
            pathType: Prefix
            backend:
              service:
                name: auth-srv
                port:
                  number: 3000
</code></pre>
<p>Note that I have a redirect in my /etc/hosts file from ticketing.dev to 127.0.0.1</p>
<p>Auth service yaml config :</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: auth-depl
spec:
  replicas: 1
  selector:
    matchLabels:
      app: auth
  template:
    metadata:
      labels:
        app: auth
    spec:
      containers:
        - name: auth
          image: conorl47/auth
---

kind: Service
metadata:
  name: auth-srv
spec:
  selector:
    app: auth
  ports:
    - name: auth
      protocol: TCP
      port: 3000
      targetPort: 3000
</code></pre>
<p>skaffold yaml config :</p>
<pre><code>apiVersion: skaffold/v2alpha3
kind: Config
deploy:
  kubectl:
    manifests:
      - ./infra/k8s/*
build:
  local:
    push: false
  artifacts:
    - image: conorl47/auth
      context: auth
      docker:
        dockerfile: Dockerfile
      sync:
        manual:
          - src: 'src/**/*.ts'
            dest: .
</code></pre>
<p>For installing the ingress nginx controller I followed the installation instructions at <a href="https://kubernetes.github.io/ingress-nginx/deploy/" rel="nofollow noreferrer">https://kubernetes.github.io/ingress-nginx/deploy/</a> , namely the Docker desktop installation instruction.</p>
<p>After running that command I see the following two Docker containers running in Docker desktop</p>
<p><a href="https://i.stack.imgur.com/nBnqv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nBnqv.png" alt="enter image description here" /></a></p>
<p>The two services created in the ingress-nginx namespace are :</p>
<pre><code>❯ k get services -n ingress-nginx
NAME                                 TYPE           CLUSTER-IP     EXTERNAL-IP   PORT(S)                      AGE
ingress-nginx-controller             LoadBalancer   10.103.6.146   &lt;pending&gt;     80:30036/TCP,443:30465/TCP   22m
ingress-nginx-controller-admission   ClusterIP      10.108.8.26    &lt;none&gt;        443/TCP                      22m
</code></pre>
<p>When I kubectl describe both of these services I see the following :</p>
<pre><code>❯ kubectl describe service ingress-nginx-controller -n ingress-nginx
Name:                     ingress-nginx-controller
Namespace:                ingress-nginx
Labels:                   app.kubernetes.io/component=controller
                          app.kubernetes.io/instance=ingress-nginx
                          app.kubernetes.io/managed-by=Helm
                          app.kubernetes.io/name=ingress-nginx
                          app.kubernetes.io/version=1.0.0
                          helm.sh/chart=ingress-nginx-4.0.1
Annotations:              &lt;none&gt;
Selector:                 app.kubernetes.io/component=controller,app.kubernetes.io/instance=ingress-nginx,app.kubernetes.io/name=ingress-nginx
Type:                     LoadBalancer
IP Family Policy:         SingleStack
IP Families:              IPv4
IP:                       10.103.6.146
IPs:                      10.103.6.146
Port:                     http  80/TCP
TargetPort:               http/TCP
NodePort:                 http  30036/TCP
Endpoints:                10.1.0.10:80
Port:                     https  443/TCP
TargetPort:               https/TCP
NodePort:                 https  30465/TCP
Endpoints:                10.1.0.10:443
Session Affinity:         None
External Traffic Policy:  Local
HealthCheck NodePort:     32485
Events:                   &lt;none&gt;
</code></pre>
<p>and :</p>
<pre><code>❯ kubectl describe service ingress-nginx-controller-admission -n ingress-nginx
Name:              ingress-nginx-controller-admission
Namespace:         ingress-nginx
Labels:            app.kubernetes.io/component=controller
                   app.kubernetes.io/instance=ingress-nginx
                   app.kubernetes.io/managed-by=Helm
                   app.kubernetes.io/name=ingress-nginx
                   app.kubernetes.io/version=1.0.0
                   helm.sh/chart=ingress-nginx-4.0.1
Annotations:       &lt;none&gt;
Selector:          app.kubernetes.io/component=controller,app.kubernetes.io/instance=ingress-nginx,app.kubernetes.io/name=ingress-nginx
Type:              ClusterIP
IP Family Policy:  SingleStack
IP Families:       IPv4
IP:                10.108.8.26
IPs:               10.108.8.26
Port:              https-webhook  443/TCP
TargetPort:        webhook/TCP
Endpoints:         10.1.0.10:8443
Session Affinity:  None
Events:            &lt;none&gt;
</code></pre>

<p>As it seems, you have made the ingress service of type <a href="https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer" rel="nofollow noreferrer">LoadBalancer</a>, this will usually provision an external loadbalancer from your cloud provider of choice. That's also why It's still pending. Its waiting for the loadbalancer to be ready, but it will never happen.</p>
<p>If you want to have that ingress service reachable outside your cluster, you need to use type <a href="https://kubernetes.io/docs/concepts/services-networking/service/#nodeport" rel="nofollow noreferrer">NodePort</a>.</p>
<p>Since their docs are not great on this point, and it seems to be by default like this. You could download the content of <a href="https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.0.0/deploy/static/provider/cloud/deploy.yaml" rel="nofollow noreferrer">https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.0.0/deploy/static/provider/cloud/deploy.yaml</a> and modify it before applying. Or you use <code>helm</code>, then you probably can configure this.</p>
<p>You could also do it in this dirty fashion.</p>
<pre class="lang-sh prettyprint-override"><code>kubectl apply --dry-run=client -o yaml -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.0.0/deploy/static/provider/cloud/deploy.yaml \
  | sed s/LoadBalancer/NodePort/g \
  | kubectl apply -f -
</code></pre>
<p>You could also edit in place.</p>
<pre class="lang-sh prettyprint-override"><code>kubectl edit svc ingress-nginx-controller-admission -n ingress-nginx
</code></pre>
