From 4fcb509a5f75b9c831975417bafc8004443b00c8 Mon Sep 17 00:00:00 2001 From: hc-github-team-consul-core Date: Fri, 3 May 2024 13:50:42 -0700 Subject: [PATCH] Backport of deployer: ensure the proxy/dns/pause containers do not continually get replaced due to a change in a docker default into release/1.17.x (#21044) backport of commit a3950321a3a3e47c6dc50dfb2cc11bda3ff5ac6b Co-authored-by: R.B. Boyer --- .../sprawl/internal/tfgen/templates/container-coredns.tf.tmpl | 1 + .../sprawl/internal/tfgen/templates/container-pause.tf.tmpl | 1 + .../sprawl/internal/tfgen/templates/container-proxy.tf.tmpl | 1 + 3 files changed, 3 insertions(+) diff --git a/testing/deployer/sprawl/internal/tfgen/templates/container-coredns.tf.tmpl b/testing/deployer/sprawl/internal/tfgen/templates/container-coredns.tf.tmpl index 97c0d7011d..3dabd7d50e 100644 --- a/testing/deployer/sprawl/internal/tfgen/templates/container-coredns.tf.tmpl +++ b/testing/deployer/sprawl/internal/tfgen/templates/container-coredns.tf.tmpl @@ -4,6 +4,7 @@ resource "docker_container" "{{.DockerNetworkName}}-coredns" { restart = "always" dns = ["8.8.8.8"] + network_mode = "bridge" networks_advanced { name = docker_network.{{.DockerNetworkName}}.name ipv4_address = "{{.IPAddress}}" diff --git a/testing/deployer/sprawl/internal/tfgen/templates/container-pause.tf.tmpl b/testing/deployer/sprawl/internal/tfgen/templates/container-pause.tf.tmpl index ef537f0352..37a1370c63 100644 --- a/testing/deployer/sprawl/internal/tfgen/templates/container-pause.tf.tmpl +++ b/testing/deployer/sprawl/internal/tfgen/templates/container-pause.tf.tmpl @@ -23,6 +23,7 @@ ports { } {{- end }} +network_mode = "bridge" {{- range .Node.Addresses }} networks_advanced { name = docker_network.{{.DockerNetworkName}}.name diff --git a/testing/deployer/sprawl/internal/tfgen/templates/container-proxy.tf.tmpl b/testing/deployer/sprawl/internal/tfgen/templates/container-proxy.tf.tmpl index f4d7fe1d94..64e09743e1 100644 --- a/testing/deployer/sprawl/internal/tfgen/templates/container-proxy.tf.tmpl +++ b/testing/deployer/sprawl/internal/tfgen/templates/container-proxy.tf.tmpl @@ -8,6 +8,7 @@ resource "docker_container" "{{.DockerNetworkName}}-forwardproxy" { internal = {{.InternalPort}} } + network_mode = "bridge" networks_advanced { name = docker_network.{{.DockerNetworkName}}.name ipv4_address = "{{.IPAddress}}"