Skip to content

Commit

Permalink
remove cluster after tf destroy
Browse files Browse the repository at this point in the history
  • Loading branch information
splattner committed Jul 16, 2023
1 parent 793b0be commit 731cb23
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 22 deletions.
71 changes: 49 additions & 22 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,36 +19,63 @@ locals {
]
}

provider "restapi" {
alias = "hosttech_dns"
uri = "https://api.ns1.hosttech.eu"
write_returns_object = true

module "training-cluster" {
headers = {
Authorization = "Bearer ${var.hosttech_dns_token}"
ContentType = "application/json"
}
}

source = "git::https://github.com/acend/terraform-k8s-cluster-lab.git//modules/training-cluster"
provider "hcloud" {
token = var.hcloud_api_token
}

cluster_name = "test"
cluster_domain = "cluster.acend.ch"
worker_count = "2"
provider "kubernetes" {
alias = "acend"
host = "https://k8s-prod.acend.ch:6443"
insecure = true
}

hcloud_api_token = var.hcloud_api_token
hosttech_dns_token = var.hosttech_dns_token
hosttech-dns-zone-id = var.hosttech_dns_zone_id

# module "training-cluster" {

# SSH Public keys deployed on the VM's for SSH access
extra_ssh_keys = local.ssh_keys
# providers = {
# restapi.hosttech_dns = restapi.hosttech_dns
# hcloud = hcloud
# kubernetes.acend = kubernetes.acend
# }

cluster_admin = ["user1", "user2", "user3", "user4", "user5"]
# source = "git::https://github.com/acend/terraform-k8s-cluster-lab.git//modules/training-cluster"

# Webshell
count-students = 1
# cluster_name = "test"
# cluster_domain = "cluster.acend.ch"
# worker_count = "2"

# User VMs
user-vms-enabled = false
# hcloud_api_token = var.hcloud_api_token
# hosttech_dns_token = var.hosttech_dns_token
# hosttech-dns-zone-id = var.hosttech_dns_zone_id

# RBAC in Webshell
webshell-rbac-enabled = true
}

output "test-kubeconfig" {
value = module.training-cluster.kubeconfig_raw
sensitive = true
}
# # SSH Public keys deployed on the VM's for SSH access
# extra_ssh_keys = local.ssh_keys

# cluster_admin = ["user1"]

# # Webshell
# count-students = 0

# # User VMs
# user-vms-enabled = false

# # RBAC in Webshell
# webshell-rbac-enabled = true
# }

# output "test-kubeconfig" {
# value = module.training-cluster.kubeconfig_raw
# sensitive = true
# }
10 changes: 10 additions & 0 deletions versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
terraform {
required_providers {
restapi = {
source = "Mastercard/restapi"
}
hcloud = {
source = "hetznercloud/hcloud"
}
}
}

0 comments on commit 731cb23

Please sign in to comment.