Skip to content

Commit 92feb27

Browse files
authored
chore: Increase coordinator temporary credentials lifetime (#694)
* chore: Increase coordinator temporary credentials lifetime * changelog * docs: Document lifetimes
1 parent 16c8054 commit 92feb27

File tree

3 files changed

+33
-6
lines changed

3 files changed

+33
-6
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ All notable changes to this project will be documented in this file.
1010
config property `requestedSecretLifetime`. This helps reduce frequent Pod restarts ([#676]).
1111
- Run a `containerdebug` process in the background of each Trino container to collect debugging information ([#687]).
1212

13+
## Changed
14+
15+
- Increased the default temporary secret lifetime for coordinators from 1 day to 15 days.
16+
This is because Trino currently does not offer a HA setup for them, a restart kills all running queries ([#694]).
17+
1318
### Fixed
1419

1520
- Fix OIDC endpoint construction in case the `rootPath` does have a trailing slash ([#673]).
@@ -21,6 +26,7 @@ All notable changes to this project will be documented in this file.
2126
[#673]: https://github.com/stackabletech/trino-operator/pull/673
2227
[#676]: https://github.com/stackabletech/trino-operator/pull/676
2328
[#687]: https://github.com/stackabletech/trino-operator/pull/687
29+
[#694]: https://github.com/stackabletech/trino-operator/pull/694
2430

2531
## [24.11.0] - 2024-11-18
2632

deploy/helm/trino-operator/crds/crds.yaml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,10 @@ spec:
298298
nullable: true
299299
type: string
300300
requestedSecretLifetime:
301-
description: Request secret (currently only autoTls certificates) lifetime from the secret operator, e.g. `7d`, or `30d`. This can be shortened by the `maxCertificateLifetime` setting on the SecretClass issuing the TLS certificate.
301+
description: |-
302+
Request secret (currently only autoTls certificates) lifetime from the secret operator, e.g. `7d`, or `30d`. This can be shortened by the `maxCertificateLifetime` setting on the SecretClass issuing the TLS certificate.
303+
304+
Defaults to `15d` for coordinators (as currently a restart kills all running queries) and `1d` for workers.
302305
nullable: true
303306
type: string
304307
resources:
@@ -571,7 +574,10 @@ spec:
571574
nullable: true
572575
type: string
573576
requestedSecretLifetime:
574-
description: Request secret (currently only autoTls certificates) lifetime from the secret operator, e.g. `7d`, or `30d`. This can be shortened by the `maxCertificateLifetime` setting on the SecretClass issuing the TLS certificate.
577+
description: |-
578+
Request secret (currently only autoTls certificates) lifetime from the secret operator, e.g. `7d`, or `30d`. This can be shortened by the `maxCertificateLifetime` setting on the SecretClass issuing the TLS certificate.
579+
580+
Defaults to `15d` for coordinators (as currently a restart kills all running queries) and `1d` for workers.
575581
nullable: true
576582
type: string
577583
resources:
@@ -873,7 +879,10 @@ spec:
873879
nullable: true
874880
type: string
875881
requestedSecretLifetime:
876-
description: Request secret (currently only autoTls certificates) lifetime from the secret operator, e.g. `7d`, or `30d`. This can be shortened by the `maxCertificateLifetime` setting on the SecretClass issuing the TLS certificate.
882+
description: |-
883+
Request secret (currently only autoTls certificates) lifetime from the secret operator, e.g. `7d`, or `30d`. This can be shortened by the `maxCertificateLifetime` setting on the SecretClass issuing the TLS certificate.
884+
885+
Defaults to `15d` for coordinators (as currently a restart kills all running queries) and `1d` for workers.
877886
nullable: true
878887
type: string
879888
resources:
@@ -1146,7 +1155,10 @@ spec:
11461155
nullable: true
11471156
type: string
11481157
requestedSecretLifetime:
1149-
description: Request secret (currently only autoTls certificates) lifetime from the secret operator, e.g. `7d`, or `30d`. This can be shortened by the `maxCertificateLifetime` setting on the SecretClass issuing the TLS certificate.
1158+
description: |-
1159+
Request secret (currently only autoTls certificates) lifetime from the secret operator, e.g. `7d`, or `30d`. This can be shortened by the `maxCertificateLifetime` setting on the SecretClass issuing the TLS certificate.
1160+
1161+
Defaults to `15d` for coordinators (as currently a restart kills all running queries) and `1d` for workers.
11501162
nullable: true
11511163
type: string
11521164
resources:

rust/crd/src/lib.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,12 +435,14 @@ pub struct TrinoConfig {
435435

436436
/// Request secret (currently only autoTls certificates) lifetime from the secret operator, e.g. `7d`, or `30d`.
437437
/// This can be shortened by the `maxCertificateLifetime` setting on the SecretClass issuing the TLS certificate.
438+
///
439+
/// Defaults to `15d` for coordinators (as currently a restart kills all running queries)
440+
/// and `1d` for workers.
438441
#[fragment_attrs(serde(default))]
439442
pub requested_secret_lifetime: Option<Duration>,
440443
}
441444

442445
impl TrinoConfig {
443-
const DEFAULT_SECRET_LIFETIME: Duration = Duration::from_days_unchecked(1);
444446
fn default_config(
445447
cluster_name: &str,
446448
role: &TrinoRole,
@@ -454,6 +456,13 @@ impl TrinoConfig {
454456
TrinoRole::Coordinator => DEFAULT_COORDINATOR_GRACEFUL_SHUTDOWN_TIMEOUT,
455457
TrinoRole::Worker => DEFAULT_WORKER_GRACEFUL_SHUTDOWN_TIMEOUT,
456458
};
459+
let requested_secret_lifetime = match role {
460+
// TODO: Once Trino supports a HA setup for coordinators we should decrease this!
461+
// See https://github.com/stackabletech/trino-operator/issues/693
462+
// and https://github.com/stackabletech/decisions/issues/38 for details
463+
TrinoRole::Coordinator => Duration::from_days_unchecked(15),
464+
TrinoRole::Worker => Duration::from_days_unchecked(1),
465+
};
457466

458467
TrinoConfigFragment {
459468
logging: product_logging::spec::default_logging(),
@@ -478,7 +487,7 @@ impl TrinoConfig {
478487
query_max_memory: None,
479488
query_max_memory_per_node: None,
480489
graceful_shutdown_timeout: Some(graceful_shutdown_timeout),
481-
requested_secret_lifetime: Some(Self::DEFAULT_SECRET_LIFETIME),
490+
requested_secret_lifetime: Some(requested_secret_lifetime),
482491
}
483492
}
484493
}

0 commit comments

Comments
 (0)