Skip to content

Commit

Permalink
Run postgres in cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
ronenh committed Nov 22, 2024
1 parent 98866e6 commit fb60c2d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 21 deletions.
29 changes: 10 additions & 19 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,8 @@ jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd "pg_isready -U $POSTGRES_USER"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
env:
POSTGRES_PASSWORD: postgres
steps:
-
name: Read Configuration
Expand Down Expand Up @@ -90,11 +79,15 @@ jobs:
--agents 1
--k3s-arg "--disable=metrics-server@server:*"
-
name: Cluster CoreDNS
name: Deploy Postgres
run: |
kubectl -n kube-system get configmap coredns -o yaml
ip address
nslookup postgres
helm install postgresql oci://registry-1.docker.io/bitnamicharts/postgresql \
--namespace postgres --create-namespace \
--set auth.postgresPassword=${{ env.POSTGRES_PASSWORD }}
echo "Waiting for postgres to be ready"
kubectl wait pods --selector app.kubernetes.io/name=postgresql \
--for condition=Ready --namespace postgres --timeout=60s
-
name: Generate admin ssh key
id: sshkey
Expand All @@ -106,8 +99,6 @@ jobs:
name: Test Directory
env:
GITHUB_TOKEN: ${{ env.READ_WRITE_TOKEN }}
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
SSH_PUBLIC_KEY: ${{ steps.sshkey.outputs.public_key }}
SSH_PRIVATE_KEY: ${{ steps.sshkey.outputs.private_key }}
run: |
Expand Down
4 changes: 2 additions & 2 deletions test/directory/directory.values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ imagePullSecrets:

rootDirectory:
database:
host: host.k3d.internal
host: postgresql.postgres.svc.cluster.local
dbName: test-root-ds
sslMode: disable
admin:
Expand All @@ -17,7 +17,7 @@ rootDirectory:

tenantDirectory:
database:
host: host.k3d.internal
host: postgresql.postgres.svc.cluster.local
dbName: test-ds
sslMode: disable
admin:
Expand Down

0 comments on commit fb60c2d

Please sign in to comment.