Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(k8s): add namespace for running queryservice jobs #1310

Merged
merged 2 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions tf/env/local/namespaces.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
m90 marked this conversation as resolved.
Show resolved Hide resolved
metadata {
name = "api-jobs-podquota"
namespace = kubernetes_namespace.api-job-namespace.metadata[0].name
}
spec {
hard = {
pods = 2
}
scopes = ["BestEffort"]
}
}
23 changes: 23 additions & 0 deletions tf/env/production/namespaces.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very (probably too) conservative, but as the setup can create a lot of jobs at once I wanted to keep us from accidentally DOSing ourselves by something we didn't foresee.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, can always go up from here

}
scopes = ["BestEffort"]
}
}
23 changes: 23 additions & 0 deletions tf/env/staging/namespaces.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
}