<p>I was set kubernetes resource in application.properties</p>
<pre><code># Ingress
quarkus.kubernetes.expose=true
# service will be exposed
quarkus.kubernetes.ingress.expose=true
quarkus.kubernetes.ingress.host=k8s.cch.dev
quarkus.kubernetes.ingress.annotations.&quot;nginx.ingress.kubernetes.io/rewrite-target&quot;=/$2
# quarkus.kubernetes.ingress.tls.${SECRET_NAME}.enabled=true
# quarkus.kubernetes.ingress.tls.${SECRET_NAME}.hosts=k8s.cch.dev
quarkus.kubernetes.ingress.rules.0.host=k8s.cch.dev
quarkus.kubernetes.ingress.rules.0.path=/api/v1(/|$)(.*)
quarkus.kubernetes.ingress.rules.0.path-type=Prefix
quarkus.kubernetes.ingress.rules.0.service-name=${quarkus.container-image.name}
quarkus.kubernetes.ingress.rules.0.service-port-name=http
quarkus.kubernetes.ingress.rules.0.service-port-number=${quarkus.kubernetes.ports.http.container-port:quarkus.http.port}

quarkus.kubernetes.ports.http.container-port=8080
quarkus.kubernetes.ports.http.path=/
quarkus.kubernetes.ports.http.protocol=tcp

</code></pre>
<p>But ingress can't override default <code>path: /</code>.</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    app.quarkus.io/commit-id: dbe06014c4986c544ed25fba97f96ac2cecc4091
    app.quarkus.io/build-timestamp: 2022-12-12 - 02:20:45 +0000
    nginx.ingress.kubernetes.io/rewrite-target: /$2
  labels:
    app.kubernetes.io/name: kubernetes-with-quarkus
    app.kubernetes.io/part-of: kubernetes-with-quarkus
    app.kubernetes.io/version: 1.0.0-SNAPSHOT
  name: kubernetes-with-quarkus
  namespace: prod
spec:
  rules:
    - host: k8s.cch.dev
      http:
        paths:
          - backend:
              service:
                name: kubernetes-with-quarkus
                port:
                  name: http
            path: /
            pathType: Prefix
          - backend:
              service:
                name: kubernetes-with-quarkus
                port:
                  name: http
            path: /api/v1(/|$)(.*)
            pathType: Prefix
</code></pre>
<p>How to change <code>spec.ports.port</code> to 8080 ? I could't find the configuration on kubernetes extension.</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  annotations:
    app.quarkus.io/commit-id: dbe06014c4986c544ed25fba97f96ac2cecc4091
    app.quarkus.io/build-timestamp: 2022-12-12 - 02:20:45 +0000
    prometheus.io/scrape: &quot;true&quot;
    prometheus.io/path: /q/metrics
    prometheus.io/port: &quot;8080&quot;
    prometheus.io/scheme: http
  labels:
    app.kubernetes.io/name: kubernetes-with-quarkus
    app.kubernetes.io/part-of: kubernetes-with-quarkus
    app.kubernetes.io/version: 1.0.0-SNAPSHOT
  name: kubernetes-with-quarkus
  namespace: prod
spec:
  ports:
    - name: http
      port: 80
      protocol: TCP
      targetPort: 8080
  selector:
    app.kubernetes.io/name: kubernetes-with-quarkus
    app.kubernetes.io/part-of: kubernetes-with-quarkus
    app.kubernetes.io/version: 1.0.0-SNAPSHOT
  type: ClusterIP
</code></pre>

CHI-HONG CHEN
<p>Your configuration is adding to Ingress rules, because you're specifying two paths:</p>
<pre><code># ...
quarkus.kubernetes.ingress.rules.0.path=/api/v1(/|$)(.*)
# ...
quarkus.kubernetes.ports.http.path=/
</code></pre>
<p>Quarkus will try to find a matching ingress rule with path &quot;/api/v1(/|$)(.*)&quot; and if it can't find any, it will add a new one.</p>
<p>Instead, if what you want is to override the default path and service port, you simply need to add these two properties:</p>
<pre><code>quarkus.kubernetes.ports.http.host-port=&lt;any other port&gt;
quarkus.kubernetes.ports.http.path=/api/v1(/|$)(.*)
</code></pre>
<p>Then, if you want to change the generated ingress rule, use:</p>
<pre><code>quarkus.kubernetes.ingress.rules.0.path=/api/v1(/|$)(.*)
quarkus.kubernetes.ingress.rules.0.host or path-type or other ingress rule configuration
</code></pre>
<p>Because the properties <code>quarkus.kubernetes.ports...</code> are not very intuitive in regards to how are related to the generated Ingress resource, there are already plans to improve it: <a href="https://github.com/quarkusio/quarkus/issues/29279" rel="nofollow noreferrer">https://github.com/quarkusio/quarkus/issues/29279</a></p>
