-
Notifications
You must be signed in to change notification settings - Fork 95
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
Support for pinning the IP address of the load balancer via terraform overrides #1235
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -142,6 +142,9 @@ def _calculate_note_groups(config): | |
|
||
|
||
def stage_04_kubernetes_ingress(stage_outputs, config): | ||
ingress_terraform_overrides = config.get("ingress", {}).get( | ||
"terraform_overrides", {} | ||
) | ||
return { | ||
"name": config["project_name"], | ||
"environment": config["namespace"], | ||
|
@@ -152,6 +155,10 @@ def stage_04_kubernetes_ingress(stage_outputs, config): | |
"certificate-secret-name": config["certificate"]["secret_name"] | ||
if config["certificate"]["type"] == "existing" | ||
else None, | ||
"load-balancer-annotations": ingress_terraform_overrides.get( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using what I showed above we just supply There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The problem is, we need In spec: spec {
selector = merge({
"app.kubernetes.io/component" = "traefik-ingress"
}, var.load-balancer-annotations)
and type = "LoadBalancer"
load_balancer_ip = var.load-balancer-ip There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this should work. Suppose ingress:
terraform_overrides:
load-balancer-annotations:
k1: v1
k2: v2
load-balancer-ip: 1.2.3.4 Then in
This way There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes, any variable present in the terraform. This makes more sense. I'll add this. |
||
"load_balancer_annotations", {} | ||
), | ||
"load-balancer-ip": ingress_terraform_overrides.get("load-balancer-ip"), | ||
} | ||
|
||
|
||
|
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.
I'd prefer if this is
terraform_overrides: Any
and we defer to terraform for the checks.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.
So no need for the
IngressTerraformOverrides
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.
The problem with this is, "Any" won't reach terraform, as we parse these in the
input_vars.py
, so anything other than this won't be passed, unless we pass them explicitly.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.
Ah, I see your comment below now.