You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Previously the only way to specify container resources (CPU/RAM)
for a PostgreSQL cluster was to customize the "resource config"
in the pgo.yaml file and reference it from the "pgo create cluster"
command.
This introduces the "--cpu" and "--memory" flags to the
"pgo create cluster" command to allow one to specify custom values
for the PostgreSQL cluster at cluster creation time.
Issue: [ch6658]
Issue: #1268
Copy file name to clipboardExpand all lines: docs/content/pgo-client/reference/pgo_create_cluster.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,11 +20,13 @@ pgo create cluster [flags]
20
20
```
21
21
--ccp-image string The CCPImage name to use for cluster creation. If specified, overrides the value crunchy-postgres.
22
22
-c, --ccp-image-tag string The CCPImageTag to use for cluster creation. If specified, overrides the pgo.yaml setting.
23
+
--cpu string Set the number of millicores to request for the CPU, e.g. "100m" or "0.1". Overrides the value in "resources-config"
23
24
--custom-config string The name of a configMap that holds custom PostgreSQL configuration files used to override defaults.
24
25
-d, --database string If specified, sets the name of the initial database that is created for the user. Defaults to the value set in the PostgreSQL Operator configuration, or if that is not present, the name of the cluster
25
26
--disable-autofail Disables autofail capabitilies in the cluster following cluster initialization.
26
27
-h, --help help for cluster
27
28
-l, --labels string The labels to apply to this cluster.
29
+
--memory string Set the amount of RAM to request, e.g. 1GiB. Overrides the value in "resources-config"
28
30
--metrics Adds the crunchy-collect container to the database pod.
29
31
--node-label string The node label (key=value) to use in placing the primary database. If not set, any node is used.
30
32
--password string The password to use for standard user account created during cluster initialization.
@@ -88,4 +90,4 @@ pgo create cluster [flags]
88
90
89
91
*[pgo create](/pgo-client/reference/pgo_create/) - Create a Postgres Operator resource
90
92
91
-
###### Auto generated by spf13/cobra on 19-Mar-2020
93
+
###### Auto generated by spf13/cobra on 26-Mar-2020
Copy file name to clipboardExpand all lines: pgo/cmd/create.go
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,9 @@ var ArchiveFlag, DisableAutofailFlag, EnableAutofailFlag, PgbouncerFlag, Metrics
32
32
varBackrestRestoreFromstring
33
33
varCCPImagestring
34
34
varCCPImageTagstring
35
+
varCPURequeststring
35
36
varDatabasestring
37
+
varMemoryRequeststring
36
38
varPasswordstring
37
39
varSecretFromstring
38
40
varPoliciesFlag, PolicyFile, PolicyURLstring
@@ -254,10 +256,14 @@ func init() {
254
256
// flags for "pgo create cluster"
255
257
createClusterCmd.Flags().StringVarP(&CCPImage, "ccp-image", "", "", "The CCPImage name to use for cluster creation. If specified, overrides the value crunchy-postgres.")
256
258
createClusterCmd.Flags().StringVarP(&CCPImageTag, "ccp-image-tag", "c", "", "The CCPImageTag to use for cluster creation. If specified, overrides the pgo.yaml setting.")
259
+
createClusterCmd.Flags().StringVar(&CPURequest, "cpu", "", "Set the number of millicores to request for the CPU, e.g. "+
260
+
"\"100m\" or \"0.1\". Overrides the value in \"resources-config\"")
257
261
createClusterCmd.Flags().StringVarP(&CustomConfig, "custom-config", "", "", "The name of a configMap that holds custom PostgreSQL configuration files used to override defaults.")
258
262
createClusterCmd.Flags().StringVarP(&Database, "database", "d", "", "If specified, sets the name of the initial database that is created for the user. Defaults to the value set in the PostgreSQL Operator configuration, or if that is not present, the name of the cluster")
259
263
createClusterCmd.Flags().BoolVarP(&DisableAutofailFlag, "disable-autofail", "", false, "Disables autofail capabitilies in the cluster following cluster initialization.")
260
264
createClusterCmd.Flags().StringVarP(&UserLabels, "labels", "l", "", "The labels to apply to this cluster.")
265
+
createClusterCmd.Flags().StringVar(&MemoryRequest, "memory", "", "Set the amount of RAM to request, e.g. "+
266
+
"1GiB. Overrides the value in \"resources-config\"")
261
267
createClusterCmd.Flags().BoolVarP(&MetricsFlag, "metrics", "", false, "Adds the crunchy-collect container to the database pod.")
262
268
createClusterCmd.Flags().StringVarP(&NodeLabel, "node-label", "", "", "The node label (key=value) to use in placing the primary database. If not set, any node is used.")
263
269
createClusterCmd.Flags().StringVarP(&Password, "password", "", "", "The password to use for standard user account created during cluster initialization.")
0 commit comments