<p>I have installed Ingress and linked my service to it (usign metallb).</p>
<pre><code>apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: test-ingress
  annotations:
     nginx.ingress.kubernetes.io/rewrite-target: /
spec:
   rules:
   - http:
       paths:
       - path: /api/tasks/*
         # pathType: Exact
         backend:
           serviceName: tasks-service
           servicePort: 5004
</code></pre>
<p>The thing is this, I set up the default prefix of the paths in the deployment to be</p>
<blockquote>
<p>/api/tasks/</p>
</blockquote>
<p>where <code>/api/tasks/tasks</code> shows the service is up while <code>/api/tasks/tasks_count</code> gives the total number. However in my k8s cluster, I cannot redirect to the different paths within the service. What could be the problem?</p>

Denn
<p>Since this is a result in Google for wildcards and prefixes, I'll answer this old question.</p>
<p>The functionality you're looking for comes from <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/#path-types" rel="nofollow noreferrer">specifying the path type</a> as <code>pathType: Prefix</code></p>
<pre><code>       paths:
       - path: /api/tasks
         pathType: Prefix
         backend:
           serviceName: tasks-service
           servicePort: 5004
</code></pre>
<p>Importantly, the path doesn't contain a wildcard character.  In fact, cloud providers like AWS will throw errors if you're using their <a href="https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.3/" rel="nofollow noreferrer">custom load balancer provisioners</a> for Ingress resources:</p>
<pre><code>prefix path shouldn't contain wildcards
</code></pre>
