Problem
When using a Terraform Enterprise version prior to v202111-1, you may experience issues with Fluent-bit log forwarding, such as connection timeouts or proxy environment variables not being correctly applied to the fluent-bit container. Error messages may include:
[error] [net] connection timeout after 10 seconds to <hostname>
Additionally, you may observe that HTTP_PROXY and HTTPS_PROXY variables are not injected into the fluent-bit Docker container.
Cause
Terraform Enterprise versions before v202111-1 had limitations in how they handled proxy environment variables and custom CA certificates for the Fluent-bit service. The v202111-1 release introduced two key fixes:
- Proper injection of HTTP proxy environment variables into the Fluent-bit container.
- A dedicated script to inject custom CA certificates into the container's trust store.
Solution
To resolve this issue, you must upgrade your Terraform Enterprise instance to version v202111-1 or newer and ensure the environment is correctly configured. The following procedure outlines the required steps.
Procedure
-
Stop the Terraform Enterprise application.
$ replicatedctl app stop
-
Stop the Replicated services.
$ sudo systemctl stop replicated replicated-ui replicated-operator
-
Update the
dockerandlibseccomppackages on the Terraform Enterprise server to meet the minimum version requirements.-
dockerversion must be20.10.0or newer. -
libseccompversion must be2.4.4or newer.
Note: Failure to update these dependencies before upgrading Terraform Enterprise may result in startup issues.
-
-
Start the Replicated services.
$ sudo systemctl start replicated replicated-ui replicated-operator
-
Start the Terraform Enterprise application.
$ replicatedctl app start
- Perform the upgrade to Terraform Enterprise release
v202111-1or a more recent version. Follow the official documentation for guidance: -
After the upgrade, configure proxy and CA passthrough to the
fluent-bitcontainer. This feature allows you to inject custom CA certificates into a container's system CA bundle.For example, update the container's configuration to call the
/usr/bin/setup-ca-certificates.shscript. If a container previously had the following configuration:cmd: >- ["/usr/bin/app-start.sh"] config_files: - filename: /usr/bin/app-start.sh file_mode: "0755" contents: $read-template:app-start.sh.erbUpdate it to inject custom CA certificates:
cmd: >- ["/usr/bin/setup-ca-certificates.sh", "/usr/bin/app-start.sh"] config_files: - *CUSTOM_CA_CERTIFICATES_FILE - *SETUP_CA_CERTIFICATES - filename: /usr/bin/app-start.sh file_mode: "0755" contents: $read-template:app-start.sh.erb -
Ensure that the required proxy environment variables are set in uppercase so they are forwarded to the
fluent-bitcontainer.HTTP_PROXY HTTPS_PROXY NO_PROXY
-
Perform a full restart of Terraform Enterprise to apply all changes.
$ replicatedctl app stop
$ sudo systemctl stop replicated replicated-ui replicated-operator
$ sudo systemctl start replicated replicated-ui replicated-operator
$ replicatedctl app start