diff --git a/.github/workflows/k8s-quarkus-reactive.yml b/.github/workflows/k8s-quarkus-reactive.yml new file mode 100644 index 0000000..564ee8a --- /dev/null +++ b/.github/workflows/k8s-quarkus-reactive.yml @@ -0,0 +1,31 @@ +name: Quarkus Reactive Build & Deploy on k8s + +on: + push: + branches: + - '**' + paths: + - bookstore-quarkus-reactive/** + + +jobs: + build: + name: build & push + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: build & deploy quarkus + uses: ./.github/actions/k8s/build-deploy-quarkus + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + kube-config: ${{ secrets.KUBECONFIG }} + working-directory: ./bookstore-quarkus-reactive + + - name: deploy postgres + uses: ./.github/actions/k8s/deploy-postgres + with: + release-name: bookstore-quarkus-reactive + anti-affinity-value: bookstore-quarkus-reactive + kube-config: ${{ secrets.KUBECONFIG }} \ No newline at end of file diff --git a/bookstore-quarkus-reactive/build.gradle.kts b/bookstore-quarkus-reactive/build.gradle.kts index 08d5171..797607e 100644 --- a/bookstore-quarkus-reactive/build.gradle.kts +++ b/bookstore-quarkus-reactive/build.gradle.kts @@ -35,6 +35,7 @@ dependencies { implementation("io.quarkus:quarkus-smallrye-health") implementation("io.quarkus:quarkus-container-image-jib") + implementation("io.quarkus:quarkus-kubernetes") testImplementation("io.quarkus:quarkus-junit5") testImplementation("io.rest-assured:rest-assured") diff --git a/bookstore-quarkus-reactive/src/main/resources/application.properties b/bookstore-quarkus-reactive/src/main/resources/application.properties index 88149a4..4a86b26 100644 --- a/bookstore-quarkus-reactive/src/main/resources/application.properties +++ b/bookstore-quarkus-reactive/src/main/resources/application.properties @@ -22,5 +22,18 @@ quarkus.datasource.reactive.reconnect-attempts=3 quarkus.flyway.migrate-at-start=false quarkus.flyway.clean-at-start=false quarkus.flyway.baseline-on-migrate=true -# Health -quarkus.health.extensions.enabled=false \ No newline at end of file +# +# Kubernetes Deployment Config +quarkus.kubernetes.resources.requests.memory=64Mi +quarkus.kubernetes.resources.requests.cpu=50m +quarkus.kubernetes.resources.limits.memory=512Mi +quarkus.kubernetes.resources.limits.cpu=1000m +quarkus.kubernetes.ingress.expose=true +quarkus.kubernetes.ingress.host=${quarkus.application.name}.benchmarks.k8s.dev.arconsis.com +quarkus.kubernetes.ingress.tls.bookstore-quarkus-reactive-tls.enabled=true +quarkus.kubernetes.ingress.tls.bookstore-quarkus-reactive-tls.hosts=${quarkus.kubernetes.ingress.host} +quarkus.kubernetes.ingress.annotations."cert-manager.io/cluster-issuer"=letsencrypt-prod +quarkus.kubernetes.ingress.annotations."kubernetes.io/tls-acme"=true +quarkus.kubernetes.env.mapping.DB_PASSWORD.from-secret=${quarkus.application.name}-postgresql +quarkus.kubernetes.env.mapping.DB_PASSWORD.with-key=postgres-password +quarkus.kubernetes.env.vars.DB_HOST=${quarkus.application.name}-postgresql