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
K8SPXC- 1494 Documented custom duration setup for TLS and CA (#271)
K8SPXC-1494 Documented TLS certificate and CA certificate validity durations in operator and cert-manager documentation. Added rules and limitations for customizing certificate durations.
modified: docs/operator.md
modified: docs/tls-cert-manager.md
Copy file name to clipboardExpand all lines: docs/backups-restore-to-new-cluster.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,7 +71,7 @@ Configure the `PerconaXtraDBClusterRestore` Custom Resource. Specify the followi
71
71
and the backup name.
72
72
* the necessary [storage configuration keys](backups-storage.md#configure-storage-for-backups), just like in the `deploy/cr.yaml` file of the source cluster.
73
73
* `verifyTLS` to verify the storage server TLS certificate
74
-
* the custom TLS configuration if you use it for backups. Refer to the [backups-storage.md#configure-tls-verification-with-custom-certificates-for-s3-storage] section for more information.
74
+
* the custom TLS configuration if you use it for backups. Refer to the [Configure TLS verification with custom certificates for S3 storage](backups-storage.md#configure-tls-verification-with-custom-certificates-for-s3-storage) section for more information.
Validity period for TLS certificates. Minimum required validity is 1 hour. Durations lower than 1 hour are rejected. Setting the duration to exactly 1 hour prevents the Operator from generating the correct certificate object.
245
+
246
+
| Value type | Example |
247
+
| ----------- | ---------- |
248
+
| :material-code-string: string |`2160h`|
249
+
250
+
### `tls.caValidityDuration`
251
+
252
+
Validity period for CA certificate. Minimum accepted duration is 730 hours (approximately 30 days). Setting this value to exactly 730 hours prevents the Operator from generating the correct certificate object. You must set this value greater than 730 hours.
253
+
254
+
| Value type | Example |
255
+
| ----------- | ---------- |
256
+
| :material-code-string: string |`26280h`|
257
+
242
258
### `tls.SANs`
243
259
244
260
Additional domains (SAN) to be added to the TLS certificate within the extended cert-manager configuration.
@@ -2540,7 +2556,7 @@ The timeout value in seconds, after which backup job will automatically fail.
2540
2556
| ----------- | ---------- |
2541
2557
| :material-numeric-1-box: int |`3600`|
2542
2558
2543
-
### backup.startingDeadlineSeconds
2559
+
### `backup.startingDeadlineSeconds`
2544
2560
2545
2561
The maximum time in seconds for a backup to start. The Operator compares the timestamp of the backup object against the current time. If the backup is not started within the set time, the Operator automatically marks it as "failed".
2546
2562
@@ -3023,6 +3039,14 @@ configuration file. This Custom Resource contains the following options:
3023
3039
| credentialsSecret| string | The Secret name for the backup | true |
Once you create the database with the Operator, it will automatically trigger the cert-manager to create certificates. Whenever you check certificates for expiration, you will find that they are valid and short-term.
68
+
At this point, you can move on to [deploying the Operator and your database cluster](kubectl.md).
69
+
70
+
## Customize certificate duration for cert-manager
71
+
72
+
When you deploy the cluster using the default configuration, the Operator triggers the cert-manager to create certificates
73
+
with default duration of 90 days.
74
+
75
+
You can also customize the certificate duration. For example, to align certificate lifetimes with your organization’s security and compliance policies.
76
+
77
+
### Rules and limitations
78
+
79
+
Check the following rules and limitations for setting up the certificate duration:
80
+
81
+
1. You can set the duration **only when you create a new cluster**. Updating it in a running cluster is not supported.
82
+
2. The TLS certificate duration is subject to the following requirements:
83
+
84
+
- The minimum accepted value is 1 hour. Durations below 1 hour are rejected.
85
+
- Do **not**set the duration to exactly 1 hour; the Operator will fail to generate the correct certificate object if you do.
86
+
- By default, cert-manager starts the renewal process when a certificate has one-third of its lifetime remaining, ensuring renewal before expiration. For example, if a certificate is valid for 1 hour, renewal will begin after approximately 40 minutes.
87
+
88
+
3. Minimum CA certificate duration is 730 hours (approximately 30 days). Do not set the duration to exactly 730 hours; the Operator will fail to generate the correct certificate object if you do.
89
+
90
+
### Configuration
91
+
92
+
To set the custom duration, specify the following options in the Custom Resource:
93
+
94
+
*`.spec.tls.certValidityDuration` – validity period for TLS certificates
95
+
*`.spec.tls.caValidityDuration` – validity period for the Certificate Authority (CA)
96
+
97
+
Here's the example configuration:
98
+
99
+
```yaml
100
+
tls:
101
+
enabled: true
102
+
certValidityDuration: 2160h
103
+
caValidityDuration: 26280h
104
+
```
105
+
106
+
Create a new cluster with this configuration:
107
+
108
+
```bash
109
+
kubectl -f deploy/cr.yaml -n <namespace>
110
+
```
111
+
112
+
To verify the durations, you can [check certificates for expiration](tls-update.md#check-your-certificates-for-expiration) at any time. This ensures your certificates are valid and helps you plan for renewals before they expire.
Copy file name to clipboardExpand all lines: docs/tls-update.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ If you [use cert-manager](tls-cert-manager.md):
17
17
1. Check the necessary secrets names (`cluster1-ssl` and
18
18
`cluster1-ssl-internal` by default):
19
19
20
-
```{.bash data-prompt="$" }
20
+
```bash
21
21
kubectl get certificate
22
22
```
23
23
@@ -90,9 +90,9 @@ as follows.
90
90
and the TLS certificate key (`tls.key.old`):
91
91
92
92
```bash
93
-
kubectl get secret/ps-cluster1-ssl -o jsonpath='{.data.ca\.crt}' | base64 --decode > ca.pem.old
94
-
kubectl get secret/ps-cluster1-ssl -o jsonpath='{.data.tls\.crt}' | base64 --decode > tls.pem.old
95
-
kubectl get secret/ps-cluster1-ssl -o jsonpath='{.data.tls\.key}' | base64 --decode > tls.key.old
93
+
kubectl get secret/cluster1-ssl -o jsonpath='{.data.ca\.crt}' | base64 --decode > ca.pem.old
94
+
kubectl get secret/cluster1-ssl -o jsonpath='{.data.tls\.crt}' | base64 --decode > tls.pem.old
95
+
kubectl get secret/cluster1-ssl -o jsonpath='{.data.tls\.key}' | base64 --decode > tls.key.old
96
96
```
97
97
98
98
3. Combine new and current `ca.pem` into a `ca.pem.combined` file:
@@ -104,11 +104,11 @@ as follows.
104
104
4. Create a new Secrets object with the *old* TLS certificate (`tls.pem.old`) and key (`tls.key.old`), but a *new combined* `ca.pem` (`ca.pem.combined`):
5. The cluster will go through a rolling restart. This process will not cause issues, because every node has the old TLS certificate/key, and both new
@@ -117,7 +117,7 @@ as follows.
117
117
6. Create a new Secrets object again. This time use a new TLS certificate (`server.pem` in the example) and a new TLS key (`server-key.pem`), and again the combined CA certificate (`ca.pem.combined`):
118
118
119
119
``` bash
120
-
kubectl create secret generic ps-cluster1-ssl \
120
+
kubectl create secret generic cluster1-ssl \
121
121
--from-file=tls.crt=server.pem \
122
122
--from-file=tls.key=server-key.pem \
123
123
--from-file=ca.crt=ca.pem.combined \
@@ -133,7 +133,7 @@ as follows.
133
133
its key (`server-key.pem`), and only the new CA certificate (`ca.pem`):
0 commit comments