Skip to content

Commit fe0bceb

Browse files
committed
feat(cnpg): add experiment with CloudNativePG
1 parent 5c38f7d commit fe0bceb

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

cnpg/k8s-install.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
4+
5+
helm repo add cnpg https://cloudnative-pg.github.io/charts
6+
7+
helm repo update
8+
9+
helm upgrade --install cnpg \
10+
--namespace cnpg \
11+
--create-namespace \
12+
cnpg/cloudnative-pg
13+
14+
kubectl -n cnpg apply -f "${SCRIPT_DIR}/manifest/postgis-cluster.yaml"

cnpg/manifest/postgis-cluster.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# https://cloudnative-pg.io/documentation/current/samples/
2+
apiVersion: postgresql.cnpg.io/v1
3+
kind: Cluster
4+
metadata:
5+
name: postgis-cluster
6+
spec:
7+
instances: 3
8+
9+
imageName: ghcr.io/cloudnative-pg/postgis:15
10+
11+
postgresql:
12+
# https://pgtune.leopard.in.ua/
13+
parameters:
14+
max_connections: "100"
15+
shared_buffers: "256MB"
16+
effective_cache_size: "768MB"
17+
maintenance_work_mem: "128MB"
18+
checkpoint_completion_target: "0.9"
19+
wal_buffers: "7864kB"
20+
default_statistics_target: "500"
21+
random_page_cost: "1.1"
22+
effective_io_concurrency: "200"
23+
work_mem: "655kB"
24+
huge_pages: "off"
25+
min_wal_size: "4GB"
26+
max_wal_size: "16GB"
27+
28+
resources:
29+
requests:
30+
memory: "1024Mi"
31+
cpu: 1
32+
limits:
33+
memory: "1024Mi"
34+
cpu: 1
35+
36+
# https://cloudnative-pg.io/documentation/current/bootstrap/
37+
bootstrap:
38+
initdb:
39+
database: gis
40+
postInitTemplateSQL:
41+
- CREATE EXTENSION postgis;
42+
storage:
43+
size: 10Gi

0 commit comments

Comments
 (0)