feat(tofu): better way of supplying apiServer arguments

This commit is contained in:
Vegard Hagen
2025-03-23 19:32:56 +01:00
parent 737e047c8e
commit e747d74097
6 changed files with 15 additions and 13 deletions
+1 -1
View File
@@ -36,7 +36,7 @@ data "talos_machine_configuration" "this" {
templatefile("${path.module}/machine-config/control-plane.yaml.tftpl", { templatefile("${path.module}/machine-config/control-plane.yaml.tftpl", {
cilium_values = file("${path.root}/${var.cilium.values_path}") cilium_values = file("${path.root}/${var.cilium.values_path}")
cilium_install = file("${path.root}/${var.cilium.install_manifest_path}") cilium_install = file("${path.root}/${var.cilium.install_manifest_path}")
base_domain = var.cluster.base_domain api_server = var.cluster.api_server
}) : "" }) : ""
] ]
} }
@@ -7,13 +7,7 @@ machine:
cluster: cluster:
allowSchedulingOnControlPlanes: true allowSchedulingOnControlPlanes: true
apiServer: apiServer:
extraArgs: ${indent(4, api_server)}
oidc-issuer-url: https://authelia.${base_domain}
oidc-client-id: kubectl
oidc-username-claim: preferred_username
oidc-username-prefix: 'authelia:'
oidc-groups-claim: groups
oidc-groups-prefix: 'authelia:'
network: network:
cni: cni:
name: none name: none
+1 -1
View File
@@ -23,7 +23,7 @@ variable "cluster" {
talos_machine_config_version = optional(string) talos_machine_config_version = optional(string)
proxmox_cluster = string proxmox_cluster = string
kubernetes_version = string kubernetes_version = string
base_domain = string api_server = optional(string)
}) })
} }
+9 -1
View File
@@ -13,7 +13,15 @@ talos_cluster_config = {
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" api_server = <<-EOT
extraArgs:
oidc-issuer-url: "https://authelia.stonegarden.dev"
oidc-client-id: "kubectl"
oidc-username-claim: "preferred_username"
oidc-username-prefix: "authelia:"
oidc-groups-claim: "groups"
oidc-groups-prefix: "authelia:"
EOT
} }
cilium_config = { cilium_config = {
+1 -1
View File
@@ -39,7 +39,7 @@ variable "talos_cluster_config" {
talos_machine_config_version = optional(string) talos_machine_config_version = optional(string)
proxmox_cluster = string proxmox_cluster = string
kubernetes_version = string kubernetes_version = string
base_domain = string api_server = optional(string)
}) })
} }