1- ## CREATE PG INSTANCE
21
2+ # Postgresql cluster addons
3+ ## Plans
4+
5+ View and choose the service resource specifications you need.
6+ ```
7+ # drycc resources:plans postgresql-cluster
8+ ```
9+ ### Resource specification list
10+ | Resource Specification | Cores | MEMORY | Storage SIZE |
11+ | :---: | :---: | :---: | :---: |
12+ | standard-10 | 1C | 2G | 10G |
13+ | standard-20 | 2C | 4G | 20G |
14+ | standard-50 | 2C | 8G | 50G |
15+ | standard-100 | 4C | 16G | 100G |
16+ | standard-200 | 8C | 32G | 200G |
17+ | standard-400 | 16C | 64G | 400G |
18+ | standard-800 | 32C | 128G | 800G |
19+
20+ In order to obtain a better experience, it is recommended not to exceed 80% usage of resource utilization for a long period of time. If there is a need for larger resource scale, please apply for private customization.
21+
22+ ## Create Postgresql Cluster Service instance
23+
24+ - Create Postgresql service
25+ ```
26+ # drycc resources:create postgresql-cluster:standard-10 `my_pg_001`
27+ ```
28+ - View service status
29+ ```
30+ # drycc resources:descript `my_pg_001`
31+ ```
32+ - Bind service
33+ ```
34+ # drycc resources:bind `my_pg_001`
35+ ```
36+ - View resource status
37+ ```
38+ # drycc resources:descript `my_pg_001`
39+ ```
40+
41+ ## Create Service with parameters
42+
43+ ` vim value.yaml `
344```
445# create or update pg instance template yaml
546networkPolicy.allowNamespaces:
@@ -14,14 +55,21 @@ backup:
1455 Amount of base backups to retain
1556 retainBackups: 2
1657 s3:
17- awsAccessKeyID: DO9l771LqiwZkhhz
18- awsSecretAccessKey: R3Dv0NEmJBo8JFdn1q8jz49ArWwpDjFn
19- walGS3Prefix: mx-test
58+ awsAccessKeyID: ""
59+ awsSecretAccessKey: ""
60+ walGS3Prefix: "s3://xx"
61+ awsEndpoint: "http://xxxx:9000"
62+ awsS3ForcePathStyle: "true"
63+ awsRegion: dx-1
64+ ```
65+ ```
66+ drycc resources:create postgresql-cluster:standard-10 `my_pg_001` -f ./value.yaml
2067```
2168
22- ## Create app user and database
69+ ## Update Service
70+ ### Create app user and database
2371
24- - Login PG with admin user & password
72+ - Login database web with admin user & password
2573
2674- CREATE APP USER
2775```
@@ -36,28 +84,44 @@ CREATE DATABASE `my_db` OWNER `my_user`;
3684CREATE EXTENSION pg_buffercache;
3785```
3886
39- ## Network Access
87+ ### Network Access
4088
4189Default access allow policy: only namespace scope.
4290
4391- allow ` mx-test1 ` namespace access
92+
93+ ` vim value.yaml `
4494```
4595networkPolicy.allowNamespaces:
4696 - mx-test1
4797```
98+ ```
99+ drycc resources:update postgresql-cluster:standard-10 `my_pg_001` -f ./value.yaml
100+ ```
101+
102+ - Assign external network IP address
48103
49- - Assign external network IP address
104+ ` vim value.yaml `
105+ ```
106+ service.type: LoadBlancer
50107```
51- service.type: LoadBlance
52108```
109+ drycc resources:update postgresql-cluster:standard-10 `my_pg_001` -f ./value.yaml
110+ ```
111+ - View resource status
112+ ```
113+ # drycc resources:describe `my_pg_001`
114+ ```
53115
54- ## Manger backup your data ` Very important `
116+ ### Manger backup your data ` Very important `
55117
56118` Strongly recommend enabling this feature. `
57119` Strongly recommend enabling this feature. `
58120` Strongly recommend enabling this feature. `
59121
60122PG data backup use S3 as backenp store. Choose an independent storage space ` outside of the current environment ` as your backup space.
123+
124+ ` vim value.yaml `
61125```
62126backup:
63127 # whether BackUP should be enabled
@@ -71,20 +135,20 @@ backup:
71135 awsSecretAccessKey: R3Dv0NEmJBo8JFdn1q8jz49ArWwpDjFn
72136 walGS3Prefix: mx-test
73137```
138+ ```
139+ drycc resources:update postgresql-cluster:standard-10 `my_pg_001` -f ./value.yaml
140+ ```
74141
75- You can modify multiple content at once, there is no need to modify part of it each time.
142+ You can modify multiple content at once, there is no need to modify part of it each time.
76143
77- ## Plans
78144
79- | Resource Specification | Cores | MEMORY | Storage SIZE |
80- | :---: | :---: | :---: | :---: |
81- | standard-10 | 1C | 2G | 10G |
82- | standard-20 | 2C | 4G | 20G |
83- | standard-50 | 2C | 8G | 50G |
84- | standard-100 | 4C | 16G | 100G |
85- | standard-200 | 8C | 32G | 200G |
86- | standard-400 | 16C | 64G | 400G |
87- | standard-800 | 32C | 128G | 800G |
88-
89- In order to obtain a better experience, it is recommended not to exceed 80% usage of resource utilization for a long period of time. If there is a need for larger resource scale, please apply for private customization.
145+ ## Destroy Service
90146
147+ - Unbind service first
148+ ```
149+ # drycc resources:unbind `my_pg_001`
150+ ```
151+ - Destroy service
152+ ```
153+ # drycc resources:destroy `my_pg_001`
154+ ```
0 commit comments