Skip to content

Commit 8ca3e36

Browse files
Merge pull request #85 from corebug/main
Make PVE bridge name and config_patches optional
2 parents 5adee1b + 553f6da commit 8ca3e36

File tree

5 files changed

+16
-12
lines changed

5 files changed

+16
-12
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ module "k8s_cluster" {
3737
}
3838
3939
network = {
40+
bridge = "vmbr0"
4041
cidr = "10.10.100.0/24"
4142
gateway = "10.10.100.1"
4243
dns_servers = ["10.0.10.1", "1.1.1.1"]
@@ -80,6 +81,7 @@ module "k8s_cluster_override" {
8081
}
8182
8283
network = {
84+
bridge = "vmbr0"
8385
cidr = "10.10.100.0/24"
8486
gateway = "10.10.100.1"
8587
dns_servers = ["10.0.10.1", "1.1.1.1"]
@@ -135,12 +137,12 @@ module "k8s_cluster_override" {
135137

136138
## Inputs
137139

138-
| Name | Description | Type | Default | Required |
139-
|------|-------------|------|---------|:--------:|
140-
| <a name="input_cluster"></a> [cluster](#input\_cluster) | Cluster configuration | <pre>object({<br/> name = string # The name of the cluster<br/> config_patches = list(string) # List of configuration patches to apply to the Talos machine configuration<br/> node = string # Default node to deploy the vms on<br/> datastore = string # Default datastore to deploy the vms on<br/> vm_base_id = number # The first VM ID for Proxmox VMs, with subsequent IDs counted up from it<br/> install_disk = optional(string, "/dev/sda") # The disk to install Talos on<br/> })</pre> | n/a | yes |
140+
| Name | Description | Type | Default | Required |
141+
|------|-------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|:--------:|
142+
| <a name="input_cluster"></a> [cluster](#input\_cluster) | Cluster configuration | <pre>object({<br/> name = string # The name of the cluster<br/> config_patches = optional(list(string), []) # List of configuration patches to apply to the Talos machine configuration<br/> node = string # Default node to deploy the vms on<br/> datastore = string # Default datastore to deploy the vms on<br/> vm_base_id = number # The first VM ID for Proxmox VMs, with subsequent IDs counted up from it<br/> install_disk = optional(string, "/dev/sda") # The disk to install Talos on<br/> })</pre> | n/a | yes |
141143
| <a name="input_controlplane"></a> [controlplane](#input\_controlplane) | Specification of controlplane nodes | <pre>object({<br/> count = number<br/> specs = object({<br/> cpu = number<br/> memory = number<br/> disk = number<br/> })<br/> overrides = optional(map(object({<br/> datastore = optional(string, null)<br/> node = optional(string, null)<br/> cpu = optional(number, null)<br/> memory = optional(number, null)<br/> disk = optional(number, null)<br/> install_disk = optional(string, null)<br/> network = optional(object({<br/> ip_address = string<br/> cidr = string<br/> gateway = string<br/> vlan_id = optional(number, null)<br/> }), null)<br/> })), {})<br/> })</pre> | n/a | yes |
142-
| <a name="input_image"></a> [image](#input\_image) | Variable to define the image configuration for Talos machines | <pre>object({<br/> version = string<br/> extensions = list(string)<br/> factory_url = optional(string, "https://factory.talos.dev")<br/> arch = optional(string, "amd64")<br/> platform = optional(string, "nocloud")<br/> proxmox_datastore = optional(string, "local")<br/> })</pre> | n/a | yes |
143-
| <a name="input_network"></a> [network](#input\_network) | Network configuration for nodes | <pre>object({<br/> cidr = string<br/> gateway = string<br/> dns_servers = list(string)<br/> vlan_id = optional(number, null)<br/> })</pre> | n/a | yes |
144+
| <a name="input_image"></a> [image](#input\_image) | Variable to define the image configuration for Talos machines | <pre>object({<br/> version = string<br/> extensions = list(string)<br/> factory_url = optional(string, "https://factory.talos.dev")<br/> arch = optional(string, "amd64")<br/> platform = optional(string, "nocloud")<br/> proxmox_datastore = optional(string, "local")<br/> })</pre> | n/a | yes |
145+
| <a name="input_network"></a> [network](#input\_network) | Network configuration for nodes | <pre>object({<br/> bridge = string<br/> cidr = string<br/> gateway = string<br/> dns_servers = list(string)<br/> vlan_id = optional(number, null)<br/> })</pre> | n/a | yes |
144146
| <a name="input_worker"></a> [worker](#input\_worker) | Specification of worker nodes | <pre>object({<br/> count = number<br/> specs = object({<br/> cpu = number<br/> memory = number<br/> disk = number<br/> })<br/> overrides = optional(map(object({<br/> datastore = optional(string, null)<br/> node = optional(string, null)<br/> cpu = optional(number, null)<br/> memory = optional(number, null)<br/> disk = optional(number, null)<br/> install_disk = optional(string, null)<br/> network = optional(object({<br/> ip_address = string<br/> cidr = string<br/> gateway = string<br/> vlan_id = optional(number, null)<br/> }), null)<br/> })), {})<br/> })</pre> | n/a | yes |
145147

146148
## Outputs
@@ -154,4 +156,4 @@ module "k8s_cluster_override" {
154156

155157
## Repo Activity
156158
![Alt](https://repobeats.axiom.co/api/embed/d5c6fd467a9febbf9bea34fbcd6eb31174975075.svg "Repobeats analytics image")
157-
<!-- END_TF_DOCS -->
159+
<!-- END_TF_DOCS -->

examples/main.example

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ module "k8s_cluster" {
1515
}
1616

1717
network = {
18+
brige = "vmbr0"
1819
cidr = "10.10.100.0/24"
1920
gateway = "10.10.100.1"
2021
dns_servers = ["10.0.10.1", "1.1.1.1"]
@@ -93,4 +94,4 @@ module "k8s_cluster_override" {
9394
}
9495
}
9596
}
96-
}
97+
}

proxmox_vm_controlplanes.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ resource "proxmox_virtual_environment_vm" "controlplane" {
1313
disk = each.value.disk
1414
proxmox_node = each.value.node
1515
})
16-
tags = [var.cluster.name]
16+
tags = [var.cluster.name]
1717
vm_id = each.value.vm_id
1818
machine = "q35"
1919
scsi_hardware = "virtio-scsi-single"
@@ -33,7 +33,7 @@ resource "proxmox_virtual_environment_vm" "controlplane" {
3333
}
3434

3535
network_device {
36-
bridge = "vmbr0"
36+
bridge = var.network.bridge
3737
vlan_id = var.network.vlan_id
3838
}
3939

proxmox_vm_worker.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ resource "proxmox_virtual_environment_vm" "worker" {
1313
disk = each.value.disk
1414
proxmox_node = each.value.node
1515
})
16-
tags = [var.cluster.name]
16+
tags = [var.cluster.name]
1717
vm_id = each.value.vm_id
1818
machine = "q35"
1919
scsi_hardware = "virtio-scsi-single"
@@ -33,7 +33,7 @@ resource "proxmox_virtual_environment_vm" "worker" {
3333
}
3434

3535
network_device {
36-
bridge = "vmbr0"
36+
bridge = var.network.bridge
3737
vlan_id = var.network.vlan_id
3838
}
3939

variables.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ variable "cluster" {
22
description = "Cluster configuration"
33
type = object({
44
name = string # The name of the cluster
5-
config_patches = list(string) # List of configuration patches to apply to the Talos machine configuration
5+
config_patches = optional(list(string), []) # List of configuration patches to apply to the Talos machine configuration
66
node = string # Default node to deploy the vms on
77
datastore = string # Default datastore to deploy the vms on
88
vm_base_id = number # The first VM ID for Proxmox VMs, with subsequent IDs counted up from it
@@ -55,6 +55,7 @@ variable "image" {
5555
variable "network" {
5656
description = "Network configuration for nodes"
5757
type = object({
58+
bridge = optional(string, "vmbr0") # The bridge to use for the network interface
5859
cidr = string
5960
gateway = string
6061
dns_servers = list(string)

0 commit comments

Comments
 (0)