-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e63fa76
commit 90d84e9
Showing
15 changed files
with
246 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: Build & Deploy Quarkus to k8s | ||
description: Build & Deploy Quarkus to k8s (if running on deploy-branch) | ||
|
||
|
||
inputs: | ||
github-token: | ||
required: true | ||
description: Github Token | ||
kube-config: | ||
required: true | ||
description: Kubernetes Config | ||
working-directory: | ||
default: . | ||
description: working directory to be used | ||
deploy-branch: | ||
default: refs/heads/main | ||
description: service will only be deployed for this branch | ||
|
||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Set up JDK 21 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: 21 | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v3 | ||
|
||
- name: assemble | ||
shell: bash | ||
working-directory: ${{ inputs.working-directory}} | ||
run: ./gradlew assemble | ||
env: | ||
QUARKUS_HTTP_ROOT_PATH: / | ||
|
||
- name: build container | ||
shell: bash | ||
working-directory: ${{ inputs.working-directory}} | ||
run: ./gradlew assemble -Dquarkus.container-image.build=true | ||
env: | ||
QUARKUS_HTTP_ROOT_PATH: / | ||
|
||
- uses: azure/k8s-set-context@v3 | ||
with: | ||
method: kubeconfig | ||
kubeconfig: ${{ inputs.kube-config }} | ||
|
||
- name: push & deploy to k8s | ||
shell: bash | ||
working-directory: ${{ inputs.working-directory}} | ||
if: ${{ github.ref == inputs.deploy-branch }} | ||
run: | | ||
./gradlew assemble -Dquarkus.kubernetes.deploy=true \ | ||
-Dquarkus.container-image.group=${{ github.repository_owner }}/${{ github.event.repository.name }} \ | ||
-Dquarkus.container-image.registry=ghcr.io \ | ||
-Dquarkus.container-image.additional-tags=${{ github.sha }} \ | ||
-Dquarkus.container-image.username=${{ github.actor }} \ | ||
-Dquarkus.container-image.password=${{ inputs.github-token }} | ||
env: | ||
QUARKUS_HTTP_ROOT_PATH: / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Deploy Postgres with Anti Affinity | ||
description: Deploy Postgres with Anti Affinity | ||
|
||
inputs: | ||
release-name: | ||
required: true | ||
description: release name for the helm chart | ||
anti-affinity-value: | ||
required: true | ||
description: value to be used for the anti-affinity rule | ||
kube-config: | ||
required: true | ||
description: kubernetes config file to connect to the cluster | ||
namespace: | ||
default: benchmarks | ||
description: namespace to be used to install the chart | ||
anti-affinity-key: | ||
default: app.kubernetes.io/name | ||
description: key to be used for the anti-affinity role | ||
deploy-branch: | ||
default: refs/heads/main | ||
description: service will only be deployed for this branch | ||
|
||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: deploy postgres | ||
uses: vimeda/helm@v1.7.0 | ||
if: ${{ github.ref == inputs.deploy-branch }} | ||
with: | ||
release: ${{ inputs.release-name }} | ||
namespace: ${{ inputs.namespace }} | ||
chart: oci://registry-1.docker.io/bitnamicharts/postgresql | ||
values: | | ||
global: | ||
postgresql: | ||
auth: | ||
username: postgres | ||
database: books-db | ||
primary: | ||
affinity: | ||
podAntiAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
- labelSelector: | ||
matchExpressions: | ||
- key: ${{ inputs.anti-affinity-key}} | ||
operator: In | ||
values: | ||
- ${{ inputs.anti-affinity-value}} | ||
topologyKey: "kubernetes.io/hostname" | ||
env: | ||
KUBECONFIG_FILE: ${{ inputs.kube-config }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Quarkus Sync Build & Deploy on k8s | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
paths: | ||
- bookstore-quarkus-sync/** | ||
|
||
|
||
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-sync | ||
|
||
- name: deploy postgres | ||
uses: ./.github/actions/k8s/deploy-postgres | ||
with: | ||
release-name: bookstore-quarkus-sync | ||
anti-affinity-value: bookstore-quarkus-sync | ||
kube-config: ${{ secrets.KUBECONFIG }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
1 change: 1 addition & 0 deletions
1
...ctive/src/main/resources/META-INF/resources/loaderio-61ddb5d318dfddf075a659951abc307c.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
loaderio-61ddb5d318dfddf075a659951abc307c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...-sync/src/main/resources/META-INF/resources/loaderio-61ddb5d318dfddf075a659951abc307c.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
loaderio-61ddb5d318dfddf075a659951abc307c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
postman/Bookstore Quarkus Sync (k8s).postman_environment.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"id": "bd98e2c1-11e3-4568-8ad6-aafe07e404b5", | ||
"name": "Bookstore Quarkus Sync (k8s)", | ||
"values": [ | ||
{ | ||
"key": "host", | ||
"value": "https://bookstore-quarkus-sync.benchmarks.k8s.dev.arconsis.com", | ||
"type": "default", | ||
"enabled": true | ||
} | ||
], | ||
"_postman_variable_scope": "environment", | ||
"_postman_exported_at": "2024-02-15T18:42:29.418Z", | ||
"_postman_exported_using": "Postman/10.23.1" | ||
} |