<p>I'm running kuberenetes in localhost, the pod is running and I can access the services when I port forwarding:</p>
<pre><code>kubectl port-forward svc/my-service 8080:8080
</code></pre>
<p>I can get/post etc. the services in localhost.</p>
<p>I'm trying to use it with ingress to access it, here is the yml file:</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
    name: my-ingress
spec:
    ingressClassName: nginx
    rules:
    - http:
        paths:
        - path: /
          pathType: Prefix
          backend:
              service:
                  name: my-service
                  port:
                      number: 8080
</code></pre>
<p>I've also installed the ingress controller. But it isn't working as expected. Anything wrong with this?</p>
<p>EDIT: the service that Im trying to connect with ingress:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
    name: my-service
    labels:
        app: my-service
spec:
    replicas: 1
    selector:
        matchLabels:
            app: my-service
    template:
        metadata:
            labels: my-service
                app: my-service
        spec:
            containers:
            - image: test/my-service:0.0.1-SNAPSHOT
              name: my-service
              ports:
                  - containerPort:8080
       ... other spring boot override properties

---

apiVersion: v1
kind: Service
metadata:
    name: my-service
    labels:
        app: my-service
spec:
    type: ClusterIP
    selector:
        app: my-service
    ports:
    - name: 8080-8080
      port: 8080
      protocol: TCP
      targetPort: 8080
</code></pre>
<p>service is working by itself though</p>
<p>EDIT:</p>
<p>It worked when I used <strong>https</strong> instead of <strong>http</strong></p>

askwer
<p>Is ingress resource in the same namespace as the service? Can you share the manifest of service? Also, what do logs of nginx ingress-controller show and what sort of error do you face when hitting the endpoint in the browser?</p>
<p>Ingress's YAML file looks OK to me BTW.</p>
