Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quarkus-kubernetes generated Ingress broken in 2.0.0.CR3 #362

Closed
snowdrop-bot opened this issue Jun 19, 2021 · 0 comments
Closed

quarkus-kubernetes generated Ingress broken in 2.0.0.CR3 #362

snowdrop-bot opened this issue Jun 19, 2021 · 0 comments
Assignees
Labels
7 - Community development upstream/closed The issue has been closed in the upstream repository

Comments

@snowdrop-bot
Copy link
Collaborator

Describe the bug

When using the quarkus-kubernetes extension, the generation of the Ingress when quarkus.kubernetes.ingress.expose=true is broken in 2.0.0.CR3. It works fine in 1.13.7.Final.

To Reproduce

I'm attaching a reproducer project which was created using the Quarkus Kubernetes Guide. When running ./mvnw clean package with the reproducer project, the Ingress that gets generated inside target/kubernetes/kubernetes.yml looks like

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    app.quarkus.io/build-timestamp: 2021-06-18 - 12:51:06 +0000
  labels:
    app.kubernetes.io/name: kubernetes-quickstart
    app.kubernetes.io/version: 1.0.0-SNAPSHOT
  name: kubernetes-quickstart
spec:
  rules:
    - http:
        paths:
          - backend:
              service:
                name: kubernetes-quickstart
                port:
                  name: http
            pathType: Prefix
    - http:
        paths:
          - backend:
              service:
                name: kubernetes-quickstart
                port:
                  name: http
            pathType: Prefix

When trying to deploy this to OpenShift/Kubernetes (via kubectl apply -f target/kubernetes/kubernetes.yml), this error is encountered:

$ kubectl apply -f target/kubernetes/kubernetes.yml
service/kubernetes-quickstart created
deployment.apps/kubernetes-quickstart created
The Ingress "kubernetes-quickstart" is invalid: 
* spec.rules[0].http.paths[0].path: Invalid value: "": must be an absolute path
* spec.rules[1].http.paths[0].path: Invalid value: "": must be an absolute path

When switching the project back to Quarkus version 1.13.7.Final and re-running ./mvnw clean package, the generated Ingress looks like

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    app.quarkus.io/build-timestamp: 2021-06-18 - 13:00:47 +0000
  labels:
    app.kubernetes.io/name: kubernetes-quickstart
    app.kubernetes.io/version: 1.0.0-SNAPSHOT
  name: kubernetes-quickstart
spec:
  rules:
  - host: ""
    http:
      paths:
      - backend:
          serviceName: kubernetes-quickstart
          servicePort: 8080
        path: /

It applies fine.

If I then add a value in the quarkus.kubernetes.ingress.host property, in 2.0.0.CR3 the Ingress looks like

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    app.quarkus.io/build-timestamp: 2021-06-18 - 13:08:27 +0000
  labels:
    app.kubernetes.io/name: kubernetes-quickstart
    app.kubernetes.io/version: 1.0.0-SNAPSHOT
  name: kubernetes-quickstart
spec:
  rules:
    - host: kubernetes-quickstart
      http:
        paths:
          - backend:
              service:
                name: kubernetes-quickstart
                port:
                  name: http
            pathType: Prefix
          - backend:
              service:
                name: kubernetes-quickstart
                port:
                  name: http

which is still invalid when trying to apply it:

$ kubectl apply -f target/kubernetes/kubernetes.yml 
service/kubernetes-quickstart created
deployment.apps/kubernetes-quickstart created
The Ingress "kubernetes-quickstart" is invalid: 
* spec.rules[0].http.paths[0].path: Invalid value: "": must be an absolute path
* spec.rules[0].http.paths[1].pathType: Required value: pathType must be specified

Reproducer project:
kubernetes-quickstart.zip

Configuration

# Add your application.properties here, if applicable.
quarkus.kubernetes.ingress.expose=true
quarkus.container-image.registry=quay.io
quarkus.container-image.group=edeandrea
quarkus.container-image.build=true

Environment (please complete the following information):

Output of uname -a or ver

Darwin edeandre-mac 20.5.0 Darwin Kernel Version 20.5.0: Sat May  8 05:10:33 PDT 2021; root:xnu-7195.121.3~9/RELEASE_X86_64 x86_64

Output of java -version

openjdk version "11.0.2" 2019-01-15
OpenJDK Runtime Environment 18.9 (build 11.0.2+9)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)

Quarkus version or git rev

1.13.7.Final vs 2.0.0.CR3

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

Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d)
Maven home: /Users/edeandre/.m2/wrapper/dists/apache-maven-3.8.1-bin/2l5mhf2pq2clrde7f7qp1rdt5m/apache-maven-3.8.1
Java version: 11.0.2, vendor: Oracle Corporation, runtime: /Users/edeandre/.sdkman/candidates/java/11.0.2-open
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.16", arch: "x86_64", family: "mac"

quarkusio#18007


$upstream:18007$

@snowdrop-bot snowdrop-bot added the upstream/closed The issue has been closed in the upstream repository label Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
7 - Community development upstream/closed The issue has been closed in the upstream repository
Projects
None yet
Development

No branches or pull requests

2 participants