Skip to content

chore: remove code-server release limitation and add image push policy in kubernetes example template #5831

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

Merged
merged 6 commits into from
Jan 30, 2023
Merged
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
21 changes: 7 additions & 14 deletions examples/templates/kubernetes/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ variable "use_kubeconfig" {
variable "namespace" {
type = string
sensitive = true
description = "The namespace to create workspaces in (must exist prior to creating workspaces)"
description = "The Kubernetes namespace to create workspaces in (must exist prior to creating workspaces)"
}

variable "home_disk_size" {
Expand Down Expand Up @@ -57,17 +57,9 @@ resource "coder_agent" "main" {
startup_script = <<-EOT
set -e

# home folder can be empty, so copying default bash settings
if [ ! -f ~/.profile ]; then
cp /etc/skel/.profile $HOME
fi
if [ ! -f ~/.bashrc ]; then
cp /etc/skel/.bashrc $HOME
fi

# install and start code-server
curl -fsSL https://code-server.dev/install.sh | sh -s -- --version 4.8.3
code-server --auth none --port 13337 >/tmp/code-server.log 2>&1 &
curl -fsSL https://code-server.dev/install.sh | sh -s
code-server --auth none --port 13337 &
EOT
}

Expand Down Expand Up @@ -144,9 +136,10 @@ resource "kubernetes_pod" "main" {
fs_group = "1000"
}
container {
name = "dev"
image = "codercom/enterprise-base:ubuntu"
command = ["sh", "-c", coder_agent.main.init_script]
name = "dev"
image = "codercom/enterprise-base:ubuntu"
image_pull_policy = "Always"
command = ["sh", "-c", coder_agent.main.init_script]
security_context {
run_as_user = "1000"
}
Expand Down