<p>I have a Micronaut Application with the controller class like this:</p>
<pre><code>@Controller(&quot;/murugesso&quot;)
public class Server {

  @Get(&quot;debug/loadVins&quot;)
  public MutableHttpResponse&lt;String&gt; loadVins(HttpRequest&lt;?&gt; request) {

    new VinLoader().load();
    return HttpResponse.ok().body(&quot;VIN load in progress...&quot;);
  }
}
</code></pre>
<p>Kubernetest manifest looks like this:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: murugesso
  labels:
    app: murugesso
spec:
  selector:
    matchLabels:
      app: murugesso
  template:
    metadata:
      labels:
        app: murugesso
    spec:
      containers:
        - name: murugesso
          image: murugesso:latest&quot;
          imagePullPolicy: IfNotPresent
          ports:
            - containerPort: 8080
              name: murugesso
              hostPort: 8080
</code></pre>
<p>When I run the app locally (through IDE or JAR), the following URL works:
<code>http://localhost:8080/murugesso/debug/loadVins</code></p>
<p>But when I deploy the same application to kubernetes, I get a Micronaut error saying the URL was not found like this:</p>
<pre><code>{&quot;message&quot;:&quot;Page Not Found&quot;,&quot;_links&quot;:{&quot;self&quot;:{&quot;href&quot;:&quot;/murugesso/debug/loadVins&quot;,&quot;templated&quot;:false}}}
</code></pre>
<p>I have checked that I am using the same URL and also that the error is a Micronaut error, not kubernetes or network error.</p>
<p>EDIT: I checked the <code>/routes</code> endpoint and it looks like none of the routes defined in my controller show up. Why is Micronaut not recognizing any of them? (Again, I've tried deploying the same image on minikube and it works perfectly!)</p>

ritratt
<p>I assume that you use no reverse proxy or <code>Ingress</code> that might rewrite your path which could result in this error.</p>
<p>Based on the limited information my hypothesis is that you added the controller / path in a later stage of the application and rebuild the image. Kubernetes would check if a newer image is available since the image tag is <code>:latest</code> when creating a new <code>Pod</code>.</p>
<p>But you configured that the node should not check for newer images, if an image with matching tag is already present through the <code>imagePullPolicy: IfNotPresent</code> configuration.</p>
<p>If this is indeed the problem I suggest to either use unique image tags (f.e. git commit hash) or change the <code>imagePullPolicy</code> to <code>Always</code> so you get the latest image version as of the point in time the pod is created.</p>
