Skip to content

Commit 26b1220

Browse files
authored
Deprecate -nodeport discovery ConfigMap (#813)
* Document -nodeport discovery as deprecated See #765 * Add deprecation warning to -nodeport discovery configmaps * Changelog * Fix import warning
1 parent 682c9f7 commit 26b1220

File tree

3 files changed

+30
-10
lines changed

3 files changed

+30
-10
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
44

55
## [Unreleased]
66

7+
### Deprecated
8+
9+
- The `-nodeport` discovery ConfigMaps have been deprecated for removal ([#813]).
10+
- Any existing uses should be migrated to the primary discovery ConfigMap instead.
11+
712
### Added
813

914
- The lifetime of auto generated TLS certificates is now configurable with the role and roleGroup
@@ -25,6 +30,7 @@ All notable changes to this project will be documented in this file.
2530
[#796]: https://github.com/stackabletech/kafka-operator/pull/796
2631
[#803]: https://github.com/stackabletech/kafka-operator/pull/803
2732
[#809]: https://github.com/stackabletech/kafka-operator/pull/809
33+
[#813]: https://github.com/stackabletech/kafka-operator/pull/813
2834

2935
## [24.11.0] - 2024-11-18
3036

docs/modules/kafka/pages/reference/discovery.adoc

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ The Stackable Operator for Apache Kafka publishes a xref:concepts:service_discov
99

1010
The bundle includes a thrift connection string to access the Kafka broker service. This string may be used by other operators or tools to configure their products with access to Kafka. This is limited to internal cluster access.
1111

12+
NOTE: The operator also creates a deprecated secondary discovery ConfigMap named `\{clusterName\}-nodeport`. In 24.7 and older, this ConfigMap was used to access the Kafka installation from outside the Kubernetes cluster. In 24.11, this was replaced by xref:usage-guide/listenerclass.adoc[Listener-based exposition], and the `-nodeport` ConfigMap was made equivalent to the primary one. This behaviour is deprecated as of 25.3, and will be removed in the next release. Any existing uses of the `-nodeport` ConfigMap should be migrated to the primary. See https://github.com/stackabletech/kafka-operator/issues/765[the deprecation issue] for more details.
13+
1214
== Example
1315

1416
Given the following Kafka cluster:

rust/operator-binary/src/discovery.rs

+22-10
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,28 @@ pub async fn build_discovery_configmaps(
7373
&name,
7474
listener_hosts(listeners, port_name)?,
7575
)?,
76-
// backwards compat: nodeport service is now the same as the main service, access type
77-
// is determined by the listenerclass.
78-
// do we want to deprecate/remove this?
79-
build_discovery_configmap(
80-
kafka,
81-
owner,
82-
resolved_product_image,
83-
&format!("{name}-nodeport"),
84-
listener_hosts(listeners, port_name)?,
85-
)?,
76+
{
77+
let mut nodeport = build_discovery_configmap(
78+
kafka,
79+
owner,
80+
resolved_product_image,
81+
&format!("{name}-nodeport"),
82+
listener_hosts(listeners, port_name)?,
83+
)?;
84+
nodeport
85+
.metadata
86+
.annotations
87+
.get_or_insert_with(Default::default)
88+
.insert(
89+
"stackable.tech/deprecated".to_string(),
90+
format!(
91+
"Deprecated in 25.3, and scheduled for removal in the next version. \
92+
Use {name:?} instead. \
93+
See https://github.com/stackabletech/kafka-operator/issues/765 for more."
94+
),
95+
);
96+
nodeport
97+
},
8698
])
8799
}
88100

0 commit comments

Comments
 (0)