snowdrop-zen / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
1 stars 0 forks source link

Kubernetes extension drops Ingress (k8s 1.19 GA) manifest content #388

Closed snowdrop-bot closed 3 years ago

snowdrop-bot commented 3 years ago

Describe the bug Kubernetes extension permits existing resources in src/main/kubernetes/kubernetes.yml to be merged into the build output, combined with the service and deployment resources.

I have updated the ingress specification from apiVersion: extensions/v1beta1 to apiVersion: networking.k8s.io/v1 which went GA in Kubernetes v1.19. It works fine on the v1beta1 legacy version.

https://kubernetes.io/docs/concepts/services-networking/ingress/

Expected behavior Additional resource, should be left untouched

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: alb-ingress
  namespace: demo
  annotations:
    kubernetes.io/ingress.class: alb
    alb.ingress.kubernetes.io/scheme: internet-facing
    alb.ingress.kubernetes.io/target-type: ip
    alb.ingress.kubernetes.io/listen-ports: '[{"HTTPS":443}]'
  labels:
    app: alb-ingress
spec:
  rules:
    - host: example.com
      http:
        paths:
          - path: /*
            pathType: Prefix
            backend:
              service:
                name: myservice
                port:
                  number: 8080

Actual behavior The service details gets dropped and is replaced by {}, which results in an error when applying the manifest.

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: alb
    alb.ingress.kubernetes.io/scheme: internet-facing
    alb.ingress.kubernetes.io/target-type: ip
    alb.ingress.kubernetes.io/listen-ports: '[{"HTTPS":443}]'
  labels:
    app: alb-ingress
  name: alb-ingress
  namespace: demo
spec:
  rules:
  - host: example.com
    http:
      paths:
      - backend: {}
        path: /*
        pathType: Prefix

To Reproduce

Link to a small reproducer (preferably a Maven project if the issue is not Gradle-specific).

Or attach an archive containing the reproducer to the issue.

Steps to reproduce the behavior:

  1. Add above Ingress to your src/main/kubernetes/kubernetes.yml
  2. Build, and view generated Kubernetes.yml will look as above

Environment (please complete the following information):

Additional context Legacy Beta Ingress specification works ok

/cc @geoand


https://github.com/quarkusio/quarkus/issues/15430


$upstream:15430$