feat(terraform): add core-mon LXC container definition on netcore

This commit is contained in:
karpenok committed 2026-11-11 15:56:07 +07:00
1 parent 38fc67048a
commit 9e9b8e9caf
4 files changed
+64 -1

No files matched your search

+2
View File
@@ -8,6 +8,7 @@
|---|---|---|---|
| `core-net` | `playbooks/core-net.yml` | `roles/core-net/traefik`, `roles/core-net/authentik` | `/opt/traefik`, `/opt/authentik` |
| `core-secrets` | `playbooks/core-secrets.yml` | `roles/core-secrets/infisical`, `roles/core-secrets/vaultwarden` | `/opt/infisical`, `/opt/vaultwarden` |
| `core-mon` | `playbooks/core-mon.yml` | `roles/core-mon/monitoring` | `/opt/monitoring` |
| `rus-central` | `playbooks/rus-central.yml` | `roles/rus-central/netbird` | `/opt/netbird` |
| `opnsense` | `playbooks/opnsense.yml` | `roles/opnsense/netbird` | REST API (`192.168.1.1`) |
@@ -32,6 +33,7 @@ Terraform в этом репозитории описывает только у
| **CT 109** | `pve` | `192.168.1.217` | `gitea` | Gitea (`:3000`), Postgres (`:5432`), Gitea Actions Runner (`dind`) |
| **CT 901** | `netcore` | `192.168.1.102` | `core-secrets` | Infisical (`:8080`), Postgres, Redis, Vaultwarden (`:8000`) |
| **CT 902** | `netcore` | `192.168.1.104` | `core-net` | Traefik (`:80`, `:443`), Authentik (`127.0.0.1:9000`) |
| **CT 903** | `netcore` | `192.168.1.108` | `core-mon` | Prometheus (`:9090`), Alertmanager (`:9093`), Grafana (`:3000`), Ntfy (`:80`) |
### 1.3. Внешние узлы
| Имя | IP | Роль | Стек |
+51
View File
@@ -0,0 +1,51 @@
resource "proxmox_virtual_environment_container" "core_mon" {
description = "Managed by Terraform: core-mon (Prometheus, Alertmanager, Grafana, Ntfy)"
node_name = var.proxmox_node
vm_id = 903
unprivileged = true
started = true
initialization {
hostname = "core-mon"
ip_config {
ipv4 {
address = "192.168.1.108/24"
gateway = "192.168.1.1"
}
}
user_account {
keys = var.ssh_public_keys
}
}
network_interface {
name = "eth0"
bridge = "vmbr10"
}
operating_system {
template_file_id = "local:vztmpl/debian-13-standard_13.6-1_amd64.tar.zst"
type = "debian"
}
cpu {
cores = 2
}
memory {
dedicated = 4096
swap = 2048
}
disk {
datastore_id = "local-lvm"
size = 30
}
features {
nesting = true
}
}
+1 -1
View File
@@ -14,7 +14,7 @@ terraform {
}
provider "proxmox" {
endpoint = var.proxmox_endpoint
endpoint = var.proxmox_endpoint
api_token = var.proxmox_api_token
insecure = var.proxmox_insecure
+10
View File
@@ -17,3 +17,13 @@ output "core_secrets_ip" {
description = "IPv4 адрес контейнера core-secrets"
value = proxmox_virtual_environment_container.core_secrets.initialization[0].ip_config[0].ipv4[0].address
}
output "core_mon_id" {
description = "VMID контейнера core-mon"
value = proxmox_virtual_environment_container.core_mon.vm_id
}
output "core_mon_ip" {
description = "IPv4 адрес контейнера core-mon"
value = proxmox_virtual_environment_container.core_mon.initialization[0].ip_config[0].ipv4[0].address
}