Deploy Terraform Enterprise to Podman
This topic describes how to install and run Terraform Enterprise on Podman. These installation steps set up a rootful Podman installation with a non-root user so that the Podman service runs as root while processes within the Terraform Enterprise container run as non-root.
Overview
Complete the following steps to install Terraform Enterprise:
- Complete the prerequisites.
- Set up installation folders and files.
- Download and install image.
- Apply the deployment configuration.
Prerequisites
Complete the following tasks before attempting to install Terraform Enterprise.
Prepare the deployment environment
Set up a host instance and provide a DNS hostname for Terraform Enterprise and the associated TLS certificate. Additionally, you must configure your network so that your host can receive and send traffic. Refer to Prepare the host environment for details about preparing the host environment.
Deploy storage systems for active
and external
mode
If you intend to operate Terraform Enterprise in active
or external
mode, deploy the database and other storage devices so that Terraform can connect to them when the application starts. Refer to Data storage settings overview for additional information.
Create the deployment configuration
Create a deployment configuration file and specify settings for the operational mode, license, TLS certificates, and network configuration. Add any additional configurations necessary for your environment. Refer to Configuration file overview for additional information.
Set up installation folders and files
- Connect to the host instance.
- Create a dedicated directory for the Terraform Enterprise installation files
- Navigate to the installation directory.
- Create a
certs
directory. - Place your TLS certificate (
cert.pem
), TLS private key (key.pem
), and CA certificates bundle (bundle.pem
) inside inside thecerts
directory. If you do not have a CA certificates bundle, place your TLS certificate (cert.pem
) insidebundle.pem
instead. - Place your deployment configuration file into the Terraform Enterprise installation directory. Refer to Example deployment configurations for pre-formatted configurations that you can copy and modify. Refer to the configuration reference for information about all deployment configuration settings.
Download and install image
Log in to the Terraform Enterprise container image registry, using
terraform
as the username, and your Hashicorp Terraform Enterprise license as the password:Pull the Terraform Enterprise image from the registry.
Apply the deployment configuration
Refer to Deployment configuration reference for a list of all the configuration options.
Create a Terraform Enterprise pod by running the following command:
In a separate terminal session, you can monitor the logs by running the following command:
Monitor the health of the application until it starts reporting healthy with the following command:
Post installation tasks actions
Complete the following tasks after the initial installation.
Review startup checks
When you start Terraform Enterprise, several startup checks also run to prevent errors related to invalid configurations or certificates, as well as other issues that could prevent the application from running successfully or safely. Refer to the startup checks reference for additional information.
Create the initial admin user
Provision your first administrative user and start using Terraform Enterprise.
Service management
To learn more about managing the lifecycle of Podman pods, refer to the Podman docs for more information about pods. We have included possible options for managing a pod's lifecycle on a Red Hat Enterprise Linux (RHEL) host for convenience.
Manage Podman service
Complete the following steps to create a systemd
service that automatically starts your pod and its containers. We
recommend using Quadlet, which is an opinionated tool for running Podman
containers, to deploy systemd
. Quadlet generates a systemd
service that manages the Terraform Enterprise pod and
all containers, including the internal infrastructure container.
Ensure the Terraform Enterprise pod is not running.
Navigate to
/etc/containers/systemd/
. Define the service files in this directory.Create a Quadlet unit file for the Terraform Enterprise pod and container at
/etc/containers/systemd/terraform-enterprise.kube
:Copy your Kubernetes YAML file to
/etc/containers/systemd/tfe.yaml
:Reload the
systemd
daemon and enable the service:Check the status of your service:
Example configurations
You can copy one of the following example configurations and modify the values to per your environment. Refer to Configuration Reference for a list of all configuration options.
Example disk
mode configuration
The following Kubernetes YAML deploys Terraform Enterprise in disk
mode. In this mode, Terraform Enterprise runs as a pod composed of a Terraform Enterprise container.
Example external
mode configuration
The following Kubernetes YAML configuration deploys Terraform Enterprise in external
mode. In this mode, Terraform Enterprise runs as a pod composed of a Terraform Enterprise container.
Example active-active
mode configuration
The following Kubernetes YAML configuration deploys Terraform Enterprise in active-active
mode. In this mode,
each node runs a Podman pod composed of a Terraform Enterprise container.