mirror of
				https://github.com/optim-enterprises-bv/terraform-talos.git
				synced 2025-10-29 09:32:39 +00:00 
			
		
		
		
	
			
				
					
						
					
					2e3856a9004aecb273049ff8d1b167453175c7e9
				
			
			
		
	Terraform examples
Local utilities
- terraform
- talosctl
- kubectl
- yq
Talos on Hetzner Cloud
This terraform example install Talos on HCloud with IPv4/IPv6 support.
 
Kubernetes addons
- cilium 1.10.0
- kubelet-serving-cert-approver
- metrics-server 0.5.0
- rancher.io/local-path 0.0.19
- hcloud-cloud-controller-manage v1.10.0
Prepare the base image
First, prepare variables to your environment
export TF_VAR_hcloud_token=KEY
Terraform will run the VM in recovery mode, replace the base image and take a snapshote. Do not run terraform destroy after. It will delete the snapshot.
make prepare-image
Install control plane
Generate the default talos config
make create-config create-templates
open config file terraform.tfvars and add params
# counts and type of kubernetes master nodes
controlplane = {
    count = 1,
    type  = "cpx11"
}
# regions to use
regions = ["nbg1", "fsn1", "hel1"]
# counts and type of worker nodes by redion
instances = {
    "nbg1" = {
      web_count            = 1,
      web_instance_type    = "cx11",
      worker_count         = 1,
      worker_instance_type = "cx11",
    },
    "fsn1" = {
      web_count            = 1,
      web_instance_type    = "cx11",
      worker_count         = 1,
      worker_instance_type = "cx11",
    }
    "hel1" = {
      web_count            = 1,
      web_instance_type    = "cx11",
      worker_count         = 1,
      worker_instance_type = "cx11",
    }
}
And deploy the kubernetes master nodes
make create-controlplane
Then deploy all other instances
make create-infrastructure
					Languages
				
				
								
								
									HCL
								
								80.2%
							
						
							
								
								
									Smarty
								
								11.3%
							
						
							
								
								
									Makefile
								
								8.5%
							
						
					