Skip to content

Commit

Permalink
docs: Add documentation about bouncer support & examples
Browse files Browse the repository at this point in the history
  • Loading branch information
oxyno-zeta committed Feb 29, 2024
1 parent feca25d commit 03f7e92
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 8 deletions.
16 changes: 16 additions & 0 deletions config/samples/engineconfiguration/full-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,19 @@ spec:
# Wait for linked resource to be deleted
# Default to false
waitLinkedResourcesDeletion: true
# User connections used for secret generation
# That will be used to generate secret with primary server as url or
# to use the pg bouncer one.
# Note: Operator won't check those values.
userConnections:
# Primary connection is referring to the primary node connection.
# If not being set, all values will be set from spec (host, port, uriArgs)
primaryConnection:
host: localhost
uriArgs: sslmode=disable
port: 5432
# Bouncer connection is referring to a pg bouncer node.
# bouncerConnection:
# host: localhost
# uriArgs: sslmode=disable
# port: 6432
4 changes: 3 additions & 1 deletion config/samples/userrole/managed-simple-rotation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ spec:
privileges:
- # Privilege for the selected database
privilege: OWNER
# Connection type to be used for secret generation (Can be set to BOUNCER if wanted and supported by engine configuration)
connectionType: PRIMARY
# Database link
database:
name: simple
# Generated secret name with information for the selected database
generatedSecretName: managed-simple-rotation
generatedSecretName: managed-simple-rotation
2 changes: 2 additions & 0 deletions config/samples/userrole/managed-simple.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ spec:
privileges:
- # Privilege for the selected database
privilege: OWNER
# Connection type to be used for secret generation (Can be set to BOUNCER if wanted and supported by engine configuration)
connectionType: PRIMARY
# Database link
database:
name: simple
Expand Down
16 changes: 9 additions & 7 deletions config/samples/userrole/provided-simple.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ spec:
mode: PROVIDED
# Privileges list
privileges:
- # Privilege for the selected database
privilege: WRITER
# Database link
database:
name: simple
# Generated secret name with information for the selected database
generatedSecretName: simple1
- # Privilege for the selected database
privilege: WRITER
# Connection type to be used for secret generation (Can be set to BOUNCER if wanted and supported by engine configuration)
connectionType: PRIMARY
# Database link
database:
name: simple
# Generated secret name with information for the selected database
generatedSecretName: simple1
# Import secret that will contain "USERNAME" and "PASSWORD" for provided mode
importSecretName: provided-simple
31 changes: 31 additions & 0 deletions docs/crds/PostgresqlEngineConfiguration.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,22 @@ All these names are available for `kubectl`:
| checkInterval | Interval between 2 connectivity check. Default is `30s`. | String | false |
| waitLinkedResourcesDeletion | Tell operator if it has to wait until all linked resources are deleted to delete current custom resource. If not, it won't be able to delete PostgresqlDatabase and PostgresqlUser after. Default value is `false`. | Boolean | false |
| secretName | Secret name in the same namespace has the current custom resource that contains user and password to be used to connect PostgreSQL engine. An example can be found [here](../../deploy/examples/engineconfiguration/engineconfigurationsecret.yaml) | String | true |
| userConnections | User connections used for secret generation. That will be used to generate secret with primary server as url or to use the pg bouncer one. Note: Operator won't check those values. | [UserConnections](#userconnections) | false |

### UserConnections

| Field | Description | Scheme | Required |
| ----- | ----------- | ------ | -------- |
| primaryConnection | Primary connection is referring to the primary node connection. If not being set, all values will be set from spec (host, port, uriArgs) | [GenericUserConnection](#genericuserconnection) | false |
| bouncerConnection | Bouncer connection is referring to a pg bouncer node. The default port will be 6432 if other fields are filled but not port. | [GenericUserConnection](#genericuserconnection) | false |

### GenericUserConnection

| Field | Description | Scheme | Required |
| ----- | ----------- | ------ | -------- |
| host | PostgreSQL Hostname | String | true |
| port | PostgreSQL Port. | Integer | false |
| uriArgs | PostgreSQL URI arguments like `sslmode=disabled` | String | false |

### PostgresqlEngineConfigurationStatus

Expand Down Expand Up @@ -78,4 +94,19 @@ spec:
# Wait for linked resource to be deleted
# Default to false
waitLinkedResourcesDeletion: true
# User connections used for secret generation
# That will be used to generate secret with primary server as url or
# to use the pg bouncer one.
# Note: Operator won't check those values.
userConnections:
# Primary connection is referring to the primary node connection.
primaryConnection:
host: localhost
uriArgs: sslmode=disable
port: 5432
# Bouncer connection is referring to a pg bouncer node.
# bouncerConnection:
# host: localhost
# uriArgs: sslmode=disable
# port: 6432
```
5 changes: 5 additions & 0 deletions docs/crds/PostgresqlUserRole.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ All these names are available for `kubectl`:
| Field | Description | Scheme | Required |
| ----- | ----------- | ------ | -------- |
| privilege | User privilege on database. Enumeration is `OWNER`, `WRITER`, `READER`. | String | true |
| connectionType | Connection type to be used for secret generation (Can be set to BOUNCER if wanted and supported by engine configuration). Enumeration is `PRIMARY`, `BOUNCER`. Default value is `PRIMARY` | String | false |
| database | [PostgresqlDatabase](./PostgresqlDatabase.md) object reference | [CRLink](#crlink) | true |
| generatedSecretName | Generated secret name used for secret generation. | String | true |

Expand Down Expand Up @@ -78,6 +79,8 @@ spec:
privileges:
- # Privilege for the selected database
privilege: WRITER
# Connection type to be used for secret generation (Can be set to BOUNCER if wanted and supported by engine configuration)
connectionType: PRIMARY
# Database link
database:
name: simple
Expand Down Expand Up @@ -120,6 +123,8 @@ spec:
privileges:
- # Privilege for the selected database
privilege: OWNER
# Connection type to be used for secret generation (Can be set to BOUNCER if wanted and supported by engine configuration)
connectionType: PRIMARY
# Database link
database:
name: simple
Expand Down

0 comments on commit 03f7e92

Please sign in to comment.