reflect feedback and updated docs
This commit is contained in:
		
							parent
							
								
									236fbbf2c6
								
							
						
					
					
						commit
						bdda618ad4
					
				|  | @ -110,9 +110,10 @@ Those are top-level keys, containing both leaf keys and groups. | ||||||
| 
 | 
 | ||||||
| * **min_instances** | * **min_instances** | ||||||
|   operator will run at least the number of instances for any given Postgres |   operator will run at least the number of instances for any given Postgres | ||||||
|   cluster equal to the value of this parameter, except for standby clusters |   cluster equal to the value of this parameter. Standby clusters can still run | ||||||
|   which run with one pod if `numberOfInstances` is set to 1. When `-1` is |   with `numberOfInstances: 1` as this is the [recommended setup](../user.md#setting-up-a-standby-cluster). | ||||||
|   specified for `min_instances`, no limits are applied. The default is `-1`. |   When `-1` is specified for `min_instances`, no limits are applied. The default | ||||||
|  |   is `-1`. | ||||||
| 
 | 
 | ||||||
| * **resync_period** | * **resync_period** | ||||||
|   period between consecutive sync requests. The default is `30m`. |   period between consecutive sync requests. The default is `30m`. | ||||||
|  |  | ||||||
							
								
								
									
										51
									
								
								docs/user.md
								
								
								
								
							
							
						
						
									
										51
									
								
								docs/user.md
								
								
								
								
							|  | @ -254,29 +254,22 @@ spec: | ||||||
| 
 | 
 | ||||||
| ## How to clone an existing PostgreSQL cluster | ## How to clone an existing PostgreSQL cluster | ||||||
| 
 | 
 | ||||||
| You can spin up a new cluster as a clone of the existing one, using a clone | You can spin up a new cluster as a clone of the existing one, using a `clone` | ||||||
| section in the spec. There are two options here: | section in the spec. There are two options here: | ||||||
| 
 | 
 | ||||||
| * Clone directly from a source cluster using `pg_basebackup` | * Clone from an S3 bucket (recommended) | ||||||
| * Clone from an S3 bucket | * Clone directly from a source cluster | ||||||
| 
 | 
 | ||||||
| ### Clone directly | Note, that cloning can also be used for [major version upgrades](administrator.md#minor-and-major-version-upgrade) | ||||||
| 
 | of PostgreSQL. | ||||||
| ```yaml |  | ||||||
| spec: |  | ||||||
|   clone: |  | ||||||
|     cluster: "acid-batman" |  | ||||||
| ``` |  | ||||||
| 
 |  | ||||||
| Here `cluster` is a name of a source cluster that is going to be cloned. The |  | ||||||
| cluster to clone is assumed to be running and the clone procedure invokes |  | ||||||
| `pg_basebackup` from it. The operator will setup the cluster to be cloned to |  | ||||||
| connect to the service of the source cluster by name (if the cluster is called |  | ||||||
| test, then the connection string will look like host=test port=5432), which |  | ||||||
| means that you can clone only from clusters within the same namespace. |  | ||||||
| 
 | 
 | ||||||
| ### Clone from S3 | ### Clone from S3 | ||||||
| 
 | 
 | ||||||
|  | Cloning from S3 has the advantage that there is no impact on your production | ||||||
|  | database. A new Postgres cluster is created by restoring the data of another | ||||||
|  | source cluster. If you create it in the same Kubernetes environment, use a | ||||||
|  | different name. | ||||||
|  | 
 | ||||||
| ```yaml | ```yaml | ||||||
| spec: | spec: | ||||||
|   clone: |   clone: | ||||||
|  | @ -287,7 +280,8 @@ spec: | ||||||
| 
 | 
 | ||||||
| Here `cluster` is a name of a source cluster that is going to be cloned. A new | Here `cluster` is a name of a source cluster that is going to be cloned. A new | ||||||
| cluster will be cloned from S3, using the latest backup before the `timestamp`. | cluster will be cloned from S3, using the latest backup before the `timestamp`. | ||||||
| In this case, `uid` field is also mandatory - operator will use it to find a | Note, that a time zone is required for `timestamp` in the format of +00:00 which | ||||||
|  | is UTC. The `uid` field is also mandatory. The operator will use it to find a | ||||||
| correct key inside an S3 bucket. You can find this field in the metadata of the | correct key inside an S3 bucket. You can find this field in the metadata of the | ||||||
| source cluster: | source cluster: | ||||||
| 
 | 
 | ||||||
|  | @ -299,9 +293,6 @@ metadata: | ||||||
|   uid: efd12e58-5786-11e8-b5a7-06148230260c |   uid: efd12e58-5786-11e8-b5a7-06148230260c | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
| Note that timezone is required for `timestamp`. Otherwise, offset is relative |  | ||||||
| to UTC, see [RFC 3339 section 5.6) 3339 section 5.6](https://www.ietf.org/rfc/rfc3339.txt). |  | ||||||
| 
 |  | ||||||
| For non AWS S3 following settings can be set to support cloning from other S3 | For non AWS S3 following settings can be set to support cloning from other S3 | ||||||
| implementations: | implementations: | ||||||
| 
 | 
 | ||||||
|  | @ -317,8 +308,22 @@ spec: | ||||||
|     s3_force_path_style: true |     s3_force_path_style: true | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
| Note, that cloning can also be used for [major version upgrades](administrator.md#minor-and-major-version-upgrade) | ### Clone directly | ||||||
| of PostgreSQL. | 
 | ||||||
|  | Another way to get a fresh copy of your source DB cluster is via basebackup. To | ||||||
|  | use this feature simply leave out the timestamp field from the clone section. | ||||||
|  | The operator will connect to the service of the source cluster by name. If the | ||||||
|  | cluster is called test, then the connection string will look like host=test | ||||||
|  | port=5432), which means that you can clone only from clusters within the same | ||||||
|  | namespace. | ||||||
|  | 
 | ||||||
|  | ```yaml | ||||||
|  | spec: | ||||||
|  |   clone: | ||||||
|  |     cluster: "acid-batman" | ||||||
|  | ``` | ||||||
|  | 
 | ||||||
|  | Be aware that on a busy source database this can result in an elevated load! | ||||||
| 
 | 
 | ||||||
| ## Setting up a standby cluster | ## Setting up a standby cluster | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1049,11 +1049,11 @@ func (c *Cluster) getNumberOfInstances(spec *acidv1.PostgresSpec) int32 { | ||||||
| 	newcur := cur | 	newcur := cur | ||||||
| 
 | 
 | ||||||
| 	if spec.StandbyCluster != nil { | 	if spec.StandbyCluster != nil { | ||||||
| 		if newcur > 1 { | 		if newcur == 1 { | ||||||
| 			c.logger.Warningf("operator only supports standby clusters with 1 pod") |  | ||||||
| 		} else { |  | ||||||
| 			min = newcur | 			min = newcur | ||||||
| 			max = newcur | 			max = newcur | ||||||
|  | 		} else { | ||||||
|  | 			c.logger.Warningf("operator only supports standby clusters with 1 pod") | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| 	if max >= 0 && newcur > max { | 	if max >= 0 && newcur > max { | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue