These Terraform scripts automate Coder's installation and the provisioning of its necessary infrastructure on the major cloud providers (AWS coming soon). You can use this repo to quickly deploy Coder, or as a template for a custom Coder installation.
Within each directory is a main.tf
file, which serves as the entry point for Terraform.
It defines the required providers Terraform will use to provision the infrastructure.
In this case, Coder needs the following providers:
- AWS, Azure, GCP, etc.
- Kubernetes
- Helm
Next, the <cloud-provider>.tf
file provisions the resources below:
- Private network
- Subnet within the private network
- Kubernetes cluster
- Managed node pool with auto-scaling
Once the above resources are created, the k8s.tf
file steps through the following:
- Cluster authentication
- Namespace creation
- Retrieval of Coder's Helm chart
- Helm install of Coder
Note that the terraform.tfvars
file contains the variable definitions.
You are expected to change these values accordingly.
- Install Terraform
- Install
kubectl
- Clone this repository
cd
into your cloud provider directory- Run
terraform init
to initialize Terraform - Define your variables in the
terraform.tfvars
file - Run
terraform plan
to view the resources Terraform will create - Run
terraform apply
to provision such resources & install Coder
Once terraform apply
is complete, you'll need to access Coder via the external IP of the ingress controller.
To do this, take the following steps:
- Run the cloud provider-specific command to connect to your cluster
- Run
kubectl get svc -n coder
- Copy & paste the
EXTERNAL_IP
value in your browser