-
-
Notifications
You must be signed in to change notification settings - Fork 2
feat: Airflow Listener integration #604
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First batch, tests work fine, will do some more manual testing.
Co-authored-by: Malte Sander <[email protected]>
Co-authored-by: Malte Sander <[email protected]>
Co-authored-by: Malte Sander <[email protected]>
Co-authored-by: Malte Sander <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and works. Just some more nitpicking / clarification.
Co-authored-by: Malte Sander <[email protected]>
Co-authored-by: Malte Sander <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Not a complete review, but a few notes..)
// all listeners will use ephemeral volumes as they can/should | ||
// be removed when the pods are *terminated* (ephemeral PVCs will | ||
// survive re-starts) | ||
pb.add_listener_volume_by_listener_class( | ||
LISTENER_VOLUME_NAME, | ||
&listener_class.to_string(), | ||
&recommended_labels, | ||
) | ||
.context(AddVolumeSnafu)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clients don't care about which airflow webserver they connect to, right? In that case, we should use a group listener instead (https://docs.stackable.tech/home/stable/listener-operator/volume/#_listeners_stackable_techlistener_name), so we only end up with one load balancer that knows how to route everywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I've understood this correctly, the operator would then be responsible for creating a listener-by-name (like we do for the kafka bootstrap listener) if the webserver role (or one of its rolegroups) declares a listener class as external-stable or external-unstable, and then this group listener is passed as the name to ListenerReference::ListenerClass for the ListenerOperatorVolumeSourceBuilder for the pvcs? And this listener doesn't care if webserver rolegroups specify different classes (e.g. one as external-stable and another as external-unstable)? I'll do this per role-group, as we have done for Kafka.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, but for Kafka we create a bootstrap-listener per role-group.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// all listeners will use ephemeral volumes as they can/should | ||
// be removed when the pods are *terminated* (ephemeral PVCs will | ||
// survive re-starts) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use persistent volumes for web UIs IMO, since upstream load balancers will depend on probably end up hard-coding the target addresses.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rust/operator-binary/src/crd/mod.rs
Outdated
#[derive(Clone, Debug, Default, Display, Deserialize, Eq, JsonSchema, PartialEq, Serialize)] | ||
#[serde(rename_all = "PascalCase")] | ||
pub enum CurrentlySupportedListenerClasses { | ||
pub enum SupportedListenerClasses { | ||
#[default] | ||
#[serde(rename = "cluster-internal")] | ||
#[strum(serialize = "cluster-internal")] | ||
ClusterInternal, | ||
|
||
#[serde(rename = "external-unstable")] | ||
#[strum(serialize = "external-unstable")] | ||
ExternalUnstable, | ||
|
||
#[serde(rename = "external-stable")] | ||
#[strum(serialize = "external-stable")] | ||
ExternalStable, | ||
} | ||
|
||
impl CurrentlySupportedListenerClasses { | ||
pub fn k8s_service_type(&self) -> String { | ||
impl Atomic for SupportedListenerClasses {} | ||
|
||
impl SupportedListenerClasses { | ||
pub fn discoverable(&self) -> bool { | ||
match self { | ||
CurrentlySupportedListenerClasses::ClusterInternal => "ClusterIP".to_string(), | ||
CurrentlySupportedListenerClasses::ExternalUnstable => "NodePort".to_string(), | ||
CurrentlySupportedListenerClasses::ExternalStable => "LoadBalancer".to_string(), | ||
SupportedListenerClasses::ClusterInternal => false, | ||
SupportedListenerClasses::ExternalUnstable => true, | ||
SupportedListenerClasses::ExternalStable => true, | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that we're using listener-operator, the listener class name should just be an opaque string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Users are free to define their own custom listenerclasses, or even to redefine our preset ones (though the latter isn't really recommended since it could lead to upgrade strife..).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the implementation for kafka-operator, a PVC is created for the bootstrap listener even when it is not defined by the user (defaulting to cluster-internal). I guess there is no easy way around that, other than looking up the listener class and checking its type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kafka-operator behaves correctly there; even when running cluster-internally we want the Listener -> Service to be the ingress point that we expose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See dcc21f9. As we discussed offline, I've used a consistent address for the Webserver UI whatever the listener class.
Re-ran tests locally: 🟢 |
Description
fixes: #580
Jenkins tests 🟢
Openshift tests 🟢 (logging test passed when run again in isolation):-
Definition of Done Checklist
Author
Reviewer
Acceptance