Skip to content

Commit 455b791

Browse files
authored
Allow dynamic configuration update for controllers (#11999)
Signed-off-by: Gantigmaa Selenge <[email protected]>
1 parent a74ba03 commit 455b791

File tree

7 files changed

+360
-377
lines changed

7 files changed

+360
-377
lines changed

cluster-operator/src/main/java/io/strimzi/operator/cluster/model/KafkaConfiguration.java

Lines changed: 0 additions & 161 deletions
Original file line numberDiff line numberDiff line change
@@ -44,149 +44,6 @@ public class KafkaConfiguration extends AbstractConfiguration {
4444
DEFAULTS.put("min.insync.replicas", "1");
4545
}
4646

47-
/**
48-
* List of configuration options that are relevant to controllers and should be considered when deciding whether
49-
* a controller-only node needs to be rolled or not.
50-
*/
51-
private static final Set<String> CONTROLLER_RELEVANT_CONFIGS = Set.of(
52-
"alter.config.policy.class.name",
53-
"authorizer.class.name",
54-
"auto.create.topics.enable",
55-
"background.threads",
56-
"broker.heartbeat.interval.ms",
57-
"broker.rack",
58-
"broker.session.timeout.ms",
59-
"connection.failed.authentication.delay.ms",
60-
"connections.max.idle.ms",
61-
"connections.max.reauth.ms",
62-
"controlled.shutdown.enable",
63-
"controlled.shutdown.max.retries",
64-
"controlled.shutdown.retry.backoff.ms",
65-
"controller.listener.names",
66-
"controller.quorum.append.linger.ms",
67-
"controller.quorum.election.backoff.max.ms",
68-
"controller.quorum.election.timeout.ms",
69-
"controller.quorum.fetch.timeout.ms",
70-
"controller.quorum.request.timeout.ms",
71-
"controller.quorum.retry.backoff.ms",
72-
"controller.quorum.voters",
73-
"controller.quota.window.num",
74-
"controller.quota.window.size.seconds",
75-
"controller.socket.timeout.ms",
76-
"create.topic.policy.class.name",
77-
"default.replication.factor",
78-
"delete.topic.enable",
79-
"early.start.listeners",
80-
"kafka.metrics.polling.interval.secs",
81-
"kafka.metrics.reporters",
82-
"leader.imbalance.check.interval.seconds",
83-
"leader.imbalance.per.broker.percentage",
84-
"listener.name.controlplane-9090.ssl.keystore.location",
85-
"listener.name.controlplane-9090.ssl.keystore.password",
86-
"listener.name.controlplane-9090.ssl.keystore.type",
87-
"listener.name.controlplane-9090.ssl.truststore.location",
88-
"listener.name.controlplane-9090.ssl.truststore.password",
89-
"listener.name.controlplane-9090.ssl.truststore.type",
90-
"listener.name.controlplane-9090.ssl.client.auth",
91-
"listener.security.protocol.map",
92-
"listeners",
93-
"log.dir",
94-
"log.dirs",
95-
"min.insync.replicas",
96-
"max.connection.creation.rate",
97-
"max.connections.per.ip.overrides",
98-
"max.connections.per.ip",
99-
"max.connections",
100-
"metadata.log.dir",
101-
"metadata.log.max.record.bytes.between.snapshots",
102-
"metadata.log.max.snapshot.interval.ms",
103-
"metadata.log.segment.bytes",
104-
"metadata.log.segment.min.bytes",
105-
"metadata.log.segment.ms",
106-
"metadata.max.idle.interval.ms",
107-
"metadata.max.retention.bytes",
108-
"metadata.max.retention.ms",
109-
"metric.reporters",
110-
"metrics.num.samples",
111-
"metrics.recording.level",
112-
"metrics.sample.window.ms",
113-
"node.id",
114-
"num.io.threads",
115-
"num.network.threads",
116-
"num.partitions",
117-
"offsets.topic.replication.factor",
118-
"principal.builder.class",
119-
"process.roles",
120-
"remote.log.storage.system.enable",
121-
"replica.selector.class",
122-
"reserved.broker.max.id",
123-
"sasl.enabled.mechanisms",
124-
"sasl.kerberos.kinit.cmd",
125-
"sasl.kerberos.min.time.before.relogin",
126-
"sasl.kerberos.principal.to.local.rules",
127-
"sasl.kerberos.service.name",
128-
"sasl.kerberos.ticket.renew.jitter",
129-
"sasl.kerberos.ticket.renew.window.factor",
130-
"sasl.login.callback.handler.class",
131-
"sasl.login.class",
132-
"sasl.login.connect.timeout.ms",
133-
"sasl.login.read.timeout.ms",
134-
"sasl.login.refresh.buffer.seconds",
135-
"sasl.login.refresh.min.period.seconds",
136-
"sasl.login.refresh.window.factor",
137-
"sasl.login.refresh.window.jitter",
138-
"sasl.login.retry.backoff.max.ms",
139-
"sasl.login.retry.backoff.ms",
140-
"sasl.mechanism.controller.protocol",
141-
"sasl.oauthbearer.clock.skew.seconds",
142-
"sasl.oauthbearer.expected.audience",
143-
"sasl.oauthbearer.expected.issuer",
144-
"sasl.oauthbearer.jwks.endpoint.refresh.ms",
145-
"sasl.oauthbearer.jwks.endpoint.retry.backoff.max.ms",
146-
"sasl.oauthbearer.jwks.endpoint.retry.backoff.ms",
147-
"sasl.oauthbearer.jwks.endpoint.url",
148-
"sasl.oauthbearer.scope.claim.name",
149-
"sasl.oauthbearer.sub.claim.name",
150-
"sasl.oauthbearer.token.endpoint.url",
151-
"sasl.server.callback.handler.class",
152-
"sasl.server.max.receive.size",
153-
"security.providers",
154-
"server.max.startup.time.ms",
155-
"socket.connection.setup.timeout.max.ms",
156-
"socket.connection.setup.timeout.ms",
157-
"socket.listen.backlog.size",
158-
"socket.receive.buffer.bytes",
159-
"socket.request.max.bytes",
160-
"socket.send.buffer.bytes",
161-
"ssl.cipher.suites",
162-
"ssl.client.auth",
163-
"ssl.enabled.protocols",
164-
"ssl.endpoint.identification.algorithm",
165-
"ssl.engine.factory.class",
166-
"ssl.key.password",
167-
"ssl.keymanager.algorithm",
168-
"ssl.keystore.certificate.chain",
169-
"ssl.keystore.key",
170-
"ssl.keystore.location",
171-
"ssl.keystore.password",
172-
"ssl.keystore.type",
173-
"ssl.principal.mapping.rules",
174-
"ssl.protocol",
175-
"ssl.provider",
176-
"ssl.secure.random.implementation",
177-
"ssl.trustmanager.algorithm",
178-
"ssl.truststore.certificates",
179-
"ssl.truststore.location",
180-
"ssl.truststore.password",
181-
"ssl.truststore.type",
182-
"super.users",
183-
"transaction.state.log.min.isr",
184-
"transaction.state.log.replication.factor",
185-
"queued.max.requests",
186-
"queued.max.requests.bytes",
187-
"unclean.leader.election.enable"
188-
);
189-
19047
/**
19148
* Copy constructor which creates new instance of the Kafka Configuration from existing configuration. It is
19249
* useful when you need to modify an instance of the configuration without permanently changing the original.
@@ -287,24 +144,6 @@ public Set<String> unknownConfigsWithValues(KafkaVersion kafkaVersion) {
287144
return result;
288145
}
289146

290-
/**
291-
* Return the config properties with their values in this KafkaConfiguration which are known to be relevant for the
292-
* Kafka controller nodes.
293-
*
294-
* @return The configuration options relevant for controllers
295-
*/
296-
public Set<String> controllerConfigsWithValues() {
297-
Set<String> result = new HashSet<>();
298-
299-
for (Map.Entry<String, String> e :this.asOrderedProperties().asMap().entrySet()) {
300-
if (CONTROLLER_RELEVANT_CONFIGS.contains(e.getKey())) {
301-
result.add(e.getKey() + "=" + e.getValue());
302-
}
303-
}
304-
305-
return result;
306-
}
307-
308147
/**
309148
* @return True if the configuration is empty. False otherwise.
310149
*/

cluster-operator/src/main/java/io/strimzi/operator/cluster/operator/assembly/KafkaReconciler.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -723,12 +723,6 @@ protected Future<Void> perBrokerKafkaConfiguration(MetricsAndLogging metricsAndL
723723
// We collect the configuration options related to various plugins
724724
nodeConfiguration += kc.unknownConfigsWithValues(kafka.getKafkaVersion()).toString();
725725

726-
// We collect the information relevant to controller-only nodes
727-
if (pool.isController() && !pool.isBroker()) {
728-
// For controllers only, we extract the controller-relevant configurations and use it in the configuration annotations
729-
nodeConfiguration = kc.controllerConfigsWithValues().toString();
730-
}
731-
732726
// We store hash of the broker configurations for later use in Pod and in rolling updates
733727
this.brokerConfigurationHash.put(nodeId, Util.hashStub(nodeConfiguration));
734728

0 commit comments

Comments
 (0)