wip
This commit is contained in:
parent
5def74736b
commit
26be097fda
13 changed files with 356 additions and 184 deletions
|
|
@ -0,0 +1,30 @@
|
|||
debug: false
|
||||
machine:
|
||||
install:
|
||||
disk: ${install_disk}
|
||||
network:
|
||||
hostname: ${hostname}
|
||||
nameservers:
|
||||
- 10.13.37.2
|
||||
interfaces:
|
||||
- interface: eth0
|
||||
dhcp: false
|
||||
kubelet:
|
||||
extraArgs:
|
||||
pod-max-pids: 1000
|
||||
extraConfig:
|
||||
imageGCHighThresholdPercent: 75
|
||||
imageGCLowThresholdPercent: 70
|
||||
cluster:
|
||||
apiServer:
|
||||
auditPolicy:
|
||||
apiVersion: audit.k8s.io/v1
|
||||
kind: Policy
|
||||
rules:
|
||||
# Log only metadata in audit logs
|
||||
- level: Metadata
|
||||
network:
|
||||
cni:
|
||||
name: none
|
||||
proxy:
|
||||
disabled: true
|
||||
|
|
@ -1,44 +1,63 @@
|
|||
terraform {
|
||||
required_providers {
|
||||
proxmox = {
|
||||
source = "telmate/proxmox"
|
||||
version = ">= 3.0.2-rc05"
|
||||
source = "bpg/proxmox"
|
||||
version = "0.85.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
resource "proxmox_vm_qemu" "controlplane" {
|
||||
for_each = { for node in var.controlplanes.nodes : node.name => node }
|
||||
|
||||
name = format("k8s-wheatley-%s", each.value.name)
|
||||
target_node = "pve01"
|
||||
tags = "k8s-wheatley,controlplane"
|
||||
onboot = true
|
||||
bios = "ovmf"
|
||||
boot = "order=virtio0;net0"
|
||||
clone = format("talos-%s", var.controlplanes.talos_version)
|
||||
scsihw = "virtio-scsi-pci"
|
||||
resource "proxmox_virtual_environment_vm" "controlplane" {
|
||||
|
||||
disk {
|
||||
size = var.controlplanes.disk
|
||||
storage = var.controlplanes.storagepool
|
||||
type = "disk"
|
||||
slot = "virtio0"
|
||||
format = "raw"
|
||||
name = format("k8s-wheatley-%s", var.controlplane.node_name)
|
||||
node_name = "pve01"
|
||||
tags = ["k8s-wheatley,controlplane"]
|
||||
bios = "ovmf"
|
||||
on_boot = true
|
||||
machine = "q35"
|
||||
stop_on_destroy = true
|
||||
|
||||
operating_system {
|
||||
type = "l26"
|
||||
}
|
||||
agent {
|
||||
enabled = true
|
||||
}
|
||||
|
||||
cpu {
|
||||
cores = var.controlplanes.cpu
|
||||
cores = var.controlplane.cpu
|
||||
sockets = 1
|
||||
type = "host"
|
||||
}
|
||||
|
||||
memory = var.controlplanes.memory * 1024
|
||||
memory {
|
||||
dedicated = var.controlplane.memory * 1024
|
||||
}
|
||||
|
||||
network {
|
||||
id = 0
|
||||
model = "virtio"
|
||||
disk {
|
||||
datastore_id = var.controlplane.storagepool
|
||||
interface = "virtio0"
|
||||
size = var.controlplane.disk * 1024
|
||||
file_format = "raw"
|
||||
}
|
||||
|
||||
initialization {
|
||||
datastore_id = var.controlplane.storagepool
|
||||
ip_config {
|
||||
ipv4 {
|
||||
address = var.controlplane.node_ipv4_address
|
||||
gateway = var.controlplane.ipv4_gateway
|
||||
}
|
||||
}
|
||||
dns {
|
||||
servers = ["10.13.37.2"]
|
||||
}
|
||||
}
|
||||
|
||||
network_device {
|
||||
bridge = "vmbr1"
|
||||
mac_address = var.controlplane.mac_address
|
||||
}
|
||||
ipconfig0 = format("ip=%s/24,gw=10.13.38.1", each.value.ip_address)
|
||||
skip_ipv6 = true
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,18 @@
|
|||
variable "controlplanes" {
|
||||
variable "controlplane" {
|
||||
description = "Control plane node configuration"
|
||||
type = object({
|
||||
cpu = number
|
||||
memory = number
|
||||
disk = string
|
||||
storagepool = string
|
||||
talos_version = string
|
||||
nodes = list(object({
|
||||
name = string
|
||||
ip_address = string
|
||||
}))
|
||||
cpu = number
|
||||
memory = number
|
||||
disk = string
|
||||
storagepool = string
|
||||
talos_version = string
|
||||
cluster_name = string
|
||||
kubernetes_version = string
|
||||
node_name = string
|
||||
node_ipv4_address = string
|
||||
cluster_endpoint = string
|
||||
ipv4_gateway = string
|
||||
mac_address = string
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue