Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Custom config secret yaml inside example #19

Open
wants to merge 1 commit into
base: release-11.16-alpine-cron
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,21 @@
kubectl apply -f https://github.com/kubedb/postgres-docker/raw/release-11.16-alpine-cron/example/catalog.yaml
```

3. Deploy a demo PostgreSQL database.
3. need to provide `shared_preload_libraries = 'pg_cron'` config inside `postgreSQL` `conf` file to enable pg-corn extension. At first, let’s create a secret with `user.conf` as key and set `shared_preload_libraries` there.

```
kubectl apply -f https://github.com/kubedb/postgres-docker/raw/release-11.16-alpine-cron/example/custom-config.yaml
```

4. Deploy a demo PostgreSQL database.
```
kubectl apply -f https://github.com/kubedb/postgres-docker/raw/release-11.16-alpine-cron/example/demo.yaml
```

5. Then We need to create extension for our server. For This we need to exec into primary and create pgcron Extension

```shell
$ kubectl exec -it -n demo demo-pgcron-0 -- bash
$ psql
postgres=# CREATE EXTENSION pg_cron;
```
17 changes: 17 additions & 0 deletions example/custom-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v1
kind: Namespace
metadata:
name: demo
---
apiVersion: v1
kind: Secret
metadata:
name: postgres-configuration
namespace: demo
stringData:
user.conf: |-
# ref: https://github.com/citusdata/pg_cron#setting-up-pg_cron
# required to load pg_cron background worker on start-up
shared_preload_libraries = 'pg_cron'
# optionally, specify the database in which the pg_cron background worker should run (defaults to postgres)
cron.database_name = 'postgres'
2 changes: 2 additions & 0 deletions example/demo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ metadata:
spec:
version: "11.16-alpine-cron"
replicas: 3
configSecret:
name: postgres-configuration
standbyMode: Hot
storageType: Durable
storage:
Expand Down