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

Kubernetes resources get duplicated then trying to use existing resources in src/main/kubernetes #10641

Closed
zellerr opened this issue Jul 10, 2020 · 3 comments · Fixed by #10657
Labels
area/kubernetes kind/bug Something isn't working
Milestone

Comments

@zellerr
Copy link

zellerr commented Jul 10, 2020

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

@zellerr zellerr added the kind/bug Something isn't working label Jul 10, 2020
@quarkusbot
Copy link

/cc @geoand

@geoand
Copy link
Contributor

geoand commented Jul 10, 2020

cc @iocanel

@iocanel
Copy link
Contributor

iocanel commented Jul 10, 2020

Will have a look at it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kubernetes kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants