Skip to content

Commit 670fa2b

Browse files
committed
1.11.0 allow setting of hostIp for ports
1 parent abff899 commit 670fa2b

File tree

11 files changed

+14
-3
lines changed

11 files changed

+14
-3
lines changed

01_deployment.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,7 @@ resource "kubernetes_deployment_v1" "deployment" {
557557
for_each = container.value.ports
558558
content {
559559
name = port.value.name
560+
host_ip = var.hostConfig.hostNetwork ? port.value.hostIp : null
560561
protocol = port.value.protocol
561562
container_port = port.value.port
562563
host_port = var.hostConfig.hostNetwork ? port.value.port : null

02_daemonset.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,7 @@ resource "kubernetes_daemon_set_v1" "daemonset" {
535535
for_each = container.value.ports
536536
content {
537537
name = port.value.name
538+
host_ip = var.hostConfig.hostNetwork ? port.value.hostIp : null
538539
protocol = port.value.protocol
539540
container_port = port.value.port
540541
host_port = var.hostConfig.hostNetwork ? port.value.port : null

03_statefulset.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,7 @@ resource "kubernetes_stateful_set_v1" "statefulset" {
562562
for_each = container.value.ports
563563
content {
564564
name = port.value.name
565+
host_ip = var.hostConfig.hostNetwork ? port.value.hostIp : null
565566
protocol = port.value.protocol
566567
container_port = port.value.port
567568
host_port = var.hostConfig.hostNetwork ? port.value.port : null

04_cronJob.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,7 @@ resource "kubernetes_cron_job_v1" "cronJob" {
555555
for_each = container.value.ports
556556
content {
557557
name = port.value.name
558+
host_ip = var.hostConfig.hostNetwork ? port.value.hostIp : null
558559
protocol = port.value.protocol
559560
container_port = port.value.port
560561
host_port = var.hostConfig.hostNetwork ? port.value.port : null

05_job.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,7 @@ resource "kubernetes_job_v1" "job" {
528528
for_each = container.value.ports
529529
content {
530530
name = port.value.name
531+
host_ip = var.hostConfig.hostNetwork ? port.value.hostIp : null
531532
protocol = port.value.protocol
532533
container_port = port.value.port
533534
host_port = var.hostConfig.hostNetwork ? port.value.port : null

21_varContainers.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ variable "containers" {
2525

2626
ports = list(object({
2727
name = string
28+
hostIp = string
2829
port = string
2930
protocol = string
3031
serviceTypes = list(string)

24_release.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
output "version" {
2-
value = "1.10.0"
2+
value = "1.11.0"
33
}

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## [1.11.0] - 2023-06-11
2+
3+
- port now supports `hostIp` if `hostNetwork == true`
4+
15
## [1.10.0] - 2023-05-22
26

37
- hostNetwork = true now also sets hostPort

example/module/submodules/replaceMe/10_containers.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ locals {
2828
ports = [
2929
#{
3030
# port = 8080
31+
# host_ip = null
3132
# name = "replaceMe"
3233
# protocol = "TCP"
3334
# ingressEnabled = true

test/ubuntu/02_module.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
variable "ubuntuImage" {
2-
default = "ubuntu:21.04"
2+
default = "docker.io/ubuntu:22.04"
33
}
44

55
module "ubuntu" {

0 commit comments

Comments
 (0)