Accessing an sql server from outside the workspace
Hi, I have coder deployed on a k8s cluster and a workspace using docker in docker. I have deployed an sql server in the workspace using docker compose, exposing 1433 and 1434 (TCP). Our team wants to be able to access that sql server from outside the workspace. Is this possible? If it is what’s the best way of doing it?
4 Replies
<#1227191822837616640>
Category
Help needed
Product
Coder OSS (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
Hi, You can use an coder_app https://registry.terraform.io/providers/coder/coder/latest/docs/resources/app in your template with
share = public
or use SSH ssh -L 1433:localhost:1433 coder.MYWORKSPACE
Another option would be to define the sql server as a separate k8s deployment and service in your template and then access it via
sqlserver.namespace.svc.cluster.local
directly within the cluster, if all access is going to happen within k8s. Otherwise coder_app
or port-foward is your best betProblem I found with port sharing is it only supports http and https. However I want to be able to forward the port the container opens which is 1434 TCP