diff --git a/crates/stackable-operator/CHANGELOG.md b/crates/stackable-operator/CHANGELOG.md index ee60b2114..eb1aac026 100644 --- a/crates/stackable-operator/CHANGELOG.md +++ b/crates/stackable-operator/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +### Added + +- BREAKING: Add the `OpenShiftRoute` Listener `ServiceType` and `ListenerClass.spec.openshiftRoute` ([#1291]). + +[#1291]: https://github.com/stackabletech/operator-rs/pull/1291 + ## [0.119.0] - 2026-09-23 ### Removed diff --git a/crates/stackable-operator/crds/ListenerClass.yaml b/crates/stackable-operator/crds/ListenerClass.yaml index afa4c00a8..e12f7cbb2 100644 --- a/crates/stackable-operator/crds/ListenerClass.yaml +++ b/crates/stackable-operator/crds/ListenerClass.yaml @@ -38,6 +38,22 @@ spec: Ignored unless serviceType is LoadBalancer. nullable: true type: string + openshiftRoute: + description: Ignored unless `serviceType` is `OpenShiftRoute`. + nullable: true + properties: + port: + description: Required when the Listener has more than one port. + nullable: true + type: string + tls: + default: Passthrough + description: '`Passthrough` (default) uses port 443; `None` serves plain HTTP on port 80.' + enum: + - Passthrough + - None + type: string + type: object pinnedNodePorts: default: false description: |- @@ -106,6 +122,7 @@ spec: - NodePort - LoadBalancer - ClusterIP + - OpenShiftRoute type: string required: - serviceType diff --git a/crates/stackable-operator/src/crd/listener/class/mod.rs b/crates/stackable-operator/src/crd/listener/class/mod.rs index f212a2163..54acab00f 100644 --- a/crates/stackable-operator/src/crd/listener/class/mod.rs +++ b/crates/stackable-operator/src/crd/listener/class/mod.rs @@ -34,6 +34,10 @@ pub mod versioned { pub struct ListenerClassSpec { pub service_type: core_v1alpha1::ServiceType, + /// Ignored unless `serviceType` is `OpenShiftRoute`. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub openshift_route: Option, + /// Configures whether a LoadBalancer service should also allocate node ports (like NodePort). /// /// Ignored unless serviceType is LoadBalancer. @@ -121,6 +125,26 @@ pub mod versioned { #[schemars(schema_with = "raw_object_schema")] pub service_overrides: Service, } + + #[derive(Clone, Debug, Default, Deserialize, JsonSchema, PartialEq, Eq, Serialize)] + #[serde(rename_all = "camelCase")] + pub struct OpenShiftRouteConfig { + /// Required when the Listener has more than one port. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub port: Option, + + /// `Passthrough` (default) uses port 443; `None` serves plain HTTP on port 80. + #[serde(default)] + pub tls: OpenShiftRouteTls, + } + + #[derive(Clone, Copy, Debug, Default, Deserialize, JsonSchema, PartialEq, Eq, Serialize)] + pub enum OpenShiftRouteTls { + #[default] + Passthrough, + + None, + } } #[cfg(test)] @@ -130,6 +154,13 @@ impl stackable_versioned::test_utils::RoundtripTestData for v1alpha1::ListenerCl - serviceType: ClusterIP - serviceType: NodePort - serviceType: LoadBalancer + - serviceType: OpenShiftRoute + - serviceType: OpenShiftRoute + openshiftRoute: + port: https + - serviceType: OpenShiftRoute + openshiftRoute: + tls: None - serviceType: ClusterIP loadBalancerAllocateNodePorts: false loadBalancerClass: foo diff --git a/crates/stackable-operator/src/crd/listener/core/mod.rs b/crates/stackable-operator/src/crd/listener/core/mod.rs index 545b19afd..f60541053 100644 --- a/crates/stackable-operator/src/crd/listener/core/mod.rs +++ b/crates/stackable-operator/src/crd/listener/core/mod.rs @@ -26,6 +26,9 @@ pub mod versioned { /// Assigns an IP address from a pool of IP addresses that your cluster has reserved for /// that purpose. ClusterIP, + + /// Expose a single port through an OpenShift Route. + OpenShiftRoute, } /// Service Internal Traffic Policy enables internal traffic restrictions to only route internal