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 extension generating knative resources with existing resources broken #29962

Closed
edeandrea opened this issue Dec 19, 2022 · 3 comments · Fixed by #30006
Closed

Kubernetes extension generating knative resources with existing resources broken #29962

edeandrea opened this issue Dec 19, 2022 · 3 comments · Fixed by #30006
Assignees
Labels
area/kubernetes kind/bug Something isn't working
Milestone

Comments

@edeandrea
Copy link
Contributor

edeandrea commented Dec 19, 2022

Describe the bug

When using the quarkus-kubernetes extension with quarkus.kubernetes.deployment-target=knative, existing resources that may exist in src/main/resources/kubernetes/knative.yml get "munged".

Expected behavior

I would expect anything in src/main/resources/kubernetes/knative.yml when running ./mvnw package to be in the resulting target/kubernetes/knative.yml as-is.

Actual behavior

Certain attributes in src/main/kubernetes/knative.yml are getting munged, specifically spec.template.spec.containers[0].livenessProbe.httpGet.port and spec.template.spec.containers[0].readinessProbe.httpGet.port.

How to Reproduce?

Reproducer:
quarkus-knative-extension-problem.zip

  1. Unzip the reproducer
  2. cd quarkus-knative-extension-problem
  3. Examine src/main/kubernetes/knative.yml

    Notice the spec.template.spec.containers[0].livenessProbe.httpGet.port and spec.template.spec.containers[0].readinessProbe.httpGet.port have the value 8080.

  4. Run the following command: ./mvnw clean package -DskipTests
  5. Examine the output in target/kubernetes/knative.yml

    Find the Deployment for apicurio and notice the spec.template.spec.containers[0].livenessProbe.httpGet.port and spec.template.spec.containers[0].readinessProbe.httpGet.port have the value null.

Because of the null value, if I then tried to deploy the resulting yaml I would get errors, something like

Error from server (Invalid): error when creating "https://raw.githubusercontent.com/quarkusio/quarkus-super-heroes/main/deploy/k8s/java17-knative.yml": Deployment.apps "apicurio" is invalid: [spec.template.spec.containers[0].livenessProbe.httpGet.port: Invalid value: 0: must be between 1 and 65535, inclusive, spec.template.spec.containers[0].readinessProbe.httpGet.port: Invalid value: 0: must be between 1 and 65535, inclusive]
Error from server (Invalid): error when creating "https://raw.githubusercontent.com/quarkusio/quarkus-super-heroes/main/deploy/k8s/java17-knative.yml": Deployment.apps "apicurio" is invalid: [spec.template.spec.containers[0].livenessProbe.httpGet.port: Invalid value: 0: must be between 1 and 65535, inclusive, spec.template.spec.containers[0].readinessProbe.httpGet.port: Invalid value: 0: must be between 1 and 65535, inclusive]

Output of uname -a or ver

Darwin edeandrea-m1pro 22.2.0 Darwin Kernel Version 22.2.0: Fri Nov 11 02:03:51 PST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T6000 arm64

Output of java -version

openjdk version "17.0.5" 2022-10-18
OpenJDK Runtime Environment Temurin-17.0.5+8 (build 17.0.5+8)
OpenJDK 64-Bit Server VM Temurin-17.0.5+8 (build 17.0.5+8, mixed mode)

GraalVM version (if different from Java)

openjdk version "17.0.5" 2022-10-18
OpenJDK Runtime Environment GraalVM CE 22.3.0 (build 17.0.5+8-jvmci-22.3-b08)
OpenJDK 64-Bit Server VM GraalVM CE 22.3.0 (build 17.0.5+8-jvmci-22.3-b08, mixed mode, sharing)

Quarkus version or git rev

2.15.0.Final

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

Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63)
Maven home: /Users/edeandre/.m2/wrapper/dists/apache-maven-3.8.6-bin/67568434/apache-maven-3.8.6
Java version: 17.0.5, vendor: Eclipse Adoptium, runtime: /Users/edeandre/.sdkman/candidates/java/17.0.5-tem
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "13.1", arch: "aarch64", family: "mac"

Additional information

No response

@edeandrea edeandrea added the kind/bug Something isn't working label Dec 19, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented Dec 19, 2022

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

@Sgitario
Copy link
Contributor

Sgitario commented Dec 20, 2022

As far as I see, there are a couple of issues here:

Sgitario added a commit to Sgitario/dekorate that referenced this issue Dec 20, 2022
@edeandrea
Copy link
Contributor Author

Thanks @Sgitario !

Sgitario added a commit to dekorateio/dekorate that referenced this issue Dec 21, 2022
Sgitario added a commit to Sgitario/quarkus that referenced this issue Dec 21, 2022
@quarkus-bot quarkus-bot bot added this to the 2.16 - main milestone Jan 4, 2023
ebullient pushed a commit to maxandersen/quarkus that referenced this issue Jan 24, 2023
ebullient pushed a commit to maxandersen/quarkus that referenced this issue Jan 24, 2023
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.

2 participants