Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ All notable changes to this project will be documented in this file.

### Changed

- Support specifying Service type.
This enables us to later switch non-breaking to using `ListenerClasses` for the exposure of Services.
So far only `external-unstable` is supported, which re-uses the current code to create NodePorts
and calculate the reachable address to advertise ([#576]).
- `operator-rs` `0.30.1` -> `0.39.0` ([#545], [#574]).
- Bumped stackable versions to "23.4.0-rc1" ([#545]).
- Bumped kafka stackable versions to "23.4.0-rc2" ([#547]).
Expand All @@ -22,6 +26,7 @@ All notable changes to this project will be documented in this file.
[#557]: https://github.com/stackabletech/kafka-operator/pull/557
[#573]: https://github.com/stackabletech/kafka-operator/pull/573
[#574]: https://github.com/stackabletech/kafka-operator/pull/574
[#576]: https://github.com/stackabletech/kafka-operator/pull/576

## [23.1.0] - 2023-01-23

Expand Down
9 changes: 9 additions & 0 deletions deploy/helm/kafka-operator/crds/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1423,6 +1423,15 @@ spec:
- configMapName
type: object
type: object
listenerClass:
default: external-unstable
description: |-
In the future this setting will control, which ListenerClass <https://docs.stackable.tech/home/stable/listener-operator/listenerclass.html> will be used to expose the service. Currently only a subset of the ListenerClasses are supported by choosing the type of the created Services by looking at the ListenerClass name specified, In a future release support for custom ListenerClasses will be introduced without a breaking change:

* external-unstable: Use a NodePort service
enum:
- external-unstable
type: string
tls:
default:
internalSecretClass: tls
Expand Down
26 changes: 26 additions & 0 deletions rust/crd/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,32 @@ pub struct KafkaClusterConfig {
pub vector_aggregator_config_map_name: Option<String>,
/// ZooKeeper discovery config map name.
pub zookeeper_config_map_name: String,
/// In the future this setting will control, which ListenerClass <https://docs.stackable.tech/home/stable/listener-operator/listenerclass.html>
/// will be used to expose the service.
/// Currently only a subset of the ListenerClasses are supported by choosing the type of the created Services
/// by looking at the ListenerClass name specified,
/// In a future release support for custom ListenerClasses will be introduced without a breaking change:
///
/// * external-unstable: Use a NodePort service
#[serde(default)]
pub listener_class: CurrentlySupportedListenerClasses,
}

// TODO: Temporary solution until listener-operator is finished
#[derive(Clone, Debug, Default, Display, Deserialize, Eq, JsonSchema, PartialEq, Serialize)]
#[serde(rename_all = "PascalCase")]
pub enum CurrentlySupportedListenerClasses {
#[default]
#[serde(rename = "external-unstable")]
ExternalUnstable,
}

impl CurrentlySupportedListenerClasses {
pub fn k8s_service_type(&self) -> String {
match self {
CurrentlySupportedListenerClasses::ExternalUnstable => "NodePort".to_string(),
}
}
}

impl KafkaCluster {
Expand Down
2 changes: 2 additions & 0 deletions rust/operator/src/kafka_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,8 @@ fn build_broker_rolegroup_service(
.with_label("prometheus.io/scrape", "true")
.build(),
spec: Some(ServiceSpec {
// Internal communication does not need to be exposed
type_: Some("ClusterIP".to_string()),
cluster_ip: Some("None".to_string()),
ports: Some(service_ports(kafka_security)),
selector: Some(role_group_selector_labels(
Expand Down