Skip to content

Commit eb8129b

Browse files
Document and test the configuration option "requestedSecretLifetime" (#832)
1 parent adcf7d7 commit eb8129b

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

docs/modules/kafka/pages/usage-guide/security.adoc

+5
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,16 @@ spec:
2222
serverSecretClass: tls # <1>
2323
internalSecretClass: kafka-internal-tls # <2>
2424
brokers:
25+
config:
26+
requestedSecretLifetime: 7d # <3>
2527
roleGroups:
2628
default:
2729
replicas: 3
2830
----
2931
<1> The `spec.clusterConfig.tls.serverSecretClass` refers to the client-to-server encryption. Defaults to the `tls` secret. Can be deactivated by setting `serverSecretClass` to `null`.
3032
<2> The `spec.clusterConfig.tls.internalSecretClass` refers to the broker-to-broker internal encryption. This must be explicitly set or defaults to `tls`. May be disabled by setting `internalSecretClass` to `null`.
33+
<3> The lifetime for autoTls certificates generated by the secret operator.
34+
Only a lifetime up to the `maxCertificateLifetime` setting in the SecretClass is applied.
3135

3236
The `tls` secret is deployed from the xref:secret-operator:index.adoc[Secret Operator] and looks like this:
3337

@@ -46,6 +50,7 @@ spec:
4650
name: secret-provisioner-tls-ca
4751
namespace: default
4852
autoGenerate: true
53+
maxCertificateLifetime: 15d
4954
----
5055

5156
You can create your own secrets and reference them e.g. in the `spec.clusterConfig.tls.serverSecretClass` or `spec.clusterConfig.tls.internalSecretClass` to use different certificates.

tests/templates/kuttl/smoke/30-assert.yaml.j2

+25
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,31 @@ spec:
3838
memory: 128Mi
3939
{% endif %}
4040
terminationGracePeriodSeconds: 1800
41+
volumes:
42+
{% if test_scenario['values']['use-client-tls'] == 'true' %}
43+
- name: tls-kcat
44+
ephemeral:
45+
volumeClaimTemplate:
46+
metadata:
47+
annotations:
48+
secrets.stackable.tech/backend.autotls.cert.lifetime: 7d
49+
- name: tls-kafka-server
50+
ephemeral:
51+
volumeClaimTemplate:
52+
metadata:
53+
annotations:
54+
secrets.stackable.tech/backend.autotls.cert.lifetime: 7d
55+
{% endif %}
56+
- name: tls-kafka-internal
57+
ephemeral:
58+
volumeClaimTemplate:
59+
metadata:
60+
annotations:
61+
secrets.stackable.tech/backend.autotls.cert.lifetime: 7d
62+
- name: log-config
63+
- name: config
64+
- name: listener-broker
65+
- name: log
4166
status:
4267
readyReplicas: 1
4368
replicas: 1

tests/templates/kuttl/smoke/30-install-kafka.yaml.j2

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ spec:
3838
config:
3939
logging:
4040
enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }}
41+
requestedSecretLifetime: 7d
4142
roleGroups:
4243
default:
4344
replicas: 1

0 commit comments

Comments
 (0)