infrastructure/k8s.tjo.cloud/providers.tf

92 lines
2 KiB
Terraform
Raw Normal View History

2024-07-08 20:27:08 +00:00
terraform {
required_providers {
proxmox = {
source = "bpg/proxmox"
version = "0.61.1"
2024-07-08 20:27:08 +00:00
}
talos = {
source = "siderolabs/talos"
version = "0.5.0"
}
local = {
source = "hashicorp/local"
version = "1.4.0"
}
digitalocean = {
source = "digitalocean/digitalocean"
version = "~> 2.0"
}
random = {
source = "hashicorp/random"
version = "3.6.2"
}
helm = {
source = "hashicorp/helm"
version = "2.14.0"
}
2024-07-10 21:13:36 +00:00
kubernetes = {
source = "hashicorp/kubernetes"
version = "2.31.0"
}
2024-07-08 20:27:08 +00:00
}
}
provider "proxmox" {
# FIXME: Traefik/NGINX breaks this! 500 ERROR
endpoint = "https://178.63.49.225:8006/api2/json"
insecure = true
api_token = var.proxmox_token
ssh {
agent = true
username = "root"
}
2024-07-08 20:27:08 +00:00
}
provider "digitalocean" {
token = var.digitalocean_token
2024-07-08 20:27:08 +00:00
}
2024-07-13 22:17:47 +00:00
provider "helm" {
alias = "template"
}
2024-07-08 20:27:08 +00:00
provider "helm" {
kubernetes {
2024-07-14 10:19:37 +00:00
host = module.cluster.api.endpoint
cluster_ca_certificate = base64decode(module.cluster.api.ca)
2024-07-13 22:17:47 +00:00
exec {
api_version = "client.authentication.k8s.io/v1beta1"
command = "kubectl"
args = [
"oidc-login",
"get-token",
"--oidc-issuer-url", var.oidc_issuer_url,
"--oidc-client-id", var.oidc_client_id,
"--oidc-extra-scope", "profile",
"--grant-type", "password",
"--username", var.oidc_username,
"--password", var.oidc_password,
]
}
}
}
provider "kubernetes" {
2024-07-14 10:19:37 +00:00
host = module.cluster.api.endpoint
cluster_ca_certificate = base64decode(module.cluster.api.ca)
2024-07-13 22:17:47 +00:00
exec {
api_version = "client.authentication.k8s.io/v1beta1"
command = "kubectl"
args = [
"oidc-login",
"get-token",
"--oidc-issuer-url", var.oidc_issuer_url,
"--oidc-client-id", var.oidc_client_id,
"--oidc-extra-scope", "profile",
"--grant-type", "password",
"--username", var.oidc_username,
"--password", var.oidc_password,
]
2024-07-08 20:27:08 +00:00
}
}