File tree Expand file tree Collapse file tree 4 files changed +11
-3
lines changed
example/module/submodules/replaceMe Expand file tree Collapse file tree 4 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -46,11 +46,13 @@ variable "service" {
4646 publishNotReadyAddresses = bool
4747 sessionAffinity = string
4848 annotations = map (string )
49+ remapPorts = map (string )
4950 })
5051 headless = object ({
5152 publishNotReadyAddresses = bool
5253 sessionAffinity = string
5354 annotations = map (string )
55+ remapPorts = map (string )
5456 })
5557 loadBalancer = list (object ({
5658 publishNotReadyAddresses = bool
@@ -84,7 +86,7 @@ resource "kubernetes_service_v1" "clusterIp" {
8486 content {
8587 name = port. value . name
8688 target_port = port. value . name
87- port = port. value . port
89+ port = lookup (var . service . clusterIp . remapPorts , port. value . name , port. value . port )
8890 protocol = port. value . protocol
8991 }
9092 }
@@ -115,7 +117,7 @@ resource "kubernetes_service_v1" "headless" {
115117 content {
116118 name = port. value . name
117119 target_port = port. value . name
118- port = port. value . port
120+ port = lookup (var . service . headless . remapPorts , port. value . name , port. value . port )
119121 protocol = port. value . protocol
120122 }
121123 }
Original file line number Diff line number Diff line change 11output "version" {
2- value = " 1.11 .0"
2+ value = " 1.12 .0"
33}
Original file line number Diff line number Diff line change 1+ ## [ 1.12.0] - 2023-06-12
2+
3+ - add ` remapPorts ` to ` var.service.clusterIp ` and ` var.service.headless ` to allow remapping of ports for all service types
4+
15## [ 1.11.0] - 2023-06-11
26
37- port now supports ` hostIp ` if ` hostNetwork == true `
Original file line number Diff line number Diff line change @@ -7,13 +7,15 @@ locals {
77 annotations = merge ({
88
99 }, var. additionalAnnotations . service )
10+ remapPorts = {}
1011 }
1112 headless = {
1213 publishNotReadyAddresses = false
1314 sessionAffinity = " None"
1415 annotations = merge ({
1516
1617 }, var. additionalAnnotations . service )
18+ remapPorts = {}
1719 }
1820 loadBalancer = [
1921 # {
You can’t perform that action at this time.
0 commit comments