-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add concepts page on temporary credentials lifetime (#689)
* Add concepts page on temporary credentials lifetime Co-authored-by: Razvan-Daniel Mihai <razvan.mihai@stackable.tech> * Apply suggestions from code review Co-authored-by: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> * typo * Better explain checking the lifetime * fix rendering * Rename section to Pod lifetime annotations --------- Co-authored-by: Razvan-Daniel Mihai <razvan.mihai@stackable.tech> Co-authored-by: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com>
- Loading branch information
1 parent
8b30710
commit 00e2b65
Showing
5 changed files
with
101 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
92 changes: 92 additions & 0 deletions
92
modules/concepts/pages/operations/temporary_credentials_lifetime.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
= Temporary credentials lifetime | ||
:description: Customize the lifetime of temporary credentials. | ||
|
||
== Usages | ||
|
||
=== TLS certificates | ||
|
||
Currently the only temporary credentials are TLS certificates. | ||
|
||
Many products use TLS to secure the communications, often times customers use the xref:secret-operator:secretclass.adoc#backend-autotls[secret-operator autoTls] backend to create TLS certificates for the Pods on the fly. | ||
To increase security, these temporary credentials have a short lifetime by default, which will result in e.g. Trino coordinator Pods restarting every ~24 hours (minus some safety buffer) to avoid using expired certificates. | ||
|
||
== Configure the lifetime | ||
|
||
In high load production environments, restarting Pods can be a costly operation, as it can disrupt services and in some cases even lead to data loss. | ||
To avoid frequent restarts, the lifetime of all temporary credentials (such as the TLS certificates) can be increased as needed. | ||
|
||
Here is an example for configuring the temporary credentials lifetime to 7 days in a HDFS stacklet. | ||
It should result in the HDFS Pods restarting weekly instead of daily: | ||
|
||
[source,yaml] | ||
---- | ||
--- | ||
apiVersion: hdfs.stackable.tech/v1alpha1 | ||
kind: HdfsCluster | ||
metadata: | ||
name: hdfs | ||
spec: | ||
nameNodes: | ||
config: | ||
requestedSecretLifetime: 7d # <1> | ||
roleGroups: | ||
default: | ||
replicas: 2 | ||
dataNodes: | ||
config: | ||
requestedSecretLifetime: 7d # <2> | ||
roleGroups: | ||
default: | ||
replicas: 2 | ||
journalNodes: | ||
roleGroups: | ||
default: | ||
replicas: 3 | ||
config: | ||
requestedSecretLifetime: 7d # <3> | ||
---- | ||
<1> The lifetime of the TLS certificates for *all* NameNode roleGroups is set to 7 days. | ||
<2> The lifetime of the TLS certificates for *all* DataNode roleGroups is set to 7 days. | ||
<3> The lifetime of the TLS certificates for the `default` JournalNode group is set to 7 days. | ||
|
||
NOTE: The configuration for the JournalNodes is done at roleGroup level for demonstration purposes. | ||
|
||
=== TLS certificate lifetimes | ||
|
||
Even though operators allow setting this property to a value of your choice, the xref:secret-operator:index.adoc[secret-operator] will not exceed the `maxCertificateLifetime` value specified in SecretClass creating the TLS certificates (see xref:secret-operator/secretclass.adoc#certificate_lifetime). | ||
|
||
=== Operator support | ||
|
||
Similar to the example above, users can configure the lifetime of temporary credentials for the following operators: | ||
|
||
* Apache Druid | ||
* Apache Hadoop | ||
* Apache HBase | ||
* Apache NiFi | ||
* Apache Spark | ||
* Apache Zookeeper | ||
* Trino | ||
|
||
== Pod lifetime annotations | ||
|
||
After configuring the lifetime as described above you could simply observe your stacklet for a week/month (or whatever your new lifetime is), to see if your changes take effect. | ||
However, it's much quicker to check at what point of time your Pods will be restarted next. | ||
|
||
Pods are not restarted "randomly" by Stackable operators, but in a predicable manner. | ||
When a temporary credential is added to a Pod, an annotation is added as well. | ||
It starts with `restarter.stackable.tech/expires-at.` and instructs the xref:commons-operator:restarter.adoc[restart-controller] to restart the Pod once the specified point in time is reached. | ||
|
||
Given the following Pod | ||
|
||
[source,yaml] | ||
---- | ||
kind: Pod | ||
metadata: | ||
annotations: | ||
restarter.stackable.tech/expires-at.b887492af14bfe84f10cb2ff1b60acb0: "2024-12-05T14:03:47.131570189+00:00" | ||
restarter.stackable.tech/expires-at.ea77192c1184326d33e8ee32cfe921ea: "2024-12-05T15:49:10.043722965+00:00" | ||
---- | ||
|
||
You can always determine the instant the Pod will be restarted by the xref:commons-operator:restarter.adoc[restart-controller] by taking the earliest timestamp, `2024-12-05T14:03:47.131570189+00:00` in this case. | ||
|
||
You can use this timestamp to check if your changes have been applied as intended. |