C
Coder.com3mo ago
ÙwÚ

Attempting to run coder in k8s (im running a k3s on my server)

just a quick question, im currently running coder with docker compose, and tls is managed by traefik (also with docker) I'm in progress of transitioning from docker to k8s for all my apps, is the helm installation works well with traefik run in k8s? Or is this attempt not worth it? Just seeking some advice while I'm bricking it in the meantime:)
10 Replies
Codercord
Codercord3mo ago
Codercord
Codercord3mo ago
<#1400357126408503326>
Category
Other
Product
Coder (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
Phorcys
Phorcys2mo ago
yes! that is a supported use-case just a quick question, are you familiar with the concept of ingress controllers and ingress objects in k8s at all?
ÙwÚ
ÙwÚOP2mo ago
first I've heard of it, just switching to k8s not too long ago, lots of stuff I dont know about is that something has to be setup for coder to run? oh so it's like configuring traefik, but with k8s ingress, i may not need to touch it at all as my use case is only me:) im the only one who use it
Phorcys
Phorcys2mo ago
it's not necessarily needed but highly recommended yes, so even then, it'll make your life way easier an Ingress controller is just a reverse-proxy that has been modified to pick up Kubernetes Ingress objects. the way Ingresses work on Kubernetes, is that instead of manually configuring a reverse proxy, you are able to create an Ingress resource, and the Ingress controller will pick that up, and automatically configure itself you can also configure the Ingress controller to automatically issue certificates for any new domains makes sense :), that is why i asked in the first place the reason you'll want to use this is because instead of configuring your reverse-proxy, you can just set ingress.enable when importing the helm chart and it'll automatically configure your reverse-proxy (https://artifacthub.io/packages/helm/coder-v2/coder?modal=values&path=coder.ingress) k3s has a built-in traefik ingress controller but you'll want to configure it to use valid certificates
ÙwÚ
ÙwÚOP2mo ago
thanks! i'll have a look at it, since my case is a bit odd (i'm behind cgnat and cant port forward), im running behin cloudflare tunnel for now
ÙwÚ
ÙwÚOP2mo ago
@Phorcys sorry for the ping, just a quick question, im trying to setup k8s template, I need some help here:
# code-server
resource "coder_app" "code-server" {
agent_id = coder_agent.main.id
slug = "code-server"
display_name = "code-server"
icon = "/icon/code.svg"
url = "http://localhost:13337?folder=/home/coder"
subdomain = false
share = "owner"

healthcheck {
url = "http://localhost:13337/healthz"
interval = 3
threshold = 10
}
}
# code-server
resource "coder_app" "code-server" {
agent_id = coder_agent.main.id
slug = "code-server"
display_name = "code-server"
icon = "/icon/code.svg"
url = "http://localhost:13337?folder=/home/coder"
subdomain = false
share = "owner"

healthcheck {
url = "http://localhost:13337/healthz"
interval = 3
threshold = 10
}
}
in k8s there is this resource, but I cant find docs anywhere on how to install extensions with code-server, while in module we have options to:
module "code-server" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/code-server/coder"
slug = "VS Code Web"
# This ensures that the latest version of the module gets downloaded, you can also pin the module version to prevent breaking changes in production.
version = ">= 1.0.0"
agent_id = coder_agent.main.id
order = 1
extensions = [
"GitHub.copilot",
"ms-python.python",
"ms-python.debugpy",
"HashiCorp.terraform",
"esbenp.prettier-vscode",
"redhat.vscode-yaml",
"continue.continue",
"ms-pyright.pyright",
"VisualStudioExptTeam.vscodeintellicode"
]
}
module "code-server" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/modules/code-server/coder"
slug = "VS Code Web"
# This ensures that the latest version of the module gets downloaded, you can also pin the module version to prevent breaking changes in production.
version = ">= 1.0.0"
agent_id = coder_agent.main.id
order = 1
extensions = [
"GitHub.copilot",
"ms-python.python",
"ms-python.debugpy",
"HashiCorp.terraform",
"esbenp.prettier-vscode",
"redhat.vscode-yaml",
"continue.continue",
"ms-pyright.pyright",
"VisualStudioExptTeam.vscodeintellicode"
]
}
so I tried to delete resource and use this module instead, isthat what I should do? but without healthcheck imgoing to meet with this (see picture), I need some help to set k8s template up please
No description
ÙwÚ
ÙwÚOP2mo ago
oh hey nvm I fixed it, have a good day, sorry for the ping
Phorcys
Phorcys2mo ago
no worries you're good! i'll close the thread then :)
Codercord
Codercord2mo ago
@Phorcys closed the thread.

Did you find this page helpful?