Skip to content
Merged
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
29 changes: 0 additions & 29 deletions templates/kubernetes/homelab-workspace/deployment.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ resource "kubernetes_deployment_v1" "deployment" {
name = "prepare-workspace"
command = ["/bin/bash", "/prepare-workspace-script.sh"]
image = var.workspace_image
env {
name = "SYSTEM_PACKAGES"
value = length(local.validated_system_packages) > 0 ? join(" ", local.validated_system_packages) : "NONE"
}
env {
name = "HOMEBREW_PREFIX"
value = local.homebrew_directory
Expand All @@ -70,10 +66,6 @@ resource "kubernetes_deployment_v1" "deployment" {
name = "coder-scripts"
sub_path = "prepare_workspace_script"
}
volume_mount {
name = "system"
mount_path = "/updated"
}
security_context {
run_as_user = 0
}
Expand Down Expand Up @@ -156,21 +148,6 @@ resource "kubernetes_deployment_v1" "deployment" {
name = "coder-scripts"
sub_path = "workspace_init_script"
}
volume_mount {
mount_path = "/usr"
name = "system"
sub_path = "usr"
}
volume_mount {
mount_path = "/etc"
name = "system"
sub_path = "etc"
}
volume_mount {
mount_path = "/var"
name = "system"
sub_path = "var"
}
volume_mount {
mount_path = "/tmp"
name = "tmp"
Expand Down Expand Up @@ -215,12 +192,6 @@ resource "kubernetes_deployment_v1" "deployment" {
default_mode = "0750"
}
}
volume {
name = "system"
empty_dir {
size_limit = "10Gi"
}
}
# /tmp is scratch space (agent/tool tempfiles, build caches, downloaded
# archives) and needs to be fast - it cannot be the NFS-backed "home"
# PVC, and it cannot be an empty_dir either, because empty_dir lives on
Expand Down
15 changes: 0 additions & 15 deletions templates/kubernetes/homelab-workspace/parameters.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,6 @@ data "coder_parameter" "preferred_nodes" {
type = "list(string)"
}

data "coder_parameter" "system_packages" {
name = "system_packages"

default = jsonencode(["build-essential"])
display_name = "System Packages"
description = "Additional system packages to install"
icon = "/icon/ubuntu.svg"
mutable = true
type = "list(string)"
}

data "coder_parameter" "memory_watchdog_mode" {
name = "memory_watchdog_mode"

Expand Down Expand Up @@ -77,10 +66,6 @@ locals {
["observe", "enforce", "enforce-all"], data.coder_parameter.memory_watchdog_mode.value
) ? data.coder_parameter.memory_watchdog_mode.value : "observe"

validated_system_packages = (data.coder_parameter.system_packages.value != "") ? [
for str in jsondecode(data.coder_parameter.system_packages.value) :
str if length(regexall("[^a-zA-Z0-9-]", str)) == 0
] : []
validated_preferred_nodes = (data.coder_parameter.preferred_nodes.value != "") ? [
for str in jsondecode(data.coder_parameter.preferred_nodes.value) :
str if length(regexall("[^a-zA-Z0-9-]", str)) == 0
Expand Down
26 changes: 0 additions & 26 deletions templates/kubernetes/homelab-workspace/script-prepare-workspace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,29 +67,6 @@ setup_homebrew() {
echo 'Done'
}

setup_system_packages() {
echo '------------------------------------------------------------'
echo 'Running apt-get update...'
apt-get update 2>&1 | sed -E -n 's|^| |p'
echo 'Running apt-file update...'
apt-file update 2>&1 | sed -E -n 's|^| |p'
echo '------------------------------------------------------------'
echo 'Installing additinal apt packages...'
echo " Packages: $SYSTEM_PACKAGES"
echo
if [[ "$SYSTEM_PACKAGES" != "NONE" ]]; then
DEBIAN_FRONTEND="noninteractive" apt-get install --no-install-recommends -yq $SYSTEM_PACKAGES 2>&1 | sed -E -n 's|^| |p'
fi
echo '------------------------------------------------------------'
echo 'Rsyncing (etc, usr, var) to /updated...'
rsync -aH --stats /etc /usr /var /updated 2>&1 | sed -E -n 's|^| |p'
echo '------------------------------------------------------------'
echo 'Updated system size...'
du -h -d 1 /updated 2>&1 | sed -E -n 's|^| |p'
echo '------------------------------------------------------------'
echo 'Done'
}

prepare_environment() {
echo '------------------------------------------------------------'
grep -v '^PATH=' /etc/environment > /tmp/environment.bak
Expand All @@ -104,9 +81,6 @@ prepare_environment() {
}

main() {
echo "Setting up system packages..."
setup_system_packages | sed -E -n 's|^| |p'
echo
echo "Setting up homebrew..."
setup_homebrew | sed -E -n 's|^| |p'
echo
Expand Down
Loading