add vultr k8s
This commit is contained in:
parent
8d049f3056
commit
f68c6b227a
20
terraform/vultr/k8s.tf
Normal file
20
terraform/vultr/k8s.tf
Normal file
@ -0,0 +1,20 @@
|
||||
resource "vultr_kubernetes" "k8s" {
|
||||
region = "ewr"
|
||||
version = "v1.29.2+1"
|
||||
label = "cluster00"
|
||||
ha_controlplanes = false
|
||||
enable_firewall = false
|
||||
|
||||
node_pools {
|
||||
node_quantity = 1
|
||||
plan = "vc2-2c-2gb"
|
||||
label = "cluster00-worker-2c-2g"
|
||||
auto_scaler = false
|
||||
}
|
||||
}
|
||||
|
||||
resource "local_sensitive_file" "kubeconfig" {
|
||||
content_base64 = vultr_kubernetes.k8s.kube_config
|
||||
filename = "~/.kube/vultr"
|
||||
file_permission = "0600"
|
||||
}
|
31
terraform/vultr/main.tf
Normal file
31
terraform/vultr/main.tf
Normal file
@ -0,0 +1,31 @@
|
||||
terraform {
|
||||
required_version = ">= 1.8.0"
|
||||
required_providers {
|
||||
vault = {
|
||||
source = "hashicorp/vault"
|
||||
version = ">= 4.2.0"
|
||||
}
|
||||
vultr = {
|
||||
source = "vultr/vultr"
|
||||
version = ">= 2.19.0"
|
||||
}
|
||||
}
|
||||
backend "local" {
|
||||
path = "/home/michael/Nextcloud/Backups/tfstate/vultr.tfstate"
|
||||
}
|
||||
}
|
||||
|
||||
provider "vault" {
|
||||
# Export the vault token to the environment variable VAULT_TOKEN
|
||||
address = "https://vault.balsillie.house"
|
||||
}
|
||||
|
||||
data "vault_kv_secret" "vultr" {
|
||||
path = "kv/vultr"
|
||||
}
|
||||
|
||||
provider "vultr" {
|
||||
api_key = data.vault_kv_secret.vultr.data.api_key
|
||||
rate_limit = 100
|
||||
retry_limit = 3
|
||||
}
|
Loading…
Reference in New Issue
Block a user