Problem
In Terraform Enterprise versions 202104-1 and later, component containers use the custom Docker networks tfe_services and tfe_terraform_isolation. These networks provide better isolation but do not automatically inherit the Maximum Transmission Unit (MTU) setting from the Docker daemon's daemon.json configuration file.
This can cause intermittent network connectivity issues during Terraform runs if your environment requires a custom MTU value. This guide provides the procedure to recreate these networks with the correct MTU setting.
Prerequisites
- Shell access to the Terraform Enterprise instance.
- Sudo or root privileges.
Procedure
Follow these steps to reconfigure the Docker networks with a custom MTU value. This example uses an MTU of 1460.
Stop the Terraform Enterprise application.
$ replicatedctl app stop
Verify that the application has stopped. The status should show
stopped.$ replicatedctl app status
Remove the existing
tfe_terraform_isolationDocker network.# docker network rm tfe_terraform_isolation
Remove the existing
tfe_servicesDocker network.# docker network rm tfe_services
Recreate the
tfe_terraform_isolationnetwork with your custom MTU setting.# docker network create tfe_terraform_isolation \ --subnet=172.20.0.0/16 \ --gateway 172.20.0.1 \ -o com.docker.network.driver.mtu=1460
Recreate the
tfe_servicesnetwork with your custom MTU setting.# docker network create tfe_services \ --subnet=172.19.0.0/16 \ --gateway 172.19.0.1 \ -o com.docker.network.driver.mtu=1460
Verify the new settings for the
tfe_terraform_isolationnetwork. Check theOptionssection in the output for thecom.docker.network.driver.mtukey.# docker network inspect tfe_terraform_isolation
Example Output:
[ { ##... "Options": { "com.docker.network.driver.mtu": "1460" }, ##... } ]Verify the new settings for the
tfe_servicesnetwork.# docker network inspect tfe_services
Start the Terraform Enterprise application.
$ replicatedctl app start
Additional Information
For more details on Docker networking, we suggest reviewing the official Docker documentation.