The FreeLight Helm Charts repository provides a collection of Helm charts for deploying FreeLight applications into Kubernetes clusters.
- Kubernetes 1.20+
- Helm 3.x+
- Terraform (optional)
This assumes you have a Kubernetes cluster setup and Helm installed. If you do not, see the Setting up the Cluster section below.
If you do not have a Kubernetes cluster setup, you can use this repo to setup a cluster using Terraform.
The FreeLight Helm Charts repo contains terraform modules that can setup a cluster in several ways. The modules are located in the tf/
directory. The modules are:
- gcp
To get started, clone this repo:
git clone https://github.com/OurFreeLight/FreeLightHelmCharts.git
Then, change into the tf
directory:
cd FreeLightHelmCharts/tf
Then, change into the directory of the module you want to use. For example:
cd gcp
Create a new custom.tfvars
file and add the following:
gcp_project_id = "YOUR_GCP_PROJECT_ID"
gcp_credentials_file = "PATH_TO_YOUR_GCP_CREDENTIALS_FILE"
domain = "staging.freelight.org"
frontend_deployment_type = "gcs"
backend_deployment_type = "gke"
k8s_version = "1.27.4-gke.0"
k8s_type = "gke_standard"
gcp_vm_instance_type = "e2-medium"
#api_static_ip_name = "freelight-vm-static-ip"
delete_protection = false
Add any other variables you may need to that file, then goto the GCP section below.
The GCP module will create a Kubernetes cluster in GCP. To use it, you will need to have a GCP account and a project setup. You will also need to have the gcloud command line tool installed.
Set any other variables you may need in the custom.tfvars
file, then run the following commands:
./setup.sh
./deploy.sh
This will create a e2-medium VM instance in GCP. Once the instance is created, WAIT 30 SECONDS for the startup script to finish. You can view the status of the startup script in the VM's Serial Port 1 logs. Once the startup script is finished, SSH into the instance and finish the installation by entering:
/var/run/finish-install.sh
This will finish installing the selected Kubernetes distribution that was set in k8s_type
and setup the cluster. The VM will reboot when finished. Once the VM is back up, SSH back into the instance, get your kubeconfig file, and you are ready to deploy FreeLight applications using the Helm Deployment section above.