Skip to content

Commit

Permalink
Try using action for postgres deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas-eberle committed Feb 15, 2024
1 parent bed2fad commit b4dba04
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 31 deletions.
45 changes: 45 additions & 0 deletions .github/actions/k8s/deploy-postgres/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: "Deploy Postgres with Anti Affinity"
inputs:
release-name:
required: true
anti-affinity-value:
required: true
kube-config:
required: true
namespace:
default: benchmarks
anti-affinity-key:
default: app.kubernetes.io/name




runs:
using: "composite"
steps:
- name: deploy postgres
uses: vimeda/[email protected]
with:
release: ${{ inputs.release-name }}
namespace: ${{ inputs.benchmarks }}
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 }}
64 changes: 33 additions & 31 deletions .github/workflows/k8s-quarkus-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,36 +52,38 @@ jobs:
-Dquarkus.container-image.additional-tags=${{ github.sha }} \
-Dquarkus.container-image.username=${{ github.actor }} \
-Dquarkus.container-image.password=${{ secrets.GITHUB_TOKEN }}
- name: deploy postgres
uses: vimeda/[email protected]
- uses: ./.github/actions/k8s/deploy-postgres
with:
release: bookstore-quarkus-sync
namespace: 'benchmarks'
chart: 'oci://registry-1.docker.io/bitnamicharts/postgresql'
token: '${{ secrets.GITHUB_TOKEN }}'
values: |
global:
postgresql:
auth:
username: postgres
database: books-db
primary:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- bookstore-quarkus-sync
- key: app.kubernetes.io/managed-by
operator: In
values:
- quarkus
topologyKey: "kubernetes.io/hostname"
env:
KUBECONFIG_FILE: '${{ secrets.KUBECONFIG }}'
release-name: bookstore-quarkus-sync
anti-affinity-value: bookstore-quarkus-sync
kube-config: ${{ secrets.KUBECONFIG }}


# - name: deploy postgres
# uses: vimeda/[email protected]
# with:
# release: bookstore-quarkus-sync
# namespace: 'benchmarks'
# chart: 'oci://registry-1.docker.io/bitnamicharts/postgresql'
# token: '${{ secrets.GITHUB_TOKEN }}'
# values: |
# global:
# postgresql:
# auth:
# username: postgres
# database: books-db
#
# primary:
# affinity:
# podAntiAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# - labelSelector:
# matchExpressions:
# - key: app.kubernetes.io/name
# operator: In
# values:
# - bookstore-quarkus-sync
# topologyKey: "kubernetes.io/hostname"
# env:
# KUBECONFIG_FILE: '${{ secrets.KUBECONFIG }}'

0 comments on commit b4dba04

Please sign in to comment.