Quarkus: Kubernetes resources get duplicated then trying to use existing resources in src/main/kubernetes

Created on 10 Jul 2020  路  3Comments  路  Source: quarkusio/quarkus

Describe the bug
I'm trying to customise the generated Kubernetes resources of the Kubernetes extension by providing base resources.

From the documentation I understand that if the custom resource has the same name like the generated one it will be merged together into one resource.
However, I find the resource duplicated instead.

Not sure if something is wrong or if I have an error in reasoning.
Can someone shed some light please?

To Reproduce

  1. Create new project from Archetype "kubernetes-quickstart" (like documented here: https://quarkus.io/guides/deploying-to-kubernetes)
  2. Add a kubernetes.yaml to "src/main/kubernetes" with the following content:
apiVersion: v1
kind: Namespace
metadata:
  name: quickstart
---
apiVersion: v1
kind: Service
metadata:
  name: kubernetes-quickstart
  namespace: quickstart
  1. Run Maven build: mvn package

Expected behavior
Generated Kubernetes resources contains one Service kind that contains the amended namespace

---
apiVersion: v1
kind: Service
metadata:
  annotations:
    app.quarkus.io/build-timestamp: 2020-07-10 - 11:17:13 +0000
  labels:
    app.kubernetes.io/name: kubernetes-quickstart
    app.kubernetes.io/version: 1.0-SNAPSHOT
  name: kubernetes-quickstart
  namespace: quickstart
spec:
  ports:
  - name: http
    port: 8080
    targetPort: 8080
  selector:
    app.kubernetes.io/name: kubernetes-quickstart
    app.kubernetes.io/version: 1.0-SNAPSHOT
  type: ClusterIP
---

Actual behavior
Generated Kubernetes resources contains two Service kinds with the same name (existing one + generated one)

apiVersion: v1
kind: Service
metadata:
  annotations:
    app.quarkus.io/build-timestamp: 2020-07-10 - 11:17:13 +0000
  name: kubernetes-quickstart
  namespace: quickstart
---
apiVersion: v1
kind: Service
metadata:
  annotations:
    app.quarkus.io/build-timestamp: 2020-07-10 - 11:17:13 +0000
  labels:
    app.kubernetes.io/name: kubernetes-quickstart
    app.kubernetes.io/version: 1.0-SNAPSHOT
  name: kubernetes-quickstart
spec:
  ports:
  - name: http
    port: 8080
    targetPort: 8080
  selector:
    app.kubernetes.io/name: kubernetes-quickstart
    app.kubernetes.io/version: 1.0-SNAPSHOT
  type: ClusterIP
---

Environment:
Quarkus Version: 1.6.0.Final
Maven Verson: 3.6.3

arekubernetes kinbug

Most helpful comment

Will have a look at it.

All 3 comments

/cc @geoand

cc @iocanel

Will have a look at it.

Was this page helpful?
0 / 5 - 0 ratings