From 8aa4bbf709b55c82d19d8775cdbfb2d0550c5e7a Mon Sep 17 00:00:00 2001 From: Frederik Ring Date: Mon, 11 Dec 2023 21:15:44 +0100 Subject: [PATCH 1/2] feat(k8s): add namespace for running queryservice jobs --- tf/env/local/namespaces.tf | 19 +++++++++++++++++++ tf/env/production/namespaces.tf | 23 +++++++++++++++++++++++ tf/env/staging/namespaces.tf | 23 +++++++++++++++++++++++ 3 files changed, 65 insertions(+) diff --git a/tf/env/local/namespaces.tf b/tf/env/local/namespaces.tf index ed2f388b5..7b51421ea 100644 --- a/tf/env/local/namespaces.tf +++ b/tf/env/local/namespaces.tf @@ -36,3 +36,22 @@ resource "kubernetes_resource_quota" "adhoc-jobs-podquota" { scopes = ["BestEffort"] } } + +resource "kubernetes_namespace" "qs-job-namespace" { + metadata { + name = "qs-jobs" + } +} + +resource "kubernetes_resource_quota" "api-jobs-podquota" { + metadata { + name = "api-jobs-podquota" + namespace = kubernetes_namespace.api-job-namespace.metadata[0].name + } + spec { + hard = { + pods = 2 + } + scopes = ["BestEffort"] + } +} diff --git a/tf/env/production/namespaces.tf b/tf/env/production/namespaces.tf index f9548be97..605170c26 100644 --- a/tf/env/production/namespaces.tf +++ b/tf/env/production/namespaces.tf @@ -44,3 +44,26 @@ resource "kubernetes_resource_quota" "adhoc-jobs-podquota" { scopes = ["BestEffort"] } } + +resource "kubernetes_namespace" "qs-job-namespace" { + provider = kubernetes.wbaas-3 + + metadata { + name = "qs-jobs" + } +} + +resource "kubernetes_resource_quota" "qs-jobs-podquota" { + provider = kubernetes.wbaas-3 + + metadata { + name = "qs-jobs-podquota" + namespace = kubernetes_namespace.qs-job-namespace.metadata[0].name + } + spec { + hard = { + pods = 4 + } + scopes = ["BestEffort"] + } +} diff --git a/tf/env/staging/namespaces.tf b/tf/env/staging/namespaces.tf index 3ff7b99eb..355faf0b6 100644 --- a/tf/env/staging/namespaces.tf +++ b/tf/env/staging/namespaces.tf @@ -43,3 +43,26 @@ resource "kubernetes_resource_quota" "adhoc-jobs-podquota" { scopes = ["BestEffort"] } } + +resource "kubernetes_namespace" "qs-job-namespace" { + provider = kubernetes.wbaas-2 + + metadata { + name = "qs-jobs" + } +} + +resource "kubernetes_resource_quota" "qs-jobs-podquota" { + provider = kubernetes.wbaas-2 + + metadata { + name = "qs-jobs-podquota" + namespace = kubernetes_namespace.qs-job-namespace.metadata[0].name + } + spec { + hard = { + pods = 2 + } + scopes = ["BestEffort"] + } +} From 62a38f8662e14609a1cd4bfaee1a483678dbf42f Mon Sep 17 00:00:00 2001 From: Frederik Ring Date: Tue, 12 Dec 2023 09:54:06 +0100 Subject: [PATCH 2/2] fix: fix typo --- tf/env/local/namespaces.tf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tf/env/local/namespaces.tf b/tf/env/local/namespaces.tf index 7b51421ea..484b3b41a 100644 --- a/tf/env/local/namespaces.tf +++ b/tf/env/local/namespaces.tf @@ -43,10 +43,10 @@ resource "kubernetes_namespace" "qs-job-namespace" { } } -resource "kubernetes_resource_quota" "api-jobs-podquota" { +resource "kubernetes_resource_quota" "qs-jobs-podquota" { metadata { - name = "api-jobs-podquota" - namespace = kubernetes_namespace.api-job-namespace.metadata[0].name + name = "qs-jobs-podquota" + namespace = kubernetes_namespace.qs-job-namespace.metadata[0].name } spec { hard = {