feat: initial homelab-gitops declarative structure (Terraform & ArgoCD)
This commit is contained in:
37
terraform/harvester/networks.tf
Normal file
37
terraform/harvester/networks.tf
Normal file
@@ -0,0 +1,37 @@
|
||||
# Declarative Harvester VLAN Networks
|
||||
resource "harvester_network" "vlan20_infra" {
|
||||
name = "vlan20-infra"
|
||||
namespace = "default"
|
||||
vlan_id = 20
|
||||
route {
|
||||
mode = "auto"
|
||||
gateway = "140.44.4.1"
|
||||
}
|
||||
}
|
||||
|
||||
resource "harvester_network" "vlan40_storage" {
|
||||
name = "vlan40-storage"
|
||||
namespace = "default"
|
||||
vlan_id = 40
|
||||
route {
|
||||
mode = "auto"
|
||||
gateway = "14.10.10.1"
|
||||
}
|
||||
}
|
||||
|
||||
resource "harvester_network" "vlan50_smarthome" {
|
||||
name = "vlan50-smarthome"
|
||||
namespace = "default"
|
||||
vlan_id = 50
|
||||
route {
|
||||
mode = "auto"
|
||||
gateway = "14.4.4.1"
|
||||
}
|
||||
}
|
||||
|
||||
# SSH Key Pair for Virtual Machines
|
||||
resource "harvester_ssh_key" "snarfnet_master" {
|
||||
name = "snarfnet-master-key"
|
||||
namespace = "default"
|
||||
public_key = var.master_ssh_public_key
|
||||
}
|
||||
8
terraform/harvester/outputs.tf
Normal file
8
terraform/harvester/outputs.tf
Normal file
@@ -0,0 +1,8 @@
|
||||
output "harvester_vlan_networks" {
|
||||
description = "Configured Harvester VLAN networks"
|
||||
value = [
|
||||
harvester_network.vlan20_infra.name,
|
||||
harvester_network.vlan40_storage.name,
|
||||
harvester_network.vlan50_smarthome.name,
|
||||
]
|
||||
}
|
||||
20
terraform/harvester/providers.tf
Normal file
20
terraform/harvester/providers.tf
Normal file
@@ -0,0 +1,20 @@
|
||||
terraform {
|
||||
required_version = ">= 1.5.0"
|
||||
required_providers {
|
||||
harvester = {
|
||||
source = "harvester/harvester"
|
||||
version = "~> 0.6"
|
||||
}
|
||||
}
|
||||
|
||||
backend "http" {
|
||||
address = "https://git.snarfnet.net/api/packages/snarf/terraform/state/harvester"
|
||||
lock_address = "https://git.snarfnet.net/api/packages/snarf/terraform/state/harvester/lock"
|
||||
unlock_address = "https://git.snarfnet.net/api/packages/snarf/terraform/state/harvester/lock"
|
||||
username = "snarf"
|
||||
}
|
||||
}
|
||||
|
||||
provider "harvester" {
|
||||
kubeconfig = var.harvester_kubeconfig
|
||||
}
|
||||
11
terraform/harvester/variables.tf
Normal file
11
terraform/harvester/variables.tf
Normal file
@@ -0,0 +1,11 @@
|
||||
variable "harvester_kubeconfig" {
|
||||
type = string
|
||||
description = "Path to Harvester cluster kubeconfig file"
|
||||
default = "~/.kube/harvester.yaml"
|
||||
}
|
||||
|
||||
variable "master_ssh_public_key" {
|
||||
type = string
|
||||
description = "Snarfnet Master SSH Public Key"
|
||||
default = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPqgXJd84m12yNq1gqjAOm6n8sK1l9K3eK0Y7Y+V8V7/ snarfnet-master"
|
||||
}
|
||||
11
terraform/harvester/vms.tf
Normal file
11
terraform/harvester/vms.tf
Normal file
@@ -0,0 +1,11 @@
|
||||
# Harvester Virtual Machine Templates / Definitions
|
||||
# Note: Baremetal Harvester HCI nodes remain outside destructive automation scope.
|
||||
# VM resources defined declaratively for state tracking.
|
||||
|
||||
resource "harvester_image" "ubuntu_focal" {
|
||||
name = "ubuntu-20.04-server-cloudimg-arm64"
|
||||
namespace = "default"
|
||||
display_name = "Ubuntu 20.04 ARM64 Cloud Image"
|
||||
source_type = "download"
|
||||
url = "https://cloud-images.ubuntu.com/releases/focal/release/ubuntu-20.04-server-cloudimg-arm64.img"
|
||||
}
|
||||
Reference in New Issue
Block a user