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
is a multi-master implementation of Postgres designed for high performance and
18
18
availability.
19
19
PGD generally requires deployment using
@@ -75,7 +75,7 @@ EDB Postgres Distributed for Kubernetes manages the following:
75
75
76
76
PGD groups assume full mesh connectivity of PGD nodes. Each node must be able to
77
77
connect to every other node using the appropriate connection string (a
78
-
`libpq`-style DSN). Write operations don't need to be sent to every node. PGD
78
+
`libpq`-style DSN). Write operations don't need to be sent to every node. PGD
79
79
takes care of replicating data after it's committed to one node.
80
80
81
81
For performance, we often recommend sending write operations mostly to a
@@ -126,7 +126,7 @@ To function in Kubernetes, containers are provided for each Postgres
126
126
distribution. These are the *operands*.
127
127
In addition, the operator images are kept in those same repositories.
128
128
129
-
See [EDB private image registries](identify_images/private_registries.md)
129
+
See [EDB private image registries](private_edb_registries.md)
130
130
for details on accessing the images.
131
131
132
132
### Kubernetes architecture
@@ -194,6 +194,6 @@ For more information, see ["Connectivity"](connectivity.md).
194
194
195
195
!!! Note Regions and availability zones
196
196
197
-
When creating Kubernetes clusters in different regions or availability zones for cross-regional replication,
198
-
ensure the clusters can communicate with each other by enabling network connectivity. Specifically, every service created with a `-node` or `-group` suffix must be discoverable by all other `-node` and `-group` services. You can achieve this by deploying a network connectivity application like
199
-
[Submariner](https://submariner.io/) on every cluster.
197
+
When creating Kubernetes clusters in different regions or availability zones for cross-regional replication,
198
+
ensure the clusters can communicate with each other by enabling network connectivity. Specifically, every service created with a `-node` or `-group` suffix must be discoverable by all other `-node` and `-group` services. You can achieve this by deploying a network connectivity application like
199
+
[Submariner](https://submariner.io/) on every cluster.
EDB Postgres Distributed for Kubernetes was designed to natively support TLS certificates.
7
7
To set up an PGD cluster, each PGD node requires:
8
8
9
-
- A server certification authority (CA) certificate
10
-
- A server TLS certificate signed by the server CA
11
-
- A client CA certificate
12
-
- A streaming replication client certificate generated by the client CA
9
+
- Server certificates configuration.
10
+
- Client certificates configuration.
13
11
14
12
!!! Note
15
13
You can find all the secrets used by each PGD node and the expiry dates in
16
14
the cluster (PGD node) status.
17
15
18
-
EDB Postgres Distributed for Kubernetes is very flexible when it comes to TLS certificates. It
19
-
operates primarily in two modes:
16
+
## Server certificates configuration
20
17
21
-
-**Operator managed**— Certificates are internally
22
-
managed by the operator in a fully automated way and signed using a CA created
23
-
by EDB Postgres Distributed for Kubernetes.
24
-
-**User provided**— Certificates are
25
-
generated outside the operator and imported in the cluster definition as
26
-
secrets. EDB Postgres Distributed for Kubernetes integrates itself with cert-manager.
18
+
The server certificate configuration is handled in the `spec.connectivity.tls.serverCert`
19
+
section of the PGDGroup custom resource. This configuration requires a server CA secret
20
+
and a cert-manager template to generate the TLS certificates needed for the underlying
21
+
Postgres instance to terminate TLS connections.
27
22
28
-
For more information, see the
23
+
The following assumptions must be met for this section to function correctly:
24
+
25
+
1. Cert-manager must be installed.
26
+
2. An issuer specified `spec.connectivity.tls.serverCert.certManager.issuerRef` is available
27
+
for the domain specified in `spec.connectivity.dns.domain` and any additional domains listed
28
+
in `spec.connectivity.tls.serverCert.certManager.spec.dnsNames`.
29
+
3. A server CA secret containing the public certificate of the CA used by the
30
+
issuer must be created.
31
+
32
+
!!! Note
33
+
The server CA secret specified by `spec.connectivity.tls.clientCert.serverCA`
34
+
will be referenced as `serverCASecret` in the underlying CNP nodes. The
35
+
public part, `ca.crt`, validates the server certificate and is included as `sslrootcert`
36
+
into client connection strings. The private part, `ca.key`, is used to automatically sign
37
+
the server SSL certificate, if a self-signed certificate is employed.
38
+
39
+
!!! Note
40
+
The server TLS secret generated by PGD group will be specified as the value of `serverTLSSecret`
41
+
in the underlying CNP nodes. For more information, refer to [server certificates](/postgres_for_kubernetes/latest/certificates/#server-certificates-1).
42
+
43
+
### DNS names
44
+
45
+
The operator will add the following `altDnsNames` to the server TLS certificate:
Alternatively, you can specify a secret containing the pre-provisioned client certificate
121
+
for the `streaming_replica` user using the
122
+
`spec.connectivity.tls.clientCert.preProvisioned.streamingReplica.secretRef` option. In this
123
+
case, the certificate lifecycle is managed entirely by a third party (manually or automatically),
124
+
by simply updating the content of the secret.
125
+
126
+
!!! Note
127
+
Regardless of how the client streaming replication certificate is provided, it will be
128
+
used as the value of `replicationTLSSecret` in the underlying CNP nodes. For more information,
129
+
refer to the section on [Client certificate](/postgres_for_kubernetes/latest/certificates/#client-certificate).
130
+
131
+
## TLS mode
132
+
133
+
You can configure the TLS mode, which determines how the server certificates are verified during
134
+
communication between nodes, using `spec.connectivity.tls.mode`. Its default value is
135
+
`verify-ca`. Note that the TLS mode cannot be changed once the PGD Group is set up. The
136
+
`mode` accepts the following values, as documented in [SSL Support](https://www.postgresql.org/docs/current/libpq-ssl.html#LIBPQ-SSL-SSLMODE-STATEMENTS) in the PostgreSQL documentation:
137
+
138
+
-`verify-full`
139
+
-`verify-ca`
140
+
-`required`
141
+
142
+
## Self-signed example
143
+
144
+
This example demonstrates how to use cert-manager to setup a self-signed CA and
145
+
generated required certificates.
146
+
147
+
First, we need to generate the server and client CA certificates. We will create two self-signed issuers,
148
+
`server-ca-issuer` and `client-ca-issuer`, in the target namespace.
149
+
150
+
```yaml
151
+
apiVersion: cert-manager.io/v1
152
+
kind: Issuer
153
+
metadata:
154
+
name: selfsigned-issuer
155
+
spec:
156
+
selfSigned: {}
157
+
---
158
+
apiVersion: cert-manager.io/v1
159
+
kind: Issuer
160
+
metadata:
161
+
name: server-ca-issuer
162
+
spec:
163
+
ca:
164
+
secretName: server-ca-key-pair
165
+
---
166
+
apiVersion: cert-manager.io/v1
167
+
kind: Issuer
168
+
metadata:
169
+
name: client-ca-issuer
170
+
spec:
171
+
ca:
172
+
secretName: client-ca-key-pair
173
+
```
174
+
175
+
With the following Certificate object, we can generate the private key and a signed
176
+
certificate from the issuer. The private key and signed certificate will be stored in the
177
+
secrets named `server-ca-key-pair` and `client-ca-key-pair`.
178
+
179
+
```yaml
180
+
apiVersion: cert-manager.io/v1
181
+
kind: Certificate
182
+
metadata:
183
+
name: server-ca
184
+
spec:
185
+
isCA: true
186
+
commonName: my-selfsigned-server-ca
187
+
secretName: server-ca-key-pair
188
+
privateKey:
189
+
algorithm: ECDSA
190
+
size: 256
191
+
issuerRef:
192
+
name: selfsigned-issuer
193
+
kind: Issuer
194
+
group: cert-manager.io
195
+
---
196
+
apiVersion: cert-manager.io/v1
197
+
kind: Certificate
198
+
metadata:
199
+
name: client-ca
200
+
spec:
201
+
isCA: true
202
+
commonName: my-selfsigned-client-ca
203
+
secretName: client-ca-key-pair
204
+
privateKey:
205
+
algorithm: ECDSA
206
+
size: 256
207
+
issuerRef:
208
+
name: selfsigned-issuer
209
+
kind: Issuer
210
+
group: cert-manager.io
211
+
```
212
+
213
+
We can now configure the PGD group. The `server-ca-key-pair` and `client-ca-key-pair`
214
+
will be used as the server CA secret and client CA secret, respectively. The cert-manager template
215
+
can be set up to reference the corresponding issuer to automatically generate the server TLS certificate
216
+
and client replication certificate.
217
+
218
+
```yaml
219
+
apiVersion: pgd.k8s.enterprisedb.io/v1beta1
220
+
kind: PGDGroup
221
+
metadata:
222
+
name: region-a
223
+
spec:
224
+
...
225
+
connectivity:
226
+
tls:
227
+
mode: verify-ca
228
+
clientCert:
229
+
caCertSecret: client-ca-key-pair
230
+
certManager:
231
+
spec:
232
+
issuerRef:
233
+
name: client-ca-issuer
234
+
kind: Issuer
235
+
group: cert-manager.io
236
+
serverCert:
237
+
caCertSecret: server-ca-key-pair
238
+
certManager:
239
+
spec:
240
+
issuerRef:
241
+
name: server-ca-issuer
242
+
kind: Issuer
243
+
group: cert-manager.io
244
+
245
+
```
246
+
247
+
For more information about how certificate works, see the
29
248
[EDB Postgres for Kubernetes documentation](/postgres_for_kubernetes/latest/certificates/).
0 commit comments