Skip to content
Snippets Groups Projects
Verified Commit acda4b46 authored by Vincent Sellier's avatar Vincent Sellier
Browse files

kafka: Allow to override the advertised local name

Otherwise, the certificates could not match the name
used by the client to reach the servers

Related to swh/infra/sysadm-environment#4815
parent bab2d2e9
No related branches found
No related tags found
1 merge request!606kafka: Allow to override the advertised local name
......@@ -115,6 +115,7 @@ kafka::clusters:
storage1.internal.staging.swh.network:
id: 2
public_hostname: broker1.journal.staging.swh.network
internal_advertised_name: journal1.internal.staging.swh.network
broker::heap_opts: "%{alias('kafka::broker::heap_opts')}"
superusers:
- User:swh-admin-olasd
......
......@@ -30,6 +30,7 @@ class profile::kafka::broker {
$public_hostname = pick($broker_config['public_hostname'], $internal_hostname.regsubst('\.internal', ''))
$internal_listener = $internal_hostname
$internal_advertised_name = pick($broker_config['internal_advertised_name'], $internal_hostname)
$public_listener_network = pick($kafka_cluster_config['public_listener_network'], lookup('internal_network'))
$public_listener = ip_for_network($public_listener_network)
......@@ -115,8 +116,8 @@ class profile::kafka::broker {
"EXTERNAL://${public_listener}:${public_tls_port}",
], ','),
'advertised.listeners' => join([
"INTERNAL_PLAINTEXT://${internal_hostname}:${plaintext_port}",
"INTERNAL://${internal_hostname}:${internal_tls_port}",
"INTERNAL_PLAINTEXT://${internal_advertised_name}:${plaintext_port}",
"INTERNAL://${internal_advertised_name}:${internal_tls_port}",
"EXTERNAL://${public_hostname}:${public_tls_port}",
], ','),
'listener.security.protocol.map' => join([
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment