Running workspace inside k8s pods
General question, what backends are most people running? I'm all for the k8s approach as its the easiest way for me (on top of other benefits) - but I'm not sure if this is where Coders' focus is at.
For example, I can't seem to "port forward" or use
coder config-ssh
command. Are these supported when coder runs inside of a pod?
For example, while wildcard domains is configured, I get
Running coder config-ssh
returns
Any tips appreciated.35 Replies
I'm running in Docker but both those features should still work in any env as long as the coder agent is running and can communicate with the server
So I'm missing the token thing. the agent fails to register with the server..
@Phorcys - thanks for being so attentive!
yeah so that's defo the issue
can you show me your
CODER_WILDCARD_ACCESS_URL
env var ?
also for the token part I really don't know
I think @Ben might be able to help ?
you should post your error logs to make the help faster when the team has time to take a lookHey!
1) For port forward you'll need to set a wildcard access url: https://coder.com/docs/coder-oss/latest/admin/configure#wildcard-access-url
2) Try updating your local client to the latest Coder version to
config-ssh
. We changed the API recently and didn't display a proper errorConfiguration - Coder OSS main docs
Learn how to configure Coder
he did set an access URL but I suspect he might've left the scheme in
You're right.
Ah awesome
my bad. I did leave the scema.
Still.. the agent cannot register..
I get a 401. with the default k8s pod resource taking the token from the
coder_agent.main.token
resource.Hmm what are the logs of the pod?
kubectl logs <workspace-pod-name>
Can you share your pod spec in the Terraform template?
Just trying to get a feeling of how it should work before diving in.
Hmm... that should work. When you start/stop the workspace, does anything change?
Or check if it is properly set in the pod
With your other screenshot (the port-forward button) it seemed like everything connected OK
Yep. this contains a uuid.
What version of Coder are you using?
(shows on the bottom of the /workspaces page)
funny enough, stopping and starting recreated the pod and no 401 errors.
config-ssh still does not work.
Let me try to create a new workspace.
Oh nice! So your CLI is the same version as the server?
The cli looks newer.
Ahh ok. Yeah that mismatch is why you're running into the issue with
config-ssh
. I'd update the server 🙂A new workspace still gets 401 😦
Something with the order of things? can it be that the code agent starts before the token is being exported?
Can you send your full template? Is it anything out of the ordinary compared to our example
Nothing
I took your vanilla example just Yesterday and wanted to run it first.
The only thing I did, is to create a new docker image from your base in order to add a custom CA cert so I could download code-server (curl fails for self signed certs) - see my other thread from today.
upgrading the server worked for ssh!
It's still super odd that the first build leads to a 401 error :/
So now I'm a bit worried about backward compatibility for my users..
Lets recreate another one.
Yeah we don't plan on introducing breaking changes like that, especially over patch versions. At the very least, we should document it and display a message in the CLI for developers to upgrade.
It was a bug on our end
ok. this is weird. got a 401 but ssh connects.
I'll get you the entire log
Oh and in the dashboard it shows up fine?
yes.
Yeah it's possible there was just an order issue. If the dashboard shows the agent is connected, you can disregard that. We can file a bug report though so that there is not log spam
Alright then... will continue my journey here 🙂
Thanks a lot @Ben and @Phorcys for your support!
I'll probably bug you again later.
@Ben mind filing the bug report?
Yeah i'm on it!
Marked the thread as resolved.