Skip to content

Commit 6f4f3c0

Browse files
committed
Updated docs
1 parent 8ce9e39 commit 6f4f3c0

File tree

11 files changed

+60
-33
lines changed

11 files changed

+60
-33
lines changed

Backlog

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
Features in order of priority:
22

3-
- add a test in spec_readinessProbe_test and spec_livenessProbe_test so that
4-
we test the default behaviour when no option is set from the YAML
5-
6-
- #20 : Delete PVC
3+
- being able to configure how sensitive is hte automatic recovery process
4+
by setting a time value in seconds
75

86
- #12 : Reuse PVC (see below) and Primary becomes a Replica
97

@@ -12,9 +10,12 @@ Features in order of priority:
1210
- "delete": the PVC will be deleted
1311
- "reuse": if the state of the PVC is healthy, it will be reused by the newly created Replica pod. I think that matches with your suggestion?
1412

15-
- #30: Add one or many sidecar container options in Kubegres YAML
13+
- #20 : Delete PVC (is it the same as #12?)
1614

17-
- #?: PG bouncer
15+
- add a test in spec_readinessProbe_test and spec_livenessProbe_test so that
16+
we test the default behaviour when no option is set from the YAML
17+
18+
- #30: Add one or many sidecar container options in Kubegres YAML
1819

1920
- #51: add documentation about how to recover backup
2021
- add use cases documentation, for example how to expand storage manually and how to upgrade Postgres major version.
@@ -30,6 +31,8 @@ Features in order of priority:
3031

3132
- #10 : Deploy Kubegres with a HELM chart
3233

34+
- #?: PG bouncer
35+
3336
- #? : Add a field to allow restarting StatefulSets and Pods via the YAML of "Kind: Kubegres"?
3437

3538
Blocked:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ stateful-set's life-cycle and data replication could be with Kubernetes.
1717

1818
* It provides a very simple YAML with properties specialised for PostgreSql.
1919

20-
* It is resilient, has over [85 automatized tests](https://github.com/reactive-tech/kubegres/tree/main/internal/test) cases and
20+
* It is resilient, has over [93 automatized tests](https://github.com/reactive-tech/kubegres/tree/main/internal/test) cases and
2121
has been running in production.
2222

2323

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: v1
2+
kind: PersistentVolumeClaim
3+
metadata:
4+
name: backup
5+
namespace: custom
6+
spec:
7+
storageClassName: "standard"
8+
accessModes:
9+
- ReadWriteOnce
10+
resources:
11+
requests:
12+
storage: 10Mi

config/localresource/custom-namespace/configMap.yaml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,16 @@ data:
3131
echo "$dt - Running: psql -v ON_ERROR_STOP=1 --username $POSTGRES_USER --dbname $POSTGRES_DB ...";
3232
3333
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
34-
34+
CREATE USER $customUserName WITH PASSWORD '$POSTGRES_MYAPP_PASSWORD';
3535
CREATE DATABASE $customDatabaseName;
3636
\connect $customDatabaseName;
37-
37+
GRANT ALL ON SCHEMA public TO $customUserName;
38+
EOSQL
39+
40+
psql -v ON_ERROR_STOP=1 --username "$customUserName" --dbname "$customDatabaseName" <<-EOSQL
3841
CREATE TABLE account(user_id serial PRIMARY KEY, username VARCHAR (50) NOT NULL);
3942
INSERT INTO account VALUES (1, 'username1');
4043
INSERT INTO account VALUES (2, 'username2');
41-
42-
CREATE USER $customUserName WITH PASSWORD '$POSTGRES_MYAPP_PASSWORD';
43-
GRANT SELECT, INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER ON ALL TABLES IN SCHEMA public TO $customUserName;
44-
GRANT USAGE, SELECT, UPDATE ON ALL SEQUENCES IN SCHEMA public TO $customUserName;
45-
GRANT USAGE, CREATE ON SCHEMA public TO $customUserName;
46-
4744
EOSQL
4845
4946
echo "$dt - Init script is completed";

config/localresource/custom-namespace/kubegres.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ spec:
2525

2626
#backup:
2727
# schedule: "*/1 * * * *"
28-
# pvcName: postgres-db-mypostgres-2-0
28+
# pvcName: backup
2929
# volumeMount: /tmp/mypostgres
3030

3131
env:

config/localresource/custom-namespace/kustomization.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
22
kind: Kustomization
33

44
resources:
5+
- backup-pvc.yaml
56
- namespace.yaml
67
- secret.yaml
78
- configMap.yaml
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: v1
2+
kind: PersistentVolumeClaim
3+
metadata:
4+
name: backup
5+
namespace: default
6+
spec:
7+
storageClassName: "standard"
8+
accessModes:
9+
- ReadWriteOnce
10+
resources:
11+
requests:
12+
storage: 10Mi

config/localresource/default-namespace/configMap.yaml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,16 @@ data:
3131
echo "$dt - Running: psql -v ON_ERROR_STOP=1 --username $POSTGRES_USER --dbname $POSTGRES_DB ...";
3232
3333
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
34-
34+
CREATE USER $customUserName WITH PASSWORD '$POSTGRES_MYAPP_PASSWORD';
3535
CREATE DATABASE $customDatabaseName;
3636
\connect $customDatabaseName;
37-
37+
GRANT ALL ON SCHEMA public TO $customUserName;
38+
EOSQL
39+
40+
psql -v ON_ERROR_STOP=1 --username "$customUserName" --dbname "$customDatabaseName" <<-EOSQL
3841
CREATE TABLE account(user_id serial PRIMARY KEY, username VARCHAR (50) NOT NULL);
3942
INSERT INTO account VALUES (1, 'username1');
4043
INSERT INTO account VALUES (2, 'username2');
41-
42-
CREATE USER $customUserName WITH PASSWORD '$POSTGRES_MYAPP_PASSWORD';
43-
GRANT SELECT, INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER ON ALL TABLES IN SCHEMA public TO $customUserName;
44-
GRANT USAGE, SELECT, UPDATE ON ALL SEQUENCES IN SCHEMA public TO $customUserName;
45-
GRANT USAGE, CREATE ON SCHEMA public TO $customUserName;
46-
4744
EOSQL
48-
45+
4946
echo "$dt - Init script is completed";

config/localresource/default-namespace/kubegres.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ spec:
5151
# promotePod: "mypostgres-3-0"
5252

5353
#backup:
54-
# schedule: "*/1 * * * *"
55-
# pvcName: postgres-db-mypostgres-2-0
54+
# schedule: "*/5 * * * *"
55+
# pvcName: backup
5656
# volumeMount: /tmp/mypostgres
5757

5858
#imagePullSecrets:
@@ -110,6 +110,12 @@ spec:
110110
# storage: 1Gi
111111

112112
env:
113+
- name: PGPASSWORD
114+
valueFrom:
115+
secretKeyRef:
116+
name: mypostgres-secret
117+
key: superUserPassword
118+
113119
- name: POSTGRES_PASSWORD
114120
valueFrom:
115121
secretKeyRef:

config/localresource/default-namespace/kustomization.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
22
kind: Kustomization
33

44
resources:
5+
- backup-pvc.yaml
56
- secret.yaml
67
- configMap.yaml
78
- kubegres.yaml

0 commit comments

Comments
 (0)