mirror of
https://github.com/outbackdingo/homelab-v.git
synced 2026-08-25 14:53:19 +00:00
The .tfvars files are normally gitignored, but they serve as an example here. Just need to make sure I don't commit a secret... Inpired by #236
50 lines
1.2 KiB
Terraform
50 lines
1.2 KiB
Terraform
terraform {
|
|
required_providers {
|
|
kubernetes = {
|
|
source = "hashicorp/kubernetes"
|
|
version = "2.35.1"
|
|
}
|
|
proxmox = {
|
|
source = "bpg/proxmox"
|
|
version = "0.70.1"
|
|
}
|
|
talos = {
|
|
source = "siderolabs/talos"
|
|
version = "0.7.1"
|
|
}
|
|
restapi = {
|
|
source = "Mastercard/restapi"
|
|
version = "1.20.0"
|
|
}
|
|
}
|
|
}
|
|
|
|
provider "proxmox" {
|
|
endpoint = var.proxmox.endpoint
|
|
insecure = var.proxmox.insecure
|
|
|
|
api_token = var.proxmox_api_token
|
|
ssh {
|
|
agent = true
|
|
username = var.proxmox.username
|
|
}
|
|
}
|
|
|
|
provider "restapi" {
|
|
uri = var.proxmox.endpoint
|
|
insecure = var.proxmox.insecure
|
|
write_returns_object = true
|
|
|
|
headers = {
|
|
"Content-Type" = "application/json"
|
|
"Authorization" = "PVEAPIToken=${var.proxmox_api_token}"
|
|
}
|
|
}
|
|
|
|
provider "kubernetes" {
|
|
host = module.talos.kube_config.kubernetes_client_configuration.host
|
|
client_certificate = base64decode(module.talos.kube_config.kubernetes_client_configuration.client_certificate)
|
|
client_key = base64decode(module.talos.kube_config.kubernetes_client_configuration.client_key)
|
|
cluster_ca_certificate = base64decode(module.talos.kube_config.kubernetes_client_configuration.ca_certificate)
|
|
}
|