mirror of
https://github.com/batonogov/learn-devops.git
synced 2025-11-29 08:43:01 +00:00
* Add kubeadm example * Fix dns --------- Co-authored-by: Fedor Batonogov <f.batonogov@yandex.ru>
71 lines
1.2 KiB
HCL
71 lines
1.2 KiB
HCL
# Машинка
|
||
resource "proxmox_virtual_environment_vm" "kubeadm-cp-02" {
|
||
name = "kubeadm-cp-02"
|
||
migrate = true
|
||
description = "Managed by OpenTofu"
|
||
tags = ["kubeadm", "test"]
|
||
on_boot = true
|
||
|
||
# Указываем целевой узел, на котором будет запущена ВМ
|
||
node_name = "pve-02"
|
||
|
||
# Шоблон из которого будет создавать ВМ
|
||
clone {
|
||
vm_id = "2204"
|
||
node_name = "pve-01"
|
||
retries = 2
|
||
}
|
||
|
||
# Активируем QEMU для этов ВМ
|
||
agent {
|
||
enabled = true
|
||
}
|
||
|
||
operating_system {
|
||
type = "l26"
|
||
}
|
||
|
||
cpu {
|
||
cores = 4
|
||
type = "host"
|
||
numa = true
|
||
}
|
||
|
||
memory {
|
||
dedicated = 4096
|
||
}
|
||
|
||
disk {
|
||
size = "50"
|
||
interface = "virtio0"
|
||
datastore_id = "k8s-data-01"
|
||
file_format = "raw"
|
||
}
|
||
|
||
network_device {
|
||
bridge = "vmbr0"
|
||
model = "virtio"
|
||
}
|
||
|
||
initialization {
|
||
datastore_id = "k8s-data-01"
|
||
ip_config {
|
||
ipv4 {
|
||
address = "10.0.70.78/24"
|
||
gateway = "10.0.70.101"
|
||
}
|
||
}
|
||
dns {
|
||
servers = [
|
||
"77.88.8.8"
|
||
]
|
||
}
|
||
user_account {
|
||
username = "infra"
|
||
keys = [
|
||
"ssh-rsa..."
|
||
]
|
||
}
|
||
}
|
||
}
|