Skip to content

Commit 1c7e12f

Browse files
Terraform instructions for installing a Codefresh runtime
1 parent 3809e2e commit 1c7e12f

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

_docs/installation/gitops/hybrid-gitops-helm-installation.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,45 @@ kubectl annotate --overwrite crds $(kubectl get crd | grep argoproj.io | awk '{p
9595
kubectl annotate --overwrite crds $(kubectl get crd | grep argoproj.io | awk '{print $1}' | xargs) meta.helm.sh/release-namespace=$NAMESPACE
9696
```
9797

98+
## Using Terraform for installation
99+
100+
You can also use Terraform to install a Codefresh runtime with the [Helm provider](https://registry.terraform.io/providers/hashicorp/helm/latest/docs).
101+
102+
Here is an example
103+
104+
```hcl
105+
resource "helm_release" "my_gitops_runtime" {
106+
name = "my-codefresh-runtime"
107+
108+
repository = "https://chartmuseum.codefresh.io/gitops-runtime"
109+
chart = "gitops-runtime"
110+
namespace = "my-codefresh-runtime"
111+
version = "0.2.13-alpha.1"
112+
create_namespace = true
113+
devel = true
114+
set {
115+
name = "global.codefresh.accountId"
116+
value = var.cf_account_id
117+
}
118+
set {
119+
name = "global.codefresh.userToken.token"
120+
value = var.cf_token
121+
}
122+
set {
123+
name = "global.runtime.name"
124+
value = "from-terraform"
125+
}
126+
}
127+
```
128+
129+
Feel free to user a different chart version and your own runtime name. You can get both values for Codefresh token and account ID from the Codefresh UI as explained in the previous section.
130+
131+
By default the Codefresh runtime can deploy to the cluster it is installed on.
132+
You can also [use Terraform to connect additional]({{site.baseurl}}/docs/installation/gitops/managed-cluster/#add-a-managed-cluster-with-terraform) external clusters to your runtime.
133+
134+
135+
136+
98137
## Image overrides for private registries
99138
If you use private registries, you need to override specific image values for the different subcharts and container images.
100139
We have a utility to help override image values for GitOps Runtimes. The utility creates values files that match the structure of the subcharts, allowing you to easily replace image registries. During chart installation, you can provide these values files to override the images, as needed.

0 commit comments

Comments
 (0)