From e5265c66303d6c1c3f49d97d58fa8dc448578b97 Mon Sep 17 00:00:00 2001 From: Hugo Tiburtino Date: Mon, 15 Jul 2024 12:59:41 +0200 Subject: [PATCH] feat!: remove mfnf2serlo app --- envs/production/mfnf.tf | 34 ------------- modules/mfnf2serlo/main.tf | 93 ---------------------------------- modules/mfnf2serlo/versions.tf | 9 ---- 3 files changed, 136 deletions(-) delete mode 100644 envs/production/mfnf.tf delete mode 100644 modules/mfnf2serlo/main.tf delete mode 100644 modules/mfnf2serlo/versions.tf diff --git a/envs/production/mfnf.tf b/envs/production/mfnf.tf deleted file mode 100644 index 3d30483..0000000 --- a/envs/production/mfnf.tf +++ /dev/null @@ -1,34 +0,0 @@ -locals { - mfnf2serlo_image_tag = "0.5" -} - -module "mfnf2serlo" { - source = "../../modules/mfnf2serlo" - - namespace = kubernetes_namespace.mfnf_namespace.metadata.0.name - - node_pool = module.cluster.node_pools.non-preemptible - - image_tag = local.mfnf2serlo_image_tag -} - -module "mfnf2serlo_ingress" { - source = "../../modules/ingress" - - name = "mfnf" - namespace = kubernetes_namespace.mfnf_namespace.metadata.0.name - - host = "mfnf.${local.domain}" - backend = { - service_name = module.mfnf2serlo.mfnf2serlo_service_name - service_port = module.mfnf2serlo.mfnf2serlo_service_port - } - enable_tls = true - enable_cors = true -} - -resource "kubernetes_namespace" "mfnf_namespace" { - metadata { - name = "mfnf" - } -} diff --git a/modules/mfnf2serlo/main.tf b/modules/mfnf2serlo/main.tf deleted file mode 100644 index cea94a5..0000000 --- a/modules/mfnf2serlo/main.tf +++ /dev/null @@ -1,93 +0,0 @@ -locals { - name = "mfnf2serlo" -} - -variable "namespace" { - default = "kpi" -} - -variable "node_pool" { - type = string -} - -variable "image_tag" { - type = string - description = "See https://github.com/serlo/mfnf-to-edtr-mapping/tree/main/mfnf2serlo" -} - -output "mfnf2serlo_service_name" { - value = kubernetes_service.mfnf2serlo_service.metadata[0].name -} - -output "mfnf2serlo_service_port" { - value = kubernetes_service.mfnf2serlo_service.spec[0].port[0].port -} - -resource "kubernetes_deployment" "mfnf2serlo" { - metadata { - name = local.name - namespace = var.namespace - - labels = { - app = local.name - } - } - - spec { - replicas = "1" - - selector { - match_labels = { - app = local.name - } - } - - template { - metadata { - labels = { - app = local.name - name = local.name - } - } - - spec { - node_selector = { - "cloud.google.com/gke-nodepool" = var.node_pool - } - - container { - image = "eu.gcr.io/serlo-shared/mfnf2serlo:${var.image_tag}" - name = local.name - - resources { - limits = { - cpu = "950m" - memory = "150M" - } - } - } - } - } - } -} - - -resource "kubernetes_service" "mfnf2serlo_service" { - metadata { - name = "mfnf2serlo-service" - namespace = var.namespace - } - - spec { - selector = { - app = local.name - } - - port { - port = 80 - target_port = 80 - } - - type = "ClusterIP" - } -} diff --git a/modules/mfnf2serlo/versions.tf b/modules/mfnf2serlo/versions.tf deleted file mode 100644 index a932d66..0000000 --- a/modules/mfnf2serlo/versions.tf +++ /dev/null @@ -1,9 +0,0 @@ -terraform { - required_version = ">= 1.0" - required_providers { - kubernetes = { - source = "hashicorp/kubernetes" - version = ">= 2.0" - } - } -}