mirror of
https://github.com/outbackdingo/homelab-v.git
synced 2026-08-25 14:53:19 +00:00
refactor(talos): make talos_machine_config_version an optional parameter
This commit is contained in:
@@ -19,22 +19,21 @@ module "talos" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
cluster = {
|
cluster = {
|
||||||
name = "talos"
|
name = "talos"
|
||||||
# This should point to the vip as below(if nodes on layer 2) or one of the nodes (if nodes not on layer 2)
|
# This should point to the vip as below(if nodes on layer 2) or one of the nodes (if nodes not on layer 2)
|
||||||
# Note: Nodes are not on layer 2 if there is a router between them (even a mesh router)
|
# Note: Nodes are not on layer 2 if there is a router between them (even a mesh router)
|
||||||
# Not sure how it works if connected to the same router via ethernet (does it act as a switch then???)
|
# Not sure how it works if connected to the same router via ethernet (does it act as a switch then???)
|
||||||
# Ref: https://www.talos.dev/v1.9/talos-guides/network/vip/#requirements
|
# Ref: https://www.talos.dev/v1.9/talos-guides/network/vip/#requirements
|
||||||
# Note This is Kubernetes API endpoint. Different from all mentions of Talos endpoints.
|
# Note This is Kubernetes API endpoint. Different from all mentions of Talos endpoints.
|
||||||
endpoint = "192.168.1.102"
|
endpoint = "192.168.1.102"
|
||||||
# Omit this if devices are not connected on layer 2
|
vip = "192.168.1.99"
|
||||||
vip = "192.168.1.99"
|
gateway = "192.168.1.1"
|
||||||
gateway = "192.168.1.1"
|
|
||||||
# The version of talos features to use in generated machine configuration. Generally the same as image version.
|
# The version of talos features to use in generated machine configuration. Generally the same as image version.
|
||||||
# See https://github.com/siderolabs/terraform-provider-talos/blob/main/docs/data-sources/machine_configuration.md
|
# See https://github.com/siderolabs/terraform-provider-talos/blob/main/docs/data-sources/machine_configuration.md
|
||||||
talos_machine_config_version = "v1.9.2"
|
talos_machine_config_version = "v1.9.2"
|
||||||
proxmox_cluster = "homelab"
|
proxmox_cluster = "homelab"
|
||||||
kubernetes_version = "1.32.0" # renovate: github-releases=kubernetes/kubernetes
|
kubernetes_version = "1.32.0" # renovate: github-releases=kubernetes/kubernetes
|
||||||
base_domain = "stonegarden.dev"
|
base_domain = "stonegarden.dev"
|
||||||
}
|
}
|
||||||
|
|
||||||
nodes = {
|
nodes = {
|
||||||
|
|||||||
@@ -12,14 +12,16 @@ data "talos_client_configuration" "this" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
data "talos_machine_configuration" "this" {
|
data "talos_machine_configuration" "this" {
|
||||||
for_each = var.nodes
|
for_each = var.nodes
|
||||||
cluster_name = var.cluster.name
|
cluster_name = var.cluster.name
|
||||||
# This is the Kubernetes API Server endpoint.
|
# This is the Kubernetes API Server endpoint.
|
||||||
# ref - https://www.talos.dev/v1.9/introduction/prodnotes/#decide-the-kubernetes-endpoint
|
# ref - https://www.talos.dev/v1.9/introduction/prodnotes/#decide-the-kubernetes-endpoint
|
||||||
cluster_endpoint = "https://${var.cluster.endpoint}:6443"
|
cluster_endpoint = "https://${var.cluster.endpoint}:6443"
|
||||||
talos_version = var.cluster.talos_machine_config_version
|
# @formatter:off
|
||||||
machine_type = each.value.machine_type
|
talos_version = var.cluster.talos_machine_config_version != null ? var.cluster.talos_machine_config_version : (each.value.update == true ? var.image.update_version : var.image.version)
|
||||||
machine_secrets = talos_machine_secrets.this.machine_secrets
|
# @formatter:on
|
||||||
|
machine_type = each.value.machine_type
|
||||||
|
machine_secrets = talos_machine_secrets.this.machine_secrets
|
||||||
config_patches = [
|
config_patches = [
|
||||||
templatefile("${path.module}/machine-config/common.yaml.tftpl", {
|
templatefile("${path.module}/machine-config/common.yaml.tftpl", {
|
||||||
node_name = each.value.host_node
|
node_name = each.value.host_node
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ variable "cluster" {
|
|||||||
vip = optional(string)
|
vip = optional(string)
|
||||||
gateway = string
|
gateway = string
|
||||||
subnet_mask = optional(string, "24")
|
subnet_mask = optional(string, "24")
|
||||||
talos_machine_config_version = string
|
talos_machine_config_version = optional(string)
|
||||||
proxmox_cluster = string
|
proxmox_cluster = string
|
||||||
kubernetes_version = string
|
kubernetes_version = string
|
||||||
base_domain = string
|
base_domain = string
|
||||||
|
|||||||
Reference in New Issue
Block a user