This Terraform project helps you deploy a fault-tolerant and production-grade Kubernetes cluster on Oracle Cloud without spending a dime.
You need to signup for an OCI account for this project. The entire Kubernetes cluster is built using Free tier resources.
Step 1: Clone this git repo on your local system
Step 2: Create terraform.tfvars as follows:
fingerprint = "add me" # Oracle Cloud Configuration
private_key_path = "add me" # Oracle Cloud Configuration
user_ocid = "add me" # Oracle Cloud Configuration
tenancy_ocid = "add me" # Oracle Cloud Configuration
compartment_id = "add me" # Oracle Cloud Configuration
region = "add me" # Oracle Cloud Configuration
ssh_authorized_keys = ["add me"] # Add your Public SSH key
image_ocid = "add me" # Added the Latest Image OCID for Ubuntu aarch64
cluster_name = "add me" # Cluster name (it will be appended as a prefix to your resources)
ssh_whitelist = "add me" # You public IP block to whitelist SSH and KubeAPI access. Example: 1.2.3.4/32
Step 3: Once you have successfully created the terraform.tfvars run the following commands to deploy your resources:
teraform init
terraform apply
| Name | Version |
|---|---|
| oci | >= 4.78.0 |
No providers.
| Name | Source | Version |
|---|---|---|
| k3s-cluster | ./k3s-cluster | n/a |
No resources.
| Name | Description | Type | Default | Required |
|---|---|---|---|---|
| cluster_name | Name of the K3s Cluster | string |
n/a | yes |
| compartment_id | OCI Compartment ID | string |
n/a | yes |
| fingerprint | The fingerprint of the key to use for signing | string |
n/a | yes |
| image_ocid | Image OCID | string |
n/a | yes |
| private_key_path | The path to the private key to use for signing | string |
n/a | yes |
| region | The region to connect to. Default: eu-frankfurt-1 | string |
"ap-mumbai-1" |
no |
| ssh_authorized_keys | List of authorized SSH keys | list(any) |
n/a | yes |
| ssh_whitelist | IP address or IP address block to be whitelisted for SSH and KubeAPI access | string |
n/a | yes |
| tenancy_ocid | The tenancy OCID. | string |
n/a | yes |
| user_ocid | The user OCID. | string |
n/a | yes |
| Name | Description |
|---|---|
| availability_domain | Availability Domain of the Cluster |
| cluster_name | Cluster name Prefix |
| k3s_cluster_token | n/a |
| loadbalancer_ipaddress | Loadbalancer IP address |
| server-1_ip_address | Public IP address of Server 1 |
| server-2_ip_address | Public IP address of Server 2 |
| server-3_ip_address | Public IP address of Server 3 |
| vcn_name | Cluster VCN name |
| vcn_subnet | Cluster VCN Subnet Range |