2. Create the Project
4. Install kubernetes extension
Liste aller Extensions
./mvnw quarkus:list-extensions
Installieren der benötigten Extensions
./mvnw quarkus:add-extension -Dextensions="kubernetes,jib"
5. Docker-Image-Registry
5.1. Erstellen eines Zugriffstokens
-
Öffnen von https://github.com
-
Settings
-<> Developer Settings
-Personal Access Tokens
-Tokens (classic)
- Generate new token - Generate new token (classic) -
Give the token a name i.e.
ghcr-token
-
Give a expiration date i.e.
90 days
-
Check
write:packages
andworkflow
-
Click Generate token
-
Copy the token into a text-file
6. Config Quarkus App
# github-account-name
quarkus.container-image.group=htl-leonding
quarkus.container-image.name=primer-leocloud
quarkus.container-image.tag=1.0.0
# LeoCloud namespace
quarkus.kubernetes.namespace=student-t-stuetz
# docker registry
quarkus.container-image.registry=ghcr.io
# ingress
quarkus.kubernetes.ingress.expose=true
quarkus.kubernetes.ingress.host=student.cloud.htl-leonding.ac.at
# leocloud-prefix
quarkus.kubernetes.ports.http.path=/t.stuetz(/|$)(.*)$
# leocloud-prefix
quarkus.http.root-path=t.stuetz
# für debuggen (requests werden in quarkus log angezeigt)
quarkus.http.access-log.enabled=true
7. Create and Push the Container Image using Jib
7.1. Push Docker Image into Docker Registry (jar)
./mvnw clean package -DskipTests -Dquarkus.container-image.push=true
output
[INFO] Scanning for projects... [INFO] [INFO] -----------------------< at.htl:primer-leocloud >----------------------- [INFO] Building primer-leocloud 1.0-SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ primer-leocloud --- [INFO] Deleting /Users/stuetz/work/2023-ph-seminar/labs/primer-leocloud/target [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ primer-leocloud --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 2 resources [INFO] [INFO] --- quarkus-maven-plugin:2.13.3.Final:generate-code (default) @ primer-leocloud --- [INFO] [INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ primer-leocloud --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 1 source file to /Users/stuetz/work/2023-ph-seminar/labs/primer-leocloud/target/classes [INFO] [INFO] --- quarkus-maven-plugin:2.13.3.Final:generate-code-tests (default) @ primer-leocloud --- [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ primer-leocloud --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /Users/stuetz/work/2023-ph-seminar/labs/primer-leocloud/src/test/resources [INFO] [INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ primer-leocloud --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 2 source files to /Users/stuetz/work/2023-ph-seminar/labs/primer-leocloud/target/test-classes [INFO] [INFO] --- maven-surefire-plugin:3.0.0-M7:test (default-test) @ primer-leocloud --- [INFO] Tests are skipped. [INFO] [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ primer-leocloud --- [INFO] Building jar: /Users/stuetz/work/2023-ph-seminar/labs/primer-leocloud/target/primer-leocloud-1.0-SNAPSHOT.jar [INFO] [INFO] --- quarkus-maven-plugin:2.13.3.Final:build (default) @ primer-leocloud --- [INFO] Checking for existing resources in: /Users/stuetz/work/2023-ph-seminar/labs/primer-leocloud/src/main/kubernetes. [INFO] [io.quarkus.container.image.jib.deployment.JibProcessor] Starting (local) container image build for jar using jib. [WARNING] [io.quarkus.container.image.jib.deployment.JibProcessor] Base image 'registry.access.redhat.com/ubi8/openjdk-17-runtime:1.14' does not use a specific image digest - build may not be reproducible [INFO] [io.quarkus.container.image.jib.deployment.JibProcessor] LogEvent [level=INFO, message=trying docker-credential-desktop for registry.cloud.htl-leonding.ac.at] [INFO] [io.quarkus.container.image.jib.deployment.JibProcessor] LogEvent [level=LIFECYCLE, message=Using credentials from Docker config (/Users/stuetz/.docker/config.json) for registry.cloud.htl-leonding.ac.at/t.stuetz/primer-leocloud:1.0.0] [INFO] [io.quarkus.container.image.jib.deployment.JibProcessor] Using base image with digest: sha256:43618c504657b12e121945ad6c52ce426758fbd2158b820a9fc5babd2970bdde [INFO] [io.quarkus.container.image.jib.deployment.JibProcessor] Container entrypoint set to [java, -Djava.util.logging.manager=org.jboss.logmanager.LogManager, -jar, quarkus-run.jar] [INFO] [io.quarkus.container.image.jib.deployment.JibProcessor] Pushed container image registry.cloud.htl-leonding.ac.at/t.stuetz/primer-leocloud:1.0.0 (sha256:7ba60a294b437f9053c840c135eb449b30b40e677272288d069d3f34269bfbef) [INFO] [io.quarkus.deployment.QuarkusAugmentor] Quarkus augmentation completed in 67824ms [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 01:09 min [INFO] Finished at: 2022-11-06T18:22:50+01:00 [INFO] ------------------------------------------------------------------------