forked from f5devcentral/f5-xc-terraform-examples
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Janibasha
committed
Nov 8, 2024
1 parent
6b0526e
commit fe0c8fd
Showing
4 changed files
with
83 additions
and
8 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
workflow-guides/smcn/genai-inference-at-the-edge/terraform/managed_k8s.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
workflow-guides/smcn/genai-inference-at-the-edge/terraform/outputs.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
workflow-guides/smcn/genai-inference-at-the-edge/terraform/xc_loadbalancer.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# Wait for appstack CE site creation | ||
resource "null_resource" "wait_for_aws_ce_site"{ | ||
count = var.user_site ? 1 : 0 | ||
depends_on = [volterra_tf_params_action.apply_aws_vpc] | ||
} | ||
|
||
# Create XC LB config | ||
resource "volterra_origin_pool" "op" { | ||
depends_on = [null_resource.wait_for_aws_ce_site] | ||
name = format("%s-xcop", var.project_prefix) | ||
namespace = var.xc_namespace | ||
description = format("Origin pool pointing to origin server for %s", var.project_prefix) | ||
|
||
dynamic "origin_servers" { | ||
for_each = var.k8s_pool ? [1] : [] | ||
content { | ||
k8s_service { | ||
service_name = var.serviceName | ||
vk8s_networks = true | ||
outside_network = true | ||
site_locator { | ||
site { | ||
name = var.site_name | ||
namespace = "system" | ||
tenant = var.xc_tenant | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
no_tls = true | ||
port = var.serviceport | ||
endpoint_selection = "LOCAL_PREFERRED" | ||
loadbalancer_algorithm = "LB_OVERRIDE" | ||
} | ||
|
||
resource "volterra_http_loadbalancer" "lb_https" { | ||
depends_on = [volterra_origin_pool.op] | ||
name = format("%s-xclb", var.project_prefix) | ||
namespace = var.xc_namespace | ||
description = format("HTTP loadbalancer object for %s origin server", var.project_prefix) | ||
domains = [var.app_domain] | ||
advertise_on_public_default_vip = true | ||
|
||
dynamic "https_auto_cert" { | ||
for_each = var.http_only ? [] : [1] | ||
content { | ||
add_hsts = false | ||
http_redirect = true | ||
no_mtls = true | ||
enable_path_normalize = true | ||
tls_config { | ||
default_security = true | ||
} | ||
} | ||
} | ||
|
||
default_route_pools { | ||
pool { | ||
name = volterra_origin_pool.op.name | ||
namespace = var.xc_namespace | ||
} | ||
weight = 1 | ||
} | ||
|
||
disable_waf = false | ||
round_robin = true | ||
service_policies_from_namespace = true | ||
user_id_client_ip = true | ||
source_ip_stickiness = true | ||
|
||
dynamic "more_option" { | ||
for_each = var.k8s_pool ? [1] : [] | ||
content { | ||
idle_timeout = 600000 | ||
} | ||
} | ||
} |