Skip to content

A terraform module to create k3s clusters in proxmox

Notifications You must be signed in to change notification settings

akazantzidis/k3s-tf

Repository files navigation

Requirements

Name Version
terraform >=0.13
proxmox >=2.9.11

Providers

Name Version
proxmox 2.9.14
random 3.5.1

Modules

No modules.

Resources

Name Type
proxmox_vm_qemu.master resource
proxmox_vm_qemu.worker resource
random_password.k3s-token resource
random_shuffle.random_node resource

Inputs

Name Description Type Default Required
api_vip VIP ip address for k8s api.Can be an existing infrastructure loadbalancer. string "" no
cilium Install Cillium cni bool false no
cilium_helm_flags Cillium helm arguments delimited with ','.Example key1=value,key2=value string "k8sServicePort=6443,ipam.mode=kubernetes,operator.replicas=1" no
cilium_version Cillium version to install.Example 1.13.2 string "" no
cloudinit_nameserver VM's DNS server string null no
cloudinit_search_domain VM's DNS domain search string null no
cluster_name Cluster name. string "default-cluster" no
ha_control_plane Set HA for K3S control plane.If HA true then 3 master nodes are provisioned. bool false no
k3s_cloud_controller_disable k3s default network cloud controller configuration bool true no
k3s_cluster_cidr k3s cluster pod cidr configuration string "10.86.0.0/16" no
k3s_disable k3s addons disable configuration list(string) [] no
k3s_flannel_backend k3s default network backend configuration string "vxlan" no
k3s_kube_apiserver_args k3s api server extra configuration list(string) [] no
k3s_kube_control_manag_args k3s controller-manager extra configuration list(string)
[
"bind-address=0.0.0.0"
]
no
k3s_kube_proxy_args k3s kube-proxy extra configuration list(string)
[
"bind-address=0.0.0.0"
]
no
k3s_kube_proxy_disable k3s default kube-proxy configuration bool false no
k3s_kube_sched_args k3s scheduler extra configuration list(string)
[
"bind-address=0.0.0.0"
]
no
k3s_master_kubelet_args k3s masters kubelet arguments list(string) [] no
k3s_master_node_labels K3s master labels list(string) [] no
k3s_master_node_taints k3s master taints list(string) [] no
k3s_network_policy_disable k3s default network policy controller configuration bool false no
k3s_sans K3s default certificate included entries configuration list(string) null no
k3s_secrets_encryption_enable K3s default secrets encryption configuration bool true no
k3s_service_cidr K3s cluster service cidr configuration string "10.88.0.0/16" no
k3s_snapshotter k3s default snapshotter configuration string "native" no
k3s_version The k3s version to be installed.Eg. vX.Y.Z-rc1 string "" no
k3s_worker_kubelet_args k3s workers kubelet arguments list(string) [] no
k3s_worker_node_labels k3s worker labels list(string) [] no
k3s_worker_node_taints k3s worker taints list(string) [] no
k3s_worker_protect_kernel_defaults k3s protect kernel defaults configuration bool false no
k3s_write_kubeconfig_mode K3s default kube-config configuration string "640" no
kube_vip_dev n/a string "eth0" no
kube_vip_enable n/a bool false no
masters Master nodes configuration options
object({
node = optional(string, "")
pool = optional(string, null)
cores = optional(number, 1)
memory = optional(number, 2048)
bridge = optional(string, "vmbr0")
tag = optional(number, -1)
tags = optional(list(string), ["terraform-managed-master"])
scsihw = optional(string, "virtio-scsi-pci")
disks = optional(list(object({
id = optional(number, 0)
size = optional(string, "10G")
storage = optional(string, "local-lvm")
type = optional(string, "virtio")
discard = optional(string, null)
ssd = optional(number, 0) })), [
{
id = 0
size = "10G"
}])
image = string
ssh_user = string
user_password = string
ssh_keys = string
subnet = string
gw = string
master_start_index = optional(string, "")
})
n/a yes
pools Worker pools configuration options
list(object({
name = string
workers = optional(number, 1)
node = optional(string, "")
pool = optional(string, null)
cores = optional(number, 1)
memory = optional(number, 2048)
bridge = optional(string, "vmbr0")
tag = optional(number, -1)
tags = optional(list(string), ["terraform-managed-worker"])
scsihw = optional(string, "virtio-scsi-pci")
disks = optional(list(object({
id = optional(number, 0)
size = optional(string, "10G")
storage = optional(string, "local-lvm")
type = optional(string, "virtio")
discard = optional(string, null)
ssd = optional(number, 0) })),
[{
id = 0
size = "10G"
}])
image = string
ssh_user = string
user_password = string
ssh_keys = string
subnet = string
gw = string
worker_start_index = optional(string, "")
}))
n/a yes
private_ssh_key SSH private key to be used during provisioning.[The public one should exist in the nodes during provisioning] string n/a yes
proxmox_nodes List of proxmox nodes availiable for k3s nodes setup. list(string) n/a yes
vm_boot VM's boot device configuration string "order=virtio0" no
vm_cpu_type VM's CPU type string "host" no
vm_sockets VM's CPU sockets number 1 no

Outputs

Name Description
masters Returns a list including each master object name and ip
workers Returns a list including each node object name and ip

About

A terraform module to create k3s clusters in proxmox

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages