feat: Manage storage nic config through machineconfig
This commit is contained in:
parent
30d3b3b478
commit
628443c06c
4 changed files with 28 additions and 14 deletions
|
|
@ -68,16 +68,19 @@ locals {
|
||||||
|
|
||||||
nodes = [
|
nodes = [
|
||||||
{
|
{
|
||||||
name = "worker01"
|
name = "worker01"
|
||||||
ip_address = "10.13.37.21"
|
ip_address = "10.13.37.21"
|
||||||
|
storage_address = "10.0.69.21"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name = "worker02"
|
name = "worker02"
|
||||||
ip_address = "10.13.37.22"
|
ip_address = "10.13.37.22"
|
||||||
|
storage_address = "10.0.69.22"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name = "worker03"
|
name = "worker03"
|
||||||
ip_address = "10.13.37.23"
|
ip_address = "10.13.37.23"
|
||||||
|
storage_address = "10.0.69.23"
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
@ -163,10 +166,11 @@ module "talos-bootstrap" {
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
for node in local.workers.nodes : {
|
for node in local.workers.nodes : {
|
||||||
name = format("k8s-wheatley-%s", node.name)
|
name = format("k8s-wheatley-%s", node.name)
|
||||||
type = "worker"
|
type = "worker"
|
||||||
ipv4_address = node.ip_address
|
ipv4_address = node.ip_address
|
||||||
pvc_disks = local.workers.pvc_disks
|
storage_address = node.storage_address
|
||||||
|
pvc_disks = local.workers.pvc_disks
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,7 @@ resource "talos_machine_configuration_apply" "config_apply_worker" {
|
||||||
cluster_name = var.node_config.cluster_name
|
cluster_name = var.node_config.cluster_name
|
||||||
vip_address = var.node_config.cluster_endpoint
|
vip_address = var.node_config.cluster_endpoint
|
||||||
node_name = format("%s.wheatley.in", var.node_config.proxmox_node)
|
node_name = format("%s.wheatley.in", var.node_config.proxmox_node)
|
||||||
|
storage_address = each.value.storage_address
|
||||||
machine_type = each.value.type
|
machine_type = each.value.type
|
||||||
talos_version = var.node_config.talos_version
|
talos_version = var.node_config.talos_version
|
||||||
gateway-api_version = var.node_config.gateway_api_version
|
gateway-api_version = var.node_config.gateway_api_version
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,14 @@ machine:
|
||||||
hostname: ${hostname}
|
hostname: ${hostname}
|
||||||
nameservers:
|
nameservers:
|
||||||
- 9.9.9.9
|
- 9.9.9.9
|
||||||
|
%{ if storage_address != false ~}
|
||||||
|
interfaces:
|
||||||
|
- interface: eth1
|
||||||
|
mtu: 9000
|
||||||
|
dhcp: false
|
||||||
|
addresses:
|
||||||
|
- ${storage_address}/24
|
||||||
|
%{ endif ~}
|
||||||
kubelet:
|
kubelet:
|
||||||
extraArgs:
|
extraArgs:
|
||||||
pod-max-pids: 1000
|
pod-max-pids: 1000
|
||||||
|
|
|
||||||
|
|
@ -17,9 +17,10 @@ variable "node_config" {
|
||||||
variable "talos_nodes" {
|
variable "talos_nodes" {
|
||||||
description = "List of Talos nodes to bootstrap"
|
description = "List of Talos nodes to bootstrap"
|
||||||
type = list(object({
|
type = list(object({
|
||||||
name = string
|
name = string
|
||||||
type = string
|
type = string
|
||||||
ipv4_address = string
|
ipv4_address = string
|
||||||
pvc_disks = optional(list(number)),
|
storage_address = optional(string)
|
||||||
|
pvc_disks = optional(list(number)),
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue