Enable Log Forwarding and confirm is successful on Terraform Enterprise.
Prerequisites (if applicable)
- Terraform Enterprise v202109-1 or later.
- Customer is configuring Log Forwarding on TFE but needs further assistance after following the official documentation.
Before proceeding determine the type of installation, active/active or standalone(external-services-online, mounted-disk, etc).
- Create a fluent-bit.conf file with the [OUTPUT] section as outlined in the documentation for supported external destinations.
- For active/active installs there are two approaches.
- Option 1 is to drain the secondary node and once this process has completed scale in your ASG from 2 to 1 so that you can perform all the changes in one node and then scale out.
- Option 2 is to make the changes on each node at a time after draining it and then restarting the TFE app. All of these changes are performed in the CLI.
- For standalone installs changes can be applied via the replicated console or cli.
- After the changes, to verify that fluent-bit is successfully processing the records, make a call to the fluent-bit API to check for metrics
- List of commands.
# Standalone Installs
replicatedctl app-config set log_forwarding_enabled --value 1
replicatedctl app-config set log_forwarding_config --value "$(cat fluent-bit.conf)"
replicatedctl app apply-config # Restarts TFE to apply new config if changes have been made
# Active/Active Installs
tfe-admin node-drain # Node stops receiving new connections and completes existing tasks
tfe-admin app-config -k log_forwarding_enabled -v 1
tfe-admin app-config -k log_forwarding_config -v "$(cat fluent-bit.conf)"
replicatedctl app stop
watch replicatedctl app status # Confirm the APP has successfully stopped
replicatedctl app start
# Use the fluent-bit API to verify the records are being processed
curl -s http://$(docker inspect tfe-fluent-bit|jq -r '..NetworkSettings.Networks.IPAddress'):2020/api/v1/metrics|jq
- API call output examples. Failure vs Success.