Memory and CPU limitations do not apply in NOMAD

main.tf (image: NOMAD set up with 1 core and 1 gb)
3 Replies
Codercord
Codercord2mo ago
<#1288487524863442955>
Category
Help needed
Product
Coder OSS (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
houkai_3rd
houkai_3rdOP2mo ago
workspace.nomad.tpl
job "workspace" {
datacenters = ["dc1"]
namespace = "${workspace_tag}"
type = "service"
group "workspace" {
volume "home_volume" {
type = "csi"
source = "${home_volume_name}"
read_only = false
attachment_mode = "file-system"
access_mode = "single-node-writer"
}
network {
port "http" {}
}
task "workspace" {
driver = "docker"
config {
image = "codercom/enterprise-base:ubuntu"
ports = ["http"]
labels {
name = "${workspace_tag}"
managed_by = "coder"
}
hostname = "${workspace_name}"
entrypoint = ["sh", "-c", "sudo chown coder:coder -R /home/coder && echo '${base64encode(coder_init_script)}' | base64 --decode | sh"]
}
volume_mount {
volume = "home_volume"
destination = "/home/coder"
}
resources {
cores = ${cores}
memory = ${memory_mb}
}
env {
CODER_AGENT_TOKEN = "${coder_agent_token}"
}
meta {
tag = "${workspace_tag}"
managed_by = "coder"
}
}
meta {
tag = "${workspace_tag}"
managed_by = "coder"
}
}
meta {
tag = "${workspace_tag}"
managed_by = "coder"
}
}
job "workspace" {
datacenters = ["dc1"]
namespace = "${workspace_tag}"
type = "service"
group "workspace" {
volume "home_volume" {
type = "csi"
source = "${home_volume_name}"
read_only = false
attachment_mode = "file-system"
access_mode = "single-node-writer"
}
network {
port "http" {}
}
task "workspace" {
driver = "docker"
config {
image = "codercom/enterprise-base:ubuntu"
ports = ["http"]
labels {
name = "${workspace_tag}"
managed_by = "coder"
}
hostname = "${workspace_name}"
entrypoint = ["sh", "-c", "sudo chown coder:coder -R /home/coder && echo '${base64encode(coder_init_script)}' | base64 --decode | sh"]
}
volume_mount {
volume = "home_volume"
destination = "/home/coder"
}
resources {
cores = ${cores}
memory = ${memory_mb}
}
env {
CODER_AGENT_TOKEN = "${coder_agent_token}"
}
meta {
tag = "${workspace_tag}"
managed_by = "coder"
}
}
meta {
tag = "${workspace_tag}"
managed_by = "coder"
}
}
meta {
tag = "${workspace_tag}"
managed_by = "coder"
}
}
2 Is it possible to limit storage? 3 Is there any way to keep nodejs installed after a reboot?
Atif
Atif2mo ago
1. Why do you think that limits are not being applied? The screenshot only shows your system specs of the host PC. Nomad workspaces are just docker containers managed by Nomad but they are running on the same host. 3. Bake it into your image. You can extend this image to create your own.
GitHub
enterprise-images/images/base/ubuntu.Dockerfile at main · coder/ent...
Example Docker images for use with Coder. Contribute to coder/enterprise-images development by creating an account on GitHub.
Want results from more Discord servers?
Add your server