Skip to content
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

Conditionally apply IngressRouteTCP #396

Merged
merged 20 commits into from
Dec 7, 2023
Merged

Conditionally apply IngressRouteTCP #396

merged 20 commits into from
Dec 7, 2023

Conversation

EvanHStanton
Copy link
Contributor

@EvanHStanton EvanHStanton commented Dec 5, 2023

Routing Configuration Enhancements (types.rs):

  • Added properties entry_points and ingress_type to the Routing struct
  • Set default values (entry_points = websecure), (ingress_type = http)

Ingress Route TCP Implementation (ingress.rs):

  • Implemented generate_ingress_tcp function.
  • Implemented reconcile_ingress_tcp function
  • Added apply_ingress_route_tcp asynchronous function for applying TCP ingress routes.

App Service Resource Management (manager.rs):

  • Modified AppServiceResources struct to include ingress_tcp_routes, entry_points, and entry_points_tcp.
  • Updated generate_resource function to fetch entry points from routing configuration.
  • Adjusted reconcile_app_services function to incorporate desired entry points in the ingress reconciliation process.

@@ -61,6 +66,41 @@ fn generate_ingress(
}
}

fn generate_ingress_tcp(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New function for generating IngressRouteTCP.

@@ -168,6 +200,11 @@ pub fn generate_ingress_routes(
for route in routings.iter() {
match route.ingress_path.clone() {
Some(path) => {
if route.entry_points.clone()?.contains(&"ferretdb".to_string()) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the entry point contains "ferretdb" then the ingress route will not be generated.

@@ -270,8 +271,24 @@ pub async fn reconcile_postgres_ing_route_tcp(
// Check for all existing IngressRouteTCPs in this namespace
// Filter out any that are not for this DB or do not have the correct prefix
for ingress_route_tcp in &ingress_route_tcps {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was some conflict between ingress reconciliation in this file and in app services, so we added some logic for ignoring ingress with label component: appService

Comment on lines +3070 to +3071
let app_1_pod = pod_list.items[0].clone();
let app_1_container = app_1_pod.spec.unwrap().containers[0].clone();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Order of the apps changed after introducing a new app (ferretdb)

@EvanHStanton EvanHStanton marked this pull request as ready for review December 6, 2023 20:17
@EvanHStanton EvanHStanton merged commit d974d06 into main Dec 7, 2023
@EvanHStanton EvanHStanton deleted the app-ing-tcp branch December 7, 2023 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants