From 9bd3cb79c6ccf59c8d99c56beb3e72c4d24ba5c4 Mon Sep 17 00:00:00 2001 From: Sebastian Plattner Date: Thu, 15 Aug 2024 14:21:17 +0200 Subject: [PATCH] align git with current state --- .gitignore | 1 + README.md | 2 - main.tf | 178 ++++++++++++++++++++++++++--------------------------- 3 files changed, 89 insertions(+), 92 deletions(-) diff --git a/.gitignore b/.gitignore index e15824d..2f06349 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ terraform.tfstate terraform.tfstate.backup .terraform.lock.hcl backend.sh +.env diff --git a/README.md b/README.md index 0024401..e7e10e2 100644 --- a/README.md +++ b/README.md @@ -36,8 +36,6 @@ TODOs and Work in Progress: TODOs and Work in Progress: -- Cleanup up of everyhting does not yet fully work. -- You might need to remove the ingress controller Loadbalancer manually in the hetzner console. The reason for this, during destroy the Cloud Controller Manager (which provision the loadbalancer) is removed before the removal of the ingress controller. - You might need to remove DNS Records for the training cluster, because Crossplane might be removed before removal of the ingress controller, which prevents removal of the DNS records. ## Concept Training Cluster Setup diff --git a/main.tf b/main.tf index aeba09a..ddf5cb8 100644 --- a/main.tf +++ b/main.tf @@ -44,93 +44,91 @@ provider "kubernetes" { ### Start Training Cluster flavor k8s ############################### -# -# module "training-cluster" { -# -# providers = { -# restapi.hosttech_dns = restapi.hosttech_dns -# hcloud = hcloud -# kubernetes.acend = kubernetes.acend -# } -# -# source = "git::https://github.com/acend/terraform-k8s-cluster-lab.git//modules/training-cluster" -# -# cluster_name = "training" -# cluster_domain = "cluster.acend.ch" -# worker_count = "3" // A minimum of 3 nodes is required -# -# hcloud_api_token = var.hcloud_api_token -# hosttech_dns_token = var.hosttech_dns_token -# hosttech-dns-zone-id = var.hosttech_dns_zone_id -# -# -# # SSH Public keys deployed on the VM's for SSH access -# extra_ssh_keys = local.ssh_keys -# -# cluster_admin = ["user1", "user2", "user3"] -# -# # Webshell -# # Make sure to scale down to 0 before removing the cluster, -# # otherwise there will be terraform errors due to missing provider config -# count-students = 5 -# -# # User VMs -# user-vms-enabled = false -# -# # RBAC in Webshell -# webshell-rbac-enabled = true -# -# webshell-settings = { -# version = "0.5.6" -# -# theia-persistence-enabled = true -# dind-persistence-enabled = true -# webshell-rbac-enabled = true -# -# dind_resources = { -# limits = { -# cpu = "2" -# memory = "1Gi" -# } -# -# requests = { -# cpu = "50m" -# memory = "100Mi" -# } -# } -# theia_resources = { -# requests = { -# cpu = "500m" -# memory = "1Gi" -# } -# } -# } -# } -# -# output "training-kubeconfig" { -# value = module.training-cluster.kubeconfig_raw -# sensitive = true -# } -# -# output "argocd-admin-password" { -# value = module.training-cluster.argocd-admin-password -# sensitive = true -# } -# -# output "student-passwords" { -# value = module.training-cluster.student-passwords -# sensitive = true -# } -# -# output "count-students" { -# value = module.training-cluster.count-students -# } -# -# output "studentname-prefix" { -# value = module.training-cluster.studentname-prefix -# } -# -# -# # ### End Training Cluster flavor k8s -# # -# \ No newline at end of file + +module "training-cluster" { + + providers = { + restapi.hosttech_dns = restapi.hosttech_dns + hcloud = hcloud + kubernetes.acend = kubernetes.acend + } + + source = "git::https://github.com/acend/terraform-k8s-cluster-lab.git//modules/training-cluster" + + cluster_name = "training" + cluster_domain = "cluster.acend.ch" + worker_count = "3" // A minimum of 3 nodes is required + + hcloud_api_token = var.hcloud_api_token + hosttech_dns_token = var.hosttech_dns_token + hosttech-dns-zone-id = var.hosttech_dns_zone_id + + + # SSH Public keys deployed on the VM's for SSH access + extra_ssh_keys = local.ssh_keys + + cluster_admin = ["user1", "user2", "user3"] + + # Webshell + # Make sure to scale down to 0 before removing the cluster, + # otherwise there will be terraform errors due to missing provider config + count-students = 5 + + # User VMs + user-vms-enabled = false + + # RBAC in Webshell + webshell-rbac-enabled = true + + webshell-settings = { + version = "0.5.12" + + theia-persistence-enabled = true + dind-persistence-enabled = true + webshell-rbac-enabled = true + + dind_resources = { + limits = { + cpu = "2" + memory = "1Gi" + } + + requests = { + cpu = "50m" + memory = "100Mi" + } + } + theia_resources = { + requests = { + cpu = "500m" + memory = "1Gi" + } + } + } +} + +output "training-kubeconfig" { + value = module.training-cluster.kubeconfig_raw + sensitive = true +} + +output "argocd-admin-password" { + value = module.training-cluster.argocd-admin-password + sensitive = true +} + +output "student-passwords" { + value = module.training-cluster.student-passwords + sensitive = true +} + +output "count-students" { + value = module.training-cluster.count-students +} + +output "studentname-prefix" { + value = module.training-cluster.studentname-prefix +} + + +### End Training Cluster flavor k8s