maidn-talos-proxmox/terraform/templates/talconfig.yaml.tpl

223 lines
5.7 KiB
Smarty

clusterName: ${cluster_name}
endpoint: ${cluster_endpoint}
domain: ${cluster_domain}
talosVersion: ${talos_version}
allowSchedulingOnMasters: false
# Network configuration
clusterPodNets:
%{ for net in cluster_pod_nets ~}
- ${net}
%{ endfor ~}
clusterSvcNets:
%{ for net in cluster_svc_nets ~}
- ${net}
%{ endfor ~}
# Node definitions
nodes:
%{ for node in control_plane_nodes ~}
# Control Plane: ${node.name}
- hostname: ${node.name}
ipAddress: ${node.networks[0].ip}
controlPlane: true
installDisk: /dev/sda
machineSpec:
mode: metal
arch: amd64
talosImageURL: "factory.talos.dev/installer/${talos_factory_schematic_id}"
patches:
- |-
apiVersion: v1alpha1
kind: LinkConfig
name: eth0
up: true
nodeLabels:
node-role.kubernetes.io/control-plane: ""
cluster.local/node-pool: "control-plane"
cluster.local/proxmox-node: "${lookup(node, "proxmox_node", "unknown")}"
%{ for tag in lookup(node, "tags", []) ~}
cluster.local/tag-${tag}: "true"
%{ endfor ~}
networkInterfaces:
%{ for i, net in node.networks ~}
- interface: eth${i}
%{ if i == 0 ~}
addresses:
- "${net.ip}/${split("/", net.cidr)[1]}"
routes:
- network: 0.0.0.0/0
gateway: ${net.gateway}
vip:
ip: ${control_plane_vip}
%{ else ~}
dhcp: true
%{ endif ~}
%{ endfor ~}
%{ endfor ~}
%{ for node in compute_workers ~}
# Compute Worker: ${node.name}
- hostname: ${node.name}
ipAddress: ${node.networks[0].ip}
controlPlane: false
installDisk: /dev/sda
machineSpec:
mode: metal
arch: amd64
talosImageURL: "factory.talos.dev/installer/${talos_factory_schematic_id}"
patches:
- |-
apiVersion: v1alpha1
kind: LinkConfig
name: eth0
up: true
nodeLabels:
node-role.kubernetes.io/worker: ""
cluster.local/node-pool: "compute"
cluster.local/workload-type: "cpu-intensive"
cluster.local/proxmox-node: "${lookup(node, "proxmox_node", "unknown")}"
%{ for tag in lookup(node, "tags", []) ~}
cluster.local/tag-${tag}: "true"
%{ endfor ~}
networkInterfaces:
%{ for i, net in node.networks ~}
- interface: eth${i}
%{ if i == 0 ~}
addresses:
- "${net.ip}/${split("/", net.cidr)[1]}"
routes:
- network: 0.0.0.0/0
gateway: ${net.gateway}
%{ else ~}
dhcp: true
%{ endif ~}
%{ endfor ~}
%{ endfor ~}
%{ for node in storage_workers ~}
# Storage Worker: ${node.name}
- hostname: ${node.name}
ipAddress: ${node.networks[0].ip}
controlPlane: false
installDisk: /dev/sda
machineSpec:
mode: metal
arch: amd64
talosImageURL: "factory.talos.dev/installer/${talos_factory_schematic_id}"
patches:
- |-
apiVersion: v1alpha1
kind: LinkConfig
name: eth0
up: true
nodeLabels:
node-role.kubernetes.io/worker: ""
cluster.local/node-pool: "storage"
cluster.local/workload-type: "storage-intensive"
cluster.local/proxmox-node: "${lookup(node, "proxmox_node", "unknown")}"
%{ for tag in lookup(node, "tags", []) ~}
cluster.local/tag-${tag}: "true"
%{ endfor ~}
networkInterfaces:
%{ for i, net in node.networks ~}
- interface: eth${i}
%{ if i == 0 ~}
addresses:
- "${net.ip}/${split("/", net.cidr)[1]}"
routes:
- network: 0.0.0.0/0
gateway: ${net.gateway}
%{ else ~}
dhcp: true
%{ endif ~}
%{ endfor ~}
%{ endfor ~}
%{ for node in gpu_workers ~}
# GPU Worker: ${node.name}
- hostname: ${node.name}
ipAddress: ${node.networks[0].ip}
controlPlane: false
installDisk: /dev/sda
machineSpec:
mode: metal
arch: amd64
talosImageURL: "factory.talos.dev/installer/${talos_factory_schematic_id}"
patches:
- |-
apiVersion: v1alpha1
kind: LinkConfig
name: eth0
up: true
nodeLabels:
node-role.kubernetes.io/worker: ""
cluster.local/node-pool: "gpu"
cluster.local/workload-type: "gpu-intensive"
cluster.local/proxmox-node: "${lookup(node, "proxmox_node", "unknown")}"
%{ for tag in lookup(node, "tags", []) ~}
cluster.local/tag-${tag}: "true"
%{ endfor ~}
networkInterfaces:
%{ for i, net in node.networks ~}
- interface: eth${i}
%{ if i == 0 ~}
addresses:
- "${net.ip}/${split("/", net.cidr)[1]}"
routes:
- network: 0.0.0.0/0
gateway: ${net.gateway}
%{ else ~}
dhcp: true
%{ endif ~}
%{ endfor ~}
%{ endfor ~}
# Global patches applied to ALL nodes
patches:
- |-
machine:
network:
nameservers:
%{ for dns in dns_servers ~}
- "${dns}"
%{ endfor ~}
%{ if image_cache_proxy.enabled }
# Registry Proxy Configuration
- |-
machine:
registries:
mirrors:
docker.io:
endpoints:
- http://${image_cache_proxy.ip}:${image_cache_proxy.port}
quay.io:
endpoints:
- http://${image_cache_proxy.ip}:${image_cache_proxy.port}
gcr.io:
endpoints:
- http://${image_cache_proxy.ip}:${image_cache_proxy.port}
ghcr.io:
endpoints:
- http://${image_cache_proxy.ip}:${image_cache_proxy.port}
k8s.gcr.io:
endpoints:
- http://${image_cache_proxy.ip}:${image_cache_proxy.port}
registry.k8s.io:
endpoints:
- http://${image_cache_proxy.ip}:${image_cache_proxy.port}
%{ endif }
# Control plane specific configuration
controlPlane:
patches:
- |-
cluster:
etcd:
advertisedSubnets:
- ${network_cidr}
proxy: {}
discovery:
enabled: true