mirror of
https://github.com/batonogov/learn-devops.git
synced 2025-11-29 00:33:02 +00:00
Add kubeadm example (#4)
* Add kubeadm example * Fix dns --------- Co-authored-by: Fedor Batonogov <f.batonogov@yandex.ru>
This commit is contained in:
committed by
GitHub
parent
346360f820
commit
07fb0c68bf
70
opentofu/kubeadm/control-plane-02.tf
Normal file
70
opentofu/kubeadm/control-plane-02.tf
Normal file
@@ -0,0 +1,70 @@
|
||||
# Машинка
|
||||
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..."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user