-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add network_config
to node_pool
#984
Changes from 6 commits
b210557
db5fe8e
a2033d7
898bee0
5d26f4f
2104a64
8e27ab2
c222f82
a842212
dd58dc9
4848402
6e7cbaf
b444498
c789916
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 |
---|---|---|
|
@@ -77,3 +77,11 @@ variable "cluster_autoscaling" { | |
} | ||
description = "Cluster autoscaling configuration. See [more details](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters#clusterautoscaling)" | ||
} | ||
|
||
variable "network_config" { | ||
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. Don't make this a variable. Just hard code it. Examples can and should use hardcoding extensively. 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. np, it just will make an assumption on users env. will change. 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. fixed |
||
description = "network configuration override for node pools" | ||
} | ||
|
||
variable "pod_range" { | ||
description = "The ID of the secondary range for pod IPs. If create_pod_range is true, this ID is used for the new range." | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -429,6 +429,15 @@ resource "google_container_node_pool" "pools" { | |
} | ||
} | ||
|
||
dynamic "network_config" { | ||
for_each = lookup(each.value, "network_config", false) ? [each.value] : [] | ||
DrFaust92 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
content { | ||
create_pod_range = lookup(network_config.value, "create_pod_range", false) | ||
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'm not sure we want to dynamically create the range on demand, since that's not very declarative. 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. Cool, ill remove both create_pod_range and cidr vars. 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. fixed 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. Hi fellows, why not giving the possibility to customize the CIDR if set? Looks like pod_ipv4_cidr_block can not be set so it is set to a default. How can we set this to some CIDR range of our choosing? Thanks! |
||
pod_ipv4_cidr_block = lookup(network_config.value, "pod_ipv4_cidr_block", null) | ||
pod_range = lookup(network_config.value, "pod_range", null) | ||
} | ||
} | ||
|
||
management { | ||
auto_repair = lookup(each.value, "auto_repair", true) | ||
auto_upgrade = lookup(each.value, "auto_upgrade", local.default_auto_upgrade) | ||
|
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.
Since only
pod_range
is used now, could we collapse this into being the only variable? Sonetwork_config
doesn't need to be supplied at all?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.
future proofing? what if there will an additional var there?
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.
YAGNI - we shouldn't add complexity for hypothetical gains.
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.
Fair enough. changed.