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

Tweak node pool usage #984

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,7 @@ module "forwardauth" {
namespace = var.environment
external-url = var.endpoint

node-group = local.node_groups.general
jh-client-id = local.forwardauth-keycloak-client-id
jh-client-secret = random_password.forwardauth-jhsecret.result
callback-url-path = local.forwardauth-callback-url-path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,21 @@ resource "kubernetes_deployment" "forwardauth-deployment" {
}

spec {

affinity {
node_affinity {
required_during_scheduling_ignored_during_execution {
node_selector_term {
match_expressions {
key = var.node-group.key
operator = "In"
values = [
var.node-group.value
]
}
}
}
}
}
container {
# image = "thomseddon/traefik-forward-auth:2.2.0"
# Use PR #159 https://github.com/thomseddon/traefik-forward-auth/pull/159
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,12 @@ variable "jh-client-secret" {
variable "callback-url-path" {
description = "Path of Callback URL"
type = string
}
}

variable "node-group" {
description = "Node key value pair for bound general resources"
type = object({
key = string
value = string
})
}
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ redis: # configuration from https://github.com/bitnami/charts/blob/master/bitnam
master:
name: "{{ .Release.Name }}-redis-master"
port: 6379
nodeSelector:
Copy link
Member

Choose a reason for hiding this comment

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

How is the node being labeled "app: clearml"?

Copy link
Member

Choose a reason for hiding this comment

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

Or this an assumption that the node will have this label?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How is the node being labeled "app: clearml"

good point. It's a default value set in the variable.tf file that propagest to the chart's values.yaml (see here)).

Or this an assumption that the node will have this label?

It is a requirement. We manually set this label for our deployment. We are not sure if this is automated when QHub deploys clearml when using the cloud providers (as described here).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that drew our attention to missing redis/mongdb dynamic value setting. fixed now.

app: "clearml"
persistence:
enabled: true
accessModes:
Expand All @@ -240,6 +242,8 @@ mongodb: # configuration from https://github.com/bitnami/charts/blob/master/bitn
registry: docker.io
repository: bitnami/mongodb
tag: 3.6.21-debian-9-r71
nodeSelector:
app: "clearml"
architecture: standalone
auth:
enabled: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,20 @@ resource "helm_release" "clearml" {
}
}

dynamic "set" {
for_each = var.node_selector
content {
name = "mongodb.nodeSelector.${set.key}"
value = set.value
}
}

dynamic "set" {
for_each = var.node_selector
content {
name = "redis.master.nodeSelector.${set.key}"
value = set.value
}
}

}