Skip to content

Commit

Permalink
ParadeDB Support (#1)
Browse files Browse the repository at this point in the history
Signed-off-by: Philippe Noël <21990816+philippemnoel@users.noreply.github.com>
Co-authored-by: Philippe Noël <21990816+philippemnoel@users.noreply.github.com>

ci: AWS EKS LocalStack Tests (#14)

Co-authored-by: Itay Grudev <itay.grudev@essentim.com>
Co-authored-by: Itay Grudev <itay+github.com@grudev.com>

Updated documentation workflows and cleanup (#18)

Revert "Add postgresql default to tests"

This reverts commit a9f340d.

Add repository_dispatch

Signed-off-by: Philippe Noël <21990816+philippemnoel@users.noreply.github.com>

chore: Configure repository for ParadeDB (#15)

Co-authored-by: Itay Grudev <itay+github.com@grudev.com>

chore: Create artifacthub-repo.yml (#20)

Signed-off-by: Philippe Noël <21990816+philippemnoel@users.noreply.github.com>

Put artifacthub-repo.yml in the right location

Bug Fix: Tests (#21)

Renamed chart to `paradedb-cluster` (#22)

Co-authored-by: Philippe Noël <philippemnoel@gmail.com>

Rm .DS_Store

Remove extra HTML tag

Signed-off-by: Philippe Noël <21990816+philippemnoel@users.noreply.github.com>

Remove repository_dispatch

Signed-off-by: Philippe Noël <21990816+philippemnoel@users.noreply.github.com>

chore: Rename paradedb-cluster to paradedb (#28)

chore: Try with adding missing -cluster (#33)

chore: Final Cleanup (#34)

chore: Remove PostGIS and Timescale (#35)

Using the default UID/GID 999 from the postgres docker image (#26)

Co-authored-by: Philippe Noël <philippemnoel@gmail.com>

chore: Update README and Schema (#37)

Signed-off-by: Philippe Noël <21990816+philippemnoel@users.noreply.github.com>

chore(deps): pin sigstore/cosign-installer action to 4959ce0 (cloudnative-pg#403)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

Rm pgvectorscale (#39)

Signed-off-by: Philippe Noël <21990816+philippemnoel@users.noreply.github.com>

feat: Add GitHub Actions Workflow to check for typos (#40)

Signed-off-by: Philippe Noël <21990816+philippemnoel@users.noreply.github.com>
Co-authored-by: Philippe Noël <21990816+philippemnoel@users.noreply.github.com>

chore(deps): update kyverno/action-install-chainsaw action to v0.2.11 (cloudnative-pg#410)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

Rename the default database from app to paradedb (#41)

Co-authored-by: Philippe Noël <philippemnoel@gmail.com>

docs: Clarify the docs (#42)

Update Depot

Revert "Update Depot"

This reverts commit cb85b81.

feat: Add `pg_cron` and Postgis (#44)

Signed-off-by: Philippe Noël <21990816+philippemnoel@users.noreply.github.com>

chore: Use the new 0.11.0 release (#47)

feat: Enable monitoring via Prometheus and Grafana (rebased) (#48)

Rm extra files

Remove duplicate block in README

Signed-off-by: Itay Grudev <itay@verito.digital>
  • Loading branch information
itay-grudev authored and philippemnoel committed Feb 7, 2025
1 parent fb0bcef commit aa9346d
Show file tree
Hide file tree
Showing 15 changed files with 475 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: batch/v1
kind: Job
metadata:
name: data-write
status:
succeeded: 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: batch/v1
kind: Job
metadata:
name: data-write
spec:
template:
spec:
restartPolicy: OnFailure
containers:
- name: data-write
env:
- name: DB_URI
valueFrom:
secretKeyRef:
name: standalone-paradedb-superuser
key: uri
image: alpine:3.19
command: ['sh', '-c']
args:
- |
apk --no-cache add postgresql-client
DB_URI=$(echo $DB_URI | sed "s|/\*|/|" )
psql "$DB_URI" -c "CREATE TABLE mygoodtable (id serial PRIMARY KEY);"
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: postgresql.cnpg.io/v1
kind: Backup
metadata:
name: post-init-backup
spec:
method: barmanObjectStore
cluster:
name: standalone-paradedb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: postgresql.cnpg.io/v1
kind: Backup
metadata:
name: post-init-backup
spec:
cluster:
name: standalone-paradedb
method: barmanObjectStore
status:
phase: completed
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: postgresql.cnpg.io/v1
kind: Backup
metadata:
name: post-init-backup
spec:
cluster:
name: standalone-paradedb
method: barmanObjectStore
status:
phase: running
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: batch/v1
kind: Job
metadata:
name: backup-checkpoint
spec:
template:
spec:
restartPolicy: OnFailure
containers:
- name: create-checkpoint
env:
- name: DB_URI
valueFrom:
secretKeyRef:
name: standalone-paradedb-superuser
key: uri
image: alpine:3.19
command: ['sh', '-c']
args:
- |
apk --no-cache add postgresql-client
DB_URI=$(echo $DB_URI | sed "s|/\*|/|" )
END_TIME=$(( $(date +%s) + 30 ))
while [ $(date +%s) -lt $END_TIME ]; do
psql "$DB_URI" -c "SELECT pg_switch_wal();CHECKPOINT;"
sleep 5
done
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: configmap-creator-sa
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: configmap-creator
rules:
- apiGroups: [""]
resources: ["configmaps"]
verbs: ["create"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: configmap-creator-binding
subjects:
- kind: ServiceAccount
name: configmap-creator-sa
roleRef:
kind: Role
name: configmap-creator
apiGroup: rbac.authorization.k8s.io
---
apiVersion: batch/v1
kind: Job
metadata:
name: data-write-post-backup
spec:
template:
spec:
serviceAccountName: configmap-creator-sa
restartPolicy: OnFailure
containers:
- name: data-write
env:
- name: DB_URI
valueFrom:
secretKeyRef:
name: standalone-paradedb-superuser
key: uri
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
image: alpine:3.19
command: ['sh', '-c']
args:
- |
apk --no-cache add postgresql-client kubectl coreutils
DB_URI=$(echo $DB_URI | sed "s|/\*|/|" )
DATE_NO_BAD_TABLE=$(date --rfc-3339=ns)
sleep 30
psql "$DB_URI" -c "CREATE TABLE mybadtable (id serial PRIMARY KEY);"
kubectl create configmap date-no-bad-table --from-literal=date="$DATE_NO_BAD_TABLE"
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
type: postgresql
mode: recovery

cluster:
instances: 2
storage:
size: 256Mi

recovery:
method: backup
backupName: "post-init-backup"
provider: s3
endpointURL: "https://minio.minio.svc.cluster.local"
endpointCA:
name: kube-root-ca.crt
key: ca.crt
wal:
encryption: ""
data:
encryption: ""
s3:
bucket: "mybucket"
path: "/postgresql-minio-backup-restore/v1"
accessKey: "minio"
secretKey: "minio123"
region: "local"
scheduledBackups: []
retentionPolicy: "30d"

backups:
enabled: true
provider: s3
endpointURL: "https://minio.minio.svc.cluster.local"
endpointCA:
name: kube-root-ca.crt
key: ca.crt
wal:
encryption: ""
data:
encryption: ""
s3:
bucket: "mybucket"
path: "/postgresql-minio-backup-restore/v2"
accessKey: "minio"
secretKey: "minio123"
region: "local"
scheduledBackups: []
retentionPolicy: "30d"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: recovery-object-store-paradedb
status:
readyInstances: 2
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
type: postgresql
mode: recovery

cluster:
instances: 2
storage:
size: 256Mi

recovery:
method: object_store
clusterName: "standalone-paradedb"
provider: s3
endpointURL: "https://minio.minio.svc.cluster.local"
endpointCA:
name: kube-root-ca.crt
key: ca.crt
wal:
encryption: ""
data:
encryption: ""
s3:
bucket: "mybucket"
path: "/postgresql-minio-backup-restore/v1"
accessKey: "minio"
secretKey: "minio123"
region: "local"
scheduledBackups: []
retentionPolicy: "30d"

backups:
enabled: true
provider: s3
endpointURL: "https://minio.minio.svc.cluster.local"
endpointCA:
name: kube-root-ca.crt
key: ca.crt
wal:
encryption: ""
data:
encryption: ""
s3:
bucket: "mybucket"
path: "/postgresql-minio-backup-restore/v2"
accessKey: "minio"
secretKey: "minio123"
region: "local"
scheduledBackups: []
retentionPolicy: "30d"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: recovery-backup-pitr-paradedb
status:
readyInstances: 2
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
type: postgresql
mode: recovery

cluster:
instances: 2
storage:
size: 256Mi

recovery:
method: backup
backupName: "post-init-backup"
provider: s3
endpointURL: "https://minio.minio.svc.cluster.local"
endpointCA:
name: kube-root-ca.crt
key: ca.crt
wal:
encryption: ""
data:
encryption: ""
s3:
bucket: "mybucket"
path: "/postgresql-minio-backup-restore/v1"
accessKey: "minio"
secretKey: "minio123"
region: "local"
scheduledBackups: []
retentionPolicy: "30d"

backups:
enabled: true
provider: s3
endpointURL: "https://minio.minio.svc.cluster.local"
endpointCA:
name: kube-root-ca.crt
key: ca.crt
wal:
encryption: ""
data:
encryption: ""
s3:
bucket: "mybucket"
path: "/postgresql-minio-backup-restore/v2"
accessKey: "minio"
secretKey: "minio123"
region: "local"
scheduledBackups: []
retentionPolicy: "30d"
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: batch/v1
kind: Job
metadata:
name: data-test-backup-pitr
spec:
template:
spec:
restartPolicy: OnFailure
containers:
- name: data-test
env:
- name: DB_URI
valueFrom:
secretKeyRef:
name: recovery-backup-pitr-paradedb-superuser
key: uri
image: alpine:3.19
command: ['sh', '-c']
args:
- |
apk --no-cache add postgresql-client
DB_URI=$(echo $DB_URI | sed "s|/\*|/|" )
set -e
test "$(psql $DB_URI -t -c 'SELECT EXISTS (SELECT FROM information_schema.tables WHERE table_name = $$mygoodtable$$)' --csv -q 2>/dev/null)" = "t"
echo "Good table exists"
test "$(psql $DB_URI -t -c 'SELECT EXISTS (SELECT FROM information_schema.tables WHERE table_name = $$mybadtable$$)' --csv -q 2>/dev/null)" = "f"
echo "Bad table does not exist"
Loading

0 comments on commit aa9346d

Please sign in to comment.