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

k8s:resource doesn't automatically pick up port from Micronaut application.properties #3326

Closed
rohanKanojia opened this issue Aug 20, 2024 · 1 comment · Fixed by #3366
Closed
Assignees
Labels
bug Something isn't working
Milestone

Comments

@rohanKanojia
Copy link
Member

rohanKanojia commented Aug 20, 2024

Describe the bug

Related to #2239

In a Micronaut project, when I specify port via application.yml:

micronaut:
  server:
    port: 9080

k8s:build does pick up this port and exposes 9000 port in container image. However, k8s:resource doesn't seem to add 9080 port in generated Kubernetes liveness, readiness and startup probes.

If I add extra jkube-healthcheck-micronaut enricher configuration for port, it works:

      <plugin>
          <groupId>org.eclipse.jkube</groupId>
          <artifactId>kubernetes-maven-plugin</artifactId>
          <version>${jkube.version}</version>              
          <configuration>
            <enricher>
              <config>
                  <jkube-healthcheck-micronaut>
                      <port>9080</port>
                  </jkube-healthcheck-micronaut>
              </config>
            </enricher>  
          </configuration>
      </plugin>

Eclipse JKube version

SNAPSHOT

Component

Kubernetes Maven Plugin

Apache Maven version

None

Gradle version

None

Steps to reproduce

  1. Go to quickstarts/maven/micronaut
  2. Run k8s:resource, you would notice generated resources has a different port in YAML manifests target/classes/META-INF/jkube/kubernetes.yml . It's not same as the one set in src/main/resources/application.yml

Expected behavior

MicronautHealthCheckEnricher should automatically read project configuration and read from ports. We need to make changes similar to #2287 here to read ports.

Runtime

Kubernetes (vanilla)

Kubernetes API Server version

1.25.3

Environment

Linux

Eclipse JKube Logs

No response

Sample Reproducer Project

No response

Additional context

No response

@rohanKanojia rohanKanojia added the bug Something isn't working label Aug 20, 2024
@arman-yekkehkhani
Copy link
Contributor

@rohanKanojia Hi Rohan, Can I work on this?

arman-yekkehkhani added a commit to arman-yekkehkhani/jkube that referenced this issue Sep 5, 2024
arman-yekkehkhani added a commit to arman-yekkehkhani/jkube that referenced this issue Sep 5, 2024
arman-yekkehkhani added a commit to arman-yekkehkhani/jkube that referenced this issue Sep 5, 2024
arman-yekkehkhani added a commit to arman-yekkehkhani/jkube that referenced this issue Sep 6, 2024
arman-yekkehkhani added a commit to arman-yekkehkhani/jkube that referenced this issue Sep 12, 2024
arman-yekkehkhani added a commit to arman-yekkehkhani/jkube that referenced this issue Sep 20, 2024
arman-yekkehkhani added a commit to arman-yekkehkhani/jkube that referenced this issue Sep 20, 2024
arman-yekkehkhani added a commit to arman-yekkehkhani/jkube that referenced this issue Sep 20, 2024
@manusa manusa added this to the 1.18.0 milestone Oct 15, 2024 — with automated-tasks
manusa pushed a commit that referenced this issue Oct 15, 2024
…erties for Micronaut application (3366)

fix(Micronaut HealthChecker Enricher): k8s resource pick port from application.properties, fix #3326

Signed-off-by: arman-yekkehkhani <[email protected]>
---
fix(Micronaut HealthChecker Enricher): gradle integration test, fix #3326

Signed-off-by: arman-yekkehkhani <[email protected]>
---
fix(Micronaut HealthChecker Enricher): update CHANGELOG.md, fix #3326

Signed-off-by: arman-yekkehkhani <[email protected]>
---
Merge branch 'master' into gh-3326_fix_micronaut_port
---
fix(Micronaut HealthChecker Enricher): fix license header, fix #3326

Signed-off-by: arman-yekkehkhani <[email protected]>
---
fix(MicronautHealthCheckEnricher): apply reviews, fix #3326

Signed-off-by: arman-yekkehkhani <[email protected]>
---
fix(MicronautHealthCheckEnricher): apply reviews, fix #3326

Signed-off-by: arman-yekkehkhani <[email protected]>
---
fix(MicronautHealthCheckEnricher): rollback micronaut 4 to 3, fix #3326

Signed-off-by: arman-yekkehkhani <[email protected]>
---
fix(MicronautHealthCheckEnricher): update micronaut version 3 o latest, fix #3326

Signed-off-by: arman-yekkehkhani <[email protected]>
---
Merge branch 'master' into gh-3326_fix_micronaut_port

# Conflicts:
#	CHANGELOG.md
---
Merge branch 'master' into gh-3326_fix_micronaut_port

# Conflicts:
#	CHANGELOG.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants