Warning In upcoming releases, we shall proceed with renaming this project to HCP Terraform Operator for Kubernetes or simply HCP Terraform Operator. This measure is necessary in response to the recent announcement of The Infrastructure Cloud.
The most noticeable change you can expect in version 2.6.0 is the renaming of this repository and related resources, such as the Helm chart and Docker Hub names.
Please follow the changelogs for updates.
Kubernetes Operator allows managing HCP Terraform / Terraform Enterprise resources via Kubernetes Custom Resources.
Note From this point forward, the terms HCP Terraform can be used interchangeably with Terraform Enterprise in all documents, provided that the contrary is indicated.
The Operator can manage the following types of resources:
AgentPool
manages HCP Terraform Agent Pools, HCP Terraform Agent Tokens and can perform TFC agent scalingModule
implements API-driven Run WorkflowsProject
manages HCP Terraform ProjectsWorkspace
manages HCP Terraform Workspaces
To get started see our tutorials on the HashiCorp Developer Portal:
- HCP Terraform Operator for Kubernetes overview
- Deploy infrastructure with the HCP Terraform Operator for Kubernetes
- Manage agent pools with the HCP Terraform Operator for Kubernetes
- HCP Terraform Operator for Kubernetes Migration Guide
The full list of supported HCP Terraform Operator features can be found on our Developer portal.
The Operator provides Helm chart as a first-class method of installation on Kubernetes.
Three simple commands to install the Operator:
$ helm repo add hashicorp https://helm.releases.hashicorp.com
$ helm repo update
$ helm install demo hashicorp/terraform-cloud-operator --wait --version 2.4.0
More detailed information about the installation and available values can be found here.
General usage documentation can be found here.
Controllers usage guides:
Annotations and Labels used by HCP Terraform Operator can be found here.
The Operator exposes metrics in the Prometheus format for each controller. More information can be found here.
API reference documentation can be found here.
FAQ can be found here.
YAML manifests examples live here.
If you come across articles, videos, how-tos, or any other resources that could assist individuals in adopting and utilizing the operator with greater efficiency, kindly inform us by initiating a pull request and placing a link within this designated section.
Your participation matters. Thank you for being a part of our community! 🙌
If you encounter any issues with the Operator there are a number of ways how to troubleshoot it:
-
check the Operator logs:
$ kubectl logs -f <POD_NAME>
Logs for a specific CR can be identified with the following pattern:
{"<KIND>": "<NAMESPACE>/<METADATA.NAME>", "msg": "..."}
For example:
2023-01-05T12:11:31Z INFO Agent Pool Controller {"agentpool": "default/this", "msg": "successfully reconcilied agent pool"}
-
check the CR:
$ kubectl get agentpool <NAME> $ kubectl get module <NAME> $ kubectl get project <NAME> $ kubectl get workspace <NAME>
-
check the CR events:
$ kubectl describe agentpool <NAME> $ kubectl describe module <NAME> $ kubectl describe project <NAME> $ kubectl describe workspace <NAME>
If you believe you've found a bug and cannot find an existing issue, feel free to open a new issue! Be sure to include as much information as you can about your environment.
We appreciate your enthusiasm for participating in the development of the HCP Terraform Operator. To contribute, please read the contribution guidelines.
If you think you've found a security vulnerability, we'd love to hear from you.
Follow the instructions in SECURITY.md to make a report.