Skip to content

feat: read from postgres and fix the container main class - #150

Closed
TheMeinerLP wants to merge 2 commits into
mainfrom
feat/postgres-and-chart
Closed

feat: read from postgres and fix the container main class#150
TheMeinerLP wants to merge 2 commits into
mainfrom
feat/postgres-and-chart

Conversation

@TheMeinerLP

Copy link
Copy Markdown
Contributor

Was drin ist

feat: read from postgres and answer the chart's probes

  • PostgreSQL-Datasource und Health-/Readiness-Konfiguration, damit die Probes der Helm-Chart bedient werden.

fix: point mainClass at the renamed package

  • Die Package-Umbenennung net.theevilreaper.*net.onelitefeather.* hatte application.mainClass in build.gradle.kts nie erreicht.
  • Micronaut schreibt diesen Wert als Main-Class in application.jar; der generierte Entrypoint ist java -jar /home/app/application.jar.
  • Folge: Jeder Pod starb sofort mit
    Could not find or load main class net.theevilreaper.vulpes.generator.VulpesGenerator.

Verifikation

./gradlew buildLayers neu gebaut und das Manifest geprüft:

  • Main-Class: net.onelitefeather.vulpes.generator.VulpesGenerator
  • net/onelitefeather/vulpes/generator/VulpesGenerator.class liegt im Jar

Es war die letzte aktive theevilreaper-Referenz im Repo (die verbleibende in settings.gradle.kts:50 ist auskommentiert).

Offener Punkt (nicht Teil dieses PRs)

src/main/resources/gradle_template.zip ist lokal untracked. Die Datei landet im resources-Layer des Images, würde im CI-Build aber fehlen.

Two things stand between this service and running in the cluster.

It talks to MariaDB. The Vulpes data moved to the shared CNPG Postgres with the
backend, and no MariaDB `vulpes` database exists any more -- so pointed at the
cluster it would find nothing to read. The Postgres driver was not even on the
classpath, and driver and dialect were hardcoded, so no amount of configuration
could have fixed it from the outside. Both are now settable (DB_DRIVER,
DB_DIALECT) with the MariaDB values kept as defaults, leaving the
docker-compose setup beside this repo working exactly as before; the deployment
overrides url, driver, dialect and credentials together.

And charts/vulpes-generator probes /health and points a ServiceMonitor at
/prometheus -- endpoints application.yml has configured all along, but which
nothing served, because micronaut-management was missing from the dependencies.
The probes would have 404'd and the pod would never have turned ready.
micrometer is added alongside it so /prometheus has something to report.

compileJava passes.
The package rename from net.theevilreaper.* to net.onelitefeather.*
never reached application.mainClass, so Micronaut wrote a stale
Main-Class into application.jar. The container entrypoint runs
`java -jar /home/app/application.jar`, which made every pod die with
ClassNotFoundException: net.theevilreaper.vulpes.generator.VulpesGenerator.

Verified via `./gradlew buildLayers`: the manifest now reads
Main-Class: net.onelitefeather.vulpes.generator.VulpesGenerator.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant