Skip to content

Commit 90aad99

Browse files
author
Chanwit Kaewkasi
authored
Merge pull request #727 from weaveworks/update-docs-v0.15.0
update docs for v0.15.0
2 parents 1aec7e9 + 8c4498e commit 90aad99

25 files changed

+120
-68
lines changed

README.md

+13-29
Original file line numberDiff line numberDiff line change
@@ -16,49 +16,33 @@ TF-controller offers many GitOps models:
1616

1717
## Quickstart and documentation
1818

19-
To get started check out this [guide](https://docs.gitops.weave.works/docs/terraform/get-started/) on how to GitOps your Terraform resources with TF-controller and Flux.
19+
To get started check out this [guide](https://weaveworks.github.io/tf-controller/getting_started/) on how to GitOps your Terraform resources with TF-controller and Flux.
2020

21-
Check out the [documentation](https://docs.gitops.weave.works/docs/terraform/overview/) for a list of [features](https://docs.gitops.weave.works/docs/terraform/overview/#features) and [use cases](https://docs.gitops.weave.works/docs/terraform/Using%20Terraform%20CRD/provision/).
21+
Check out the [documentation](https://weaveworks.github.io/tf-controller/) and [use cases](https://weaveworks.github.io/tf-controller/use_tf_controller/).
2222

2323
## Roadmap
2424

25-
### Q3 2022
26-
* [x] Performance
27-
* [x] Scalability
28-
* [x] Interop with Notification controller's Events and Alert
29-
* [x] Validation webhooks for the planning stage
30-
31-
### Q4 2022
32-
* [x] ~~CRD wrappers~~ A new component model for Terraform modules
33-
* [x] Dependency management for TF-controller objects
34-
* [x] AWS package for TF-controller (e.g. EKS, RDS, etc.)
35-
* [x] CLI for Weave GitOps
36-
37-
### Q1 2023
38-
* [x] `v1alpha2` API
39-
* [x] Flux v2.0.0-rc support
40-
* [x] Better Terraform Cloud integration
41-
4225
### Q2 2023
43-
* [ ] Write back and show plan in PRs (Atlantis-like experience)
44-
* [ ] Type safety for custom backends
45-
* [ ] Selectable Terraform versions
26+
* [x] Selectable Terraform versions
4627
* [ ] Flux v2.0.0 GA support
47-
* [ ] Break-the-glass feature
28+
* [x] Break-the-glass feature
29+
* [ ] Enhanced security (the lockdown mode)
30+
* [x] Containerd compatibility verification
4831

4932
### Q3 2023
50-
* [ ] `v1beta1` API (stabilization)
51-
* [ ] Observability - logging from the different stages of the runner
52-
* [ ] CLI to GitOpsify existing Terraform workflows
53-
* [ ] Enhanced security (the lockdown mode)
33+
* [ ] Write back and show plan in PRs (Atlantis-like experience)
34+
* [ ] CLI to GitOpsify existing Terraform workflows (UX improvement for CLI)
35+
* [ ] Type safety for custom backends
36+
* [ ] Improvement GitOps dependency management
5437
* [ ] External drift detector
55-
* [ ] Cloud cost estimation
38+
* [ ] Cloud cost estimation
5639

5740
### Q4 2023
41+
* [ ] Observability - logging from the different stages of the runner
42+
* [ ] `v1beta1` API (stabilization)
5843
* [ ] Azure package for TF-controller (e.g. AKS, CosmosDB, etc.)
5944
* [ ] GCP package for TF-controller (e.g. GKE, CloudSQL, etc.)
6045
* [ ] ARM64 & Gravitron support
61-
* [ ] Containerd compatibility verification
6246

6347
### Q1 2024
6448
* [ ] `v1beta2` API

api/v1alpha2/groupversion_info.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
// Package v1alpha1 contains API Schema definitions for the infra v1alpha1 API group
17+
// Package v1alpha2 contains API Schema definitions for the infra v1alpha2 API group
1818
// +kubebuilder:object:generate=true
1919
// +groupName=infra.contrib.fluxcd.io
2020
package v1alpha2

docs/getting_started.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@
44

55
Here are the requirements you need to set up before you start:
66

7-
1. Flux v0.32.0 or later (not only the CLI, but also the controllers on the cluster). If you are not sure about the Flux version on your cluster, please re-bootstrap your cluster.
8-
2. TF-controller uses **the Controller/Runner architecture**. The Controller acts as a client, and talks to each Runner's Pod via gRPC. Please make sure
7+
1. For Terraform Controller **v0.15+**, it requires **Flux v2.0** or later (not only the CLI, but also the controllers on the cluster). If you are not sure about the Flux version on your cluster, please re-bootstrap your cluster.
8+
2. For Terraform Controller v0.13 and v0.14, Flux 2 v0.32 - v0.41 (of course, not only the CLI, but also the controllers on the cluster).
9+
3. TF-controller uses **the Controller/Runner architecture**. The Controller acts as a client, and talks to each Runner's Pod via gRPC. Please make sure
910
1. **Each Runner's Pod in each Namespace** is allowed to open, and serve at **port 30000** (the gRPC port of a Runner), and the Controller can connect to it.
1011
2. **The Controller** needs to download tar.gz BLOBs from the **Source controller** via **port 80**.
1112
3. **The Controller** needs to post the events to the **Notification controller** via **port 80**.
1213

1314
## Installation
1415

1516
Before using TF-controller, you have to install Flux by using either `flux install` or `flux bootstrap` command.
16-
Please note that TF-controller now requires **Flux v0.32.0** or later, so please make sure you have the latest version of Flux.
17+
Please note that TF-controller now requires **Flux v2.0** or later, so please make sure you have the latest version of Flux.
1718
After that you can install TF-controller with Flux HelmRelease by:
1819

1920
```shell
@@ -43,7 +44,7 @@ please see [chart readme](https://github.com/weaveworks/tf-controller/tree/main/
4344
Alternatively, you can install TF-controller via `kubectl`:
4445

4546
```shell
46-
export TF_CON_VER=v0.13.1
47+
export TF_CON_VER=v0.15.0
4748
kubectl apply -f https://github.com/weaveworks/tf-controller/releases/download/${TF_CON_VER}/tf-controller.crds.yaml
4849
kubectl apply -f https://github.com/weaveworks/tf-controller/releases/download/${TF_CON_VER}/tf-controller.rbac.yaml
4950
kubectl apply -f https://github.com/weaveworks/tf-controller/releases/download/${TF_CON_VER}/tf-controller.deployment.yaml
@@ -76,7 +77,7 @@ The GitOps automation mode could be enabled by setting `.spec.approvePlan=auto`.
7677
and automatically applied for you.
7778

7879
```yaml
79-
apiVersion: infra.contrib.fluxcd.io/v1alpha1
80+
apiVersion: infra.contrib.fluxcd.io/v1alpha2
8081
kind: Terraform
8182
metadata:
8283
name: helloworld

docs/how_to/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# How to
22

3+
- [How to troubleshoot with **Break the Glass** mode](troubleshooting_with_break_the_glass_mode.md)
34
- [How to **backup and restore** a Terraform state](backup_and_restore_a_Terraform_state.md)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Break the glass
2+
3+
## What is break the glass?
4+
5+
"Break the glass" refers to a troubleshooting mode specifically designed
6+
to provide a manual solution when the Terraform controller (TF-controller)
7+
is not performing as expected. There are two primary methods of initiating this mode:
8+
9+
1. Using the `tfctl` command-line tool.
10+
2. Setting the `spec.breakTheGlass` field to `true` in the Terraform object.
11+
12+
## Using `tfctl` to Break the Glass
13+
14+
To start a one-time troubleshooting session, you can use the `tfctl break-glass` command. For instance:
15+
16+
```shell
17+
tfctl break-glass hello-world
18+
```
19+
20+
This command initiates a session that allows you to execute any Terraform command
21+
to rectify the issues with your Terraform resources. It is noteworthy that this command
22+
does not require setting the `spec.breakTheGlass` field to `true` in the Terraform object.
23+
24+
After resolving the issues, you can simply exit the shell.
25+
GitOps will then continue to reconcile the Terraform object.
26+
27+
## Break the glass with `spec.breakTheGlass` field
28+
29+
This feature is particularly useful for troubleshooting Terraform objects at their initialization stage or in situations with unexpected errors.
30+
It is generally not recommended to use this mode routinely for fixing Terraform resources.
31+
32+
You can enable the 'Break the Glass' feature for every reconciliation by setting the `breakTheGlass` field to `true` in the `spec` of the Terraform object.
33+
34+
Here is a sample example:
35+
36+
```yaml
37+
apiVersion: infra.contrib.fluxcd.io/v1alpha2
38+
kind: Terraform
39+
metadata:
40+
name: hello-world
41+
namespace: flux-system
42+
spec:
43+
breakTheGlass: true
44+
interval: 1m
45+
path: ./
46+
sourceRef:
47+
kind: GitRepository
48+
name: helloworld
49+
namespace: flux-system
50+
```

docs/index.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ To get started, follow the [getting started](./getting_started.md) guide.
5656

5757
## Support Matrix
5858

59-
| Version | Terraform | Source Controller | Flux v2 |
60-
|:-----------:|:---------:|:-----------------:|:-------:|
61-
| **v0.13.1** | v1.3.1 | v0.31.0 | v0.36.x |
62-
| v0.12.0 | v1.1.9 | v0.26.1 | v0.32.x |
59+
| Version | Terraform | Source Controller | Flux v2 |
60+
|:-------:|:---------:|:-----------------:|:-------:|
61+
| v0.15 | v1.3.9 | v1.0.x | v2.0.x |
62+
| v0.14 | v1.3.9 | v0.31.0 | v0.41.x |
63+
| v0.13 | v1.3.1 | v0.31.0 | v0.36.x |
64+
| v0.12 | v1.1.9 | v0.26.1 | v0.32.x |

docs/tfctl.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@
44

55
## Installation
66

7-
You can download the `tfctl` binary via the GitHub releases page: [https://github.com/weaveworks/tf-controller/releases](https://github.com/weaveworks/tf-controller/releases)
7+
To install `tfctl` via Homebrew, run the following command:
8+
9+
```shell
10+
brew install weaveworks/tap/tfctl
11+
```
12+
13+
You can also download the `tfctl` binary via the GitHub releases page: [https://github.com/weaveworks/tf-controller/releases](https://github.com/weaveworks/tf-controller/releases).
814

915
```
1016
Usage:

docs/use_tf_controller/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- [Use TF-controller to provision Terraform resources that are required **health checks**](to_provision_Terraform_resources_that_are_required_health_checks.md)
1313
- [Use TF-controller to provision resources and **destroy them when the Terraform object gets deleted**](to_provision_resources_and_destroy_them_when_the_Terraform_object_gets_deleted.md)
1414
- [Use TF-controller to **force unlock** Terraform states](to_force_unlock_Terraform_states.md)
15+
- [Use TF-controller with Terraform Runners enabled via Env Variables](with_tf_runner_logging.md)
1516
- [Use TF-controller to provision resources with **customized Runner Pods**](to_provision_resources_with_customized_Runner_Pods.md)
1617
- [Use TF-controller with **Terraform Enterprise**](with_Terraform_Enterprise.md)
1718
- [Use TF-controller with **primitive modules**](with_primitive_modules.md)

docs/use_tf_controller/to_detect_drifts_only_without_plan_or_apply.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
We can set `.spec.approvePlan` to `disable` to tell the controller to detect drifts of your Terraform resources only. Doing so will skip the `plan` and `apply` stages.
44

55
```yaml hl_lines="7"
6-
apiVersion: infra.contrib.fluxcd.io/v1alpha1
6+
apiVersion: infra.contrib.fluxcd.io/v1alpha2
77
kind: Terraform
88
metadata:
99
name: hello-world

docs/use_tf_controller/to_force_unlock_Terraform_states.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The recommended way is to do manual force unlock. To manually `force-unlock`, yo
1515
as the following example:
1616

1717
```yaml hl_lines="14-16"
18-
apiVersion: infra.contrib.fluxcd.io/v1alpha1
18+
apiVersion: infra.contrib.fluxcd.io/v1alpha2
1919
kind: Terraform
2020
metadata:
2121
name: helloworld

docs/use_tf_controller/to_plan_and_manually_apply_Terraform_resources.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ the `path` field specifies the location of the configuration files,
2727
and the `sourceRef` field points to the GitRepository object.
2828

2929
```yaml hl_lines="7"
30-
apiVersion: infra.contrib.fluxcd.io/v1alpha1
30+
apiVersion: infra.contrib.fluxcd.io/v1alpha2
3131
kind: Terraform
3232
metadata:
3333
name: helloworld
@@ -62,7 +62,7 @@ This process is known as the plan & manual approval workflow,
6262
as it involves generating a plan and requiring manual approval before the changes are applied.
6363

6464
```yaml hl_lines="7"
65-
apiVersion: infra.contrib.fluxcd.io/v1alpha1
65+
apiVersion: infra.contrib.fluxcd.io/v1alpha2
6666
kind: Terraform
6767
metadata:
6868
name: hello-world

docs/use_tf_controller/to_provision_Terraform_resources_that_are_required_health_checks.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ We can use standard Go template expressions, like `${{ .rdsAddress }}`, to refer
2525
We support two types of health checks, `tcp` amd `http`. The `tcp` type allows us to verify a TCP connection, while the `http` type is for verify an HTTP URL. The default timeout of each health check is 20 seconds.
2626

2727
```yaml hl_lines="14-25"
28-
apiVersion: infra.contrib.fluxcd.io/v1alpha1
28+
apiVersion: infra.contrib.fluxcd.io/v1alpha2
2929
kind: Terraform
3030
metadata:
3131
name: helloworld

docs/use_tf_controller/to_provision_resources_and_auto_approve.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ your infrastructure is properly managed and controlled.
4040
The following is an example of a `Terraform` object; we use the "auto-apply" mode:
4141

4242
```yaml hl_lines="8"
43-
apiVersion: infra.contrib.fluxcd.io/v1alpha1
43+
apiVersion: infra.contrib.fluxcd.io/v1alpha2
4444
kind: Terraform
4545
metadata:
4646
name: helloworld

docs/use_tf_controller/to_provision_resources_and_destroy_them_when_the_Terraform_object_gets_deleted.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ To enable destroy resources on object deletion, set `.spec.destroyResourcesOnDel
1111
~> **WARNING:** This feature will destroy your resources on the cloud if the Terraform object gets deleted. Please use it with cautions.
1212

1313
```yaml hl_lines="8"
14-
apiVersion: infra.contrib.fluxcd.io/v1alpha1
14+
apiVersion: infra.contrib.fluxcd.io/v1alpha2
1515
kind: Terraform
1616
metadata:
1717
name: helloworld

docs/use_tf_controller/to_provision_resources_and_obtain_outputs.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Outputs created by Terraform can be written to a secret using `.spec.writeOutput
77
We can specify a target secret in `.spec.writeOutputsToSecret.name`, and the controller will write all outputs to the secret by default.
88

99
```yaml hl_lines="14-15"
10-
apiVersion: infra.contrib.fluxcd.io/v1alpha1
10+
apiVersion: infra.contrib.fluxcd.io/v1alpha2
1111
kind: Terraform
1212
metadata:
1313
name: helloworld
@@ -29,7 +29,7 @@ spec:
2929
We can choose only a subset of outputs by specify output names we'd like to write in the `.spec.writeOutputsToSecret.outputs` array.
3030

3131
```yaml hl_lines="16-18"
32-
apiVersion: infra.contrib.fluxcd.io/v1alpha1
32+
apiVersion: infra.contrib.fluxcd.io/v1alpha2
3333
kind: Terraform
3434
metadata:
3535
name: helloworld
@@ -59,7 +59,7 @@ TF-controller supports mapping output name using the `old_name:new_name` format.
5959
In the following example, we renamed `age_key` output as `age.agekey` entry for the `helloworld-output` Secret's data, so that other components in the GitOps pipeline could consume it.
6060

6161
```yaml hl_lines="16-17"
62-
apiVersion: infra.contrib.fluxcd.io/v1alpha1
62+
apiVersion: infra.contrib.fluxcd.io/v1alpha2
6363
kind: Terraform
6464
metadata:
6565
name: helloworld
@@ -84,7 +84,7 @@ As an example, operators such as [kubernetes-replicator](https://github.com/mitt
8484
allow replicating secrets from one namespace to another but use annotations to do so.
8585

8686
```yaml hl_lines="16-19"
87-
apiVersion: infra.contrib.fluxcd.io/v1alpha1
87+
apiVersion: infra.contrib.fluxcd.io/v1alpha2
8888
kind: Terraform
8989
metadata:
9090
name: helloworld

docs/use_tf_controller/to_provision_resources_with_customized_Runner_Pods.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ For example, for Azure AKS to grant pod active directory permissions using Azure
77
a label like `aadpodidbinding: myIdentity` on the pod is required.
88

99
```yaml
10-
apiVersion: infra.contrib.fluxcd.io/v1alpha1
10+
apiVersion: infra.contrib.fluxcd.io/v1alpha2
1111
kind: Terraform
1212
metadata:
1313
name: helloworld
@@ -33,7 +33,7 @@ spec:
3333
By default, the Terraform controller uses `RUNNER_POD_IMAGE` environment variable to identify the Runner Pod's image to use. You can customize the image on the global level by updating the value of the environment variable or, you can specify an image to use per Terraform object for its reconciliation.
3434

3535
```yaml
36-
apiVersion: infra.contrib.fluxcd.io/v1alpha1
36+
apiVersion: infra.contrib.fluxcd.io/v1alpha2
3737
kind: Terraform
3838
metadata:
3939
name: helloworld
@@ -56,4 +56,4 @@ You can use [`runner.Dockerfile`](https://github.com/weaveworks/tf-controller/bl
5656
## Customize Runner Pod Specifications
5757

5858
You can also customize various Runner Pod `spec` fields to control and configure how the Runner Pod runs.
59-
For example, you can configure Runner Pod `spec` affinity and tolerations if you need to run in on a specific set of nodes. Please see [RunnerPodSpec](https://weaveworks.github.io/tf-controller/References/terraform/#infra.contrib.fluxcd.io/v1alpha1.RunnerPodSpec) for a list of the configurable Runner Pod `spec` fields.
59+
For example, you can configure Runner Pod `spec` affinity and tolerations if you need to run in on a specific set of nodes. Please see [RunnerPodSpec](https://weaveworks.github.io/tf-controller/References/terraform/#infra.contrib.fluxcd.io/v1alpha2.RunnerPodSpec) for a list of the configurable Runner Pod `spec` fields.

docs/use_tf_controller/to_set_variables_for_Terraform_resources.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Note that in the case of the same variable key being passed multiple times, the
3131
the lattermost instance of the key passed to `varsFrom`.
3232

3333
```yaml hl_lines="15-20 22-28"
34-
apiVersion: infra.contrib.fluxcd.io/v1alpha1
34+
apiVersion: infra.contrib.fluxcd.io/v1alpha2
3535
kind: Terraform
3636
metadata:
3737
name: helloworld
@@ -77,7 +77,7 @@ variable "cluster_spec" {
7777
```
7878

7979
```yaml hl_lines="17-20"
80-
apiVersion: infra.contrib.fluxcd.io/v1alpha1
80+
apiVersion: infra.contrib.fluxcd.io/v1alpha2
8181
kind: Terraform
8282
metadata:
8383
name: helloworld

docs/use_tf_controller/with_GitOps_dependency_management.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ It is configured to use the `auto-apply` mode, and write outputs to the secret `
2323

2424
```yaml hl_lines="20-24"
2525
---
26-
apiVersion: infra.contrib.fluxcd.io/v1alpha1
26+
apiVersion: infra.contrib.fluxcd.io/v1alpha2
2727
kind: Terraform
2828
metadata:
2929
name: aws-s3-bucket
@@ -68,7 +68,7 @@ Please note that we use `${{` and `}}` as the delimiters for the variable name,
6868

6969
```yaml hl_lines="11 18 20-21"
7070
---
71-
apiVersion: infra.contrib.fluxcd.io/v1alpha1
71+
apiVersion: infra.contrib.fluxcd.io/v1alpha2
7272
kind: Terraform
7373
metadata:
7474
name: aws-s3-bucket-acl
@@ -102,7 +102,7 @@ To avoid this, we need to add the `kustomize.toolkit.fluxcd.io/substitute: disab
102102

103103
```yaml hl_lines="8"
104104
---
105-
apiVersion: infra.contrib.fluxcd.io/v1alpha1
105+
apiVersion: infra.contrib.fluxcd.io/v1alpha2
106106
kind: Terraform
107107
metadata:
108108
name: aws-s3-bucket-acl

docs/use_tf_controller/with_Terraform_Enterprise.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ In your Terraform object, you'll have to 1. disable the backend by setting `spec
5353

5454
```yaml hl_lines="10-14"
5555
---
56-
apiVersion: infra.contrib.fluxcd.io/v1alpha1
56+
apiVersion: infra.contrib.fluxcd.io/v1alpha2
5757
kind: Terraform
5858
metadata:
5959
name: tfe-demo

docs/use_tf_controller/with_a_custom_backend.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The tfstate is stored in a secret named: `tfstate-${workspace}-${secretSuffix}`.
77
If you wish to use a custom backend, you can configure it by defining the `.spec.backendConfig.customConfiguration` with one of the backends such as **GCS** or **S3**, for example:
88

99
```yaml hl_lines="9-21"
10-
apiVersion: infra.contrib.fluxcd.io/v1alpha1
10+
apiVersion: infra.contrib.fluxcd.io/v1alpha2
1111
kind: Terraform
1212
metadata:
1313
name: helloworld

docs/use_tf_controller/with_an_OCI_Artifact_as_Source.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ spec:
3030
ref:
3131
tag: main
3232
---
33-
apiVersion: infra.contrib.fluxcd.io/v1alpha1
33+
apiVersion: infra.contrib.fluxcd.io/v1alpha2
3434
kind: Terraform
3535
metadata:
3636
name: helloworld-tf-oci

0 commit comments

Comments
 (0)