quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.6k stars 2.63k forks source link

quarkus-kind does not add ingress annotations #42294

Open cmarchand opened 1 month ago

cmarchand commented 1 month ago

Describe the bug

Having dependencies on quarkus-kubernetes and quarkus-kind, and defining an Ingress annotation, annotation is not present in target/kubernetes/kind.yml

Expected behavior

kind.yml should contain ingress annotation, as kubernetes.yml contains it

Actual behavior

kind.yml does not contains ingress annotation.

How to Reproduce?

  1. Add dependencies to quarkus-kubernetes and to quakus-kind :

    <dependency>
    <groupId>io.quarkus</groupId>
    <artifactId>quarkus-kubernetes</artifactId>
    </dependency>
    <dependency>
    <groupId>io.quarkus</groupId>
    <artifactId>quarkus-kind</artifactId>
    </dependency>
  2. Expose ingress and define an ingress annotation in application.properties

    quarkus.kubernetes.ingress.expose=true
    quarkus.kubernetes.ingress.annotations."nginx.ingress.kubernetes.io/rewrite-target"=/$2
  3. Build application, with mvn package

  4. Check target/kubernetes/kubernetes.xml, it contains ingress annotation

    ---
    apiVersion: networking.k8s.io/v1
    kind: Ingress
    metadata:
    annotations:
    app.quarkus.io/quarkus-version: 3.12.3
    app.quarkus.io/vcs-uri: https://git...
    nginx.ingress.kubernetes.io/rewrite-target: /$2
    labels:
  5. Check target/kubernetes/kind.xml, it does not contains ingress annotation

    ---
    apiVersion: networking.k8s.io/v1
    kind: Ingress
    metadata:
    annotations:
    app.quarkus.io/quarkus-version: 3.12.3
    app.quarkus.io/vcs-uri: https://git.clever-age.net/oxiane/gitlab-oxiane/formation/accessoires_cours/tp-quarkus-essentiel.git
    labels:

Output of uname -a or ver

Darwin paris-105.local 22.6.0 Darwin Kernel Version 22.6.0: Mon Apr 22 20:54:28 PDT 2024; root:xnu-8796.141.3.705.2~1/RELEASE_X86_64 x86_64

Output of java -version

java version "21" 2023-09-19 LTS Java(TM) SE Runtime Environment (build 21+35-LTS-2513) Java HotSpot(TM) 64-Bit Server VM (build 21+35-LTS-2513, mixed mode, sharing)

Quarkus version or git rev

3.12.3

Build tool (ie. output of mvnw --version or gradlew --version)

$ mvn -v Apache Maven 3.9.3 (21122926829f1ead511c958d89bd2f672198ae9f) Maven home: /Users/cmarchand/applications/apache-maven-3.9.3 Java version: 21, vendor: Oracle Corporation, runtime: /Users/cmarchand/applications/java/jdk-21.jdk/Contents/Home Default locale: fr_FR, platform encoding: UTF-8 OS name: "mac os x", version: "13.6.7", arch: "x86_64", family: "mac"

Additional information

No response

quarkus-bot[bot] commented 1 month ago

/cc @geoand (kubernetes), @iocanel (kubernetes)

cmarchand commented 1 month ago

It seems that other properties are not processed either ; if I add

quarkus.kubernetes.ingress.rules.1.host=localhost
quarkus.kubernetes.ingress.rules.1.path=/game(/|$)(.*)
quarkus.kubernetes.ingress.rules.1.path-type=ImplementationSpecific

kubernetes.yml contains the second rule :

spec:
  rules:
    - http:
        paths:
          - backend:
              service:
                name: guess-game
                port:
                  name: http
            path: /game(/|$)(.*)
            pathType: Prefix
    - host: localhost
      http:
        paths:
          - backend:
              service:
                name: guess-game
                port:
                  name: http
            path: /game(/|$)(.*)
            pathType: ImplementationSpecific

But kind.yml does not contain it :

spec:
  rules:
    - http:
        paths:
          - backend:
              service:
                name: guess-game
                port:
                  name: http
            path: /game(/|$)(.*)
            pathType: Prefix