Download coder-agent from a host with untrusted CA certificate
Hello!
I'm using the example k8s template for running inside a k8s pod.
When the pod spins up it tries to download using curl the coder-agent itself (directly from the running server). The server is host with a selfsigned ssl certificate, thus, curl command fails.
Where is this installation script? I could not find it in terraform files nor in
https://code-server.dev/install.sh
How is this being pulled and how can I modify it so I could append my own trusted CA cert?
Thanks.28 Replies
hello, can you send me your terraform template ?
you should be able to add your own certificate to the workspace image
Where is this installation script?I think it is in the coder terraform provider but I am totally unsure.
@Phorcys this is the default kubernetes template. for that matter.
yeah so
you should change the pod's
spec.container.image
from codercom/enterprise-base:ubuntu
to your own image which has the certs in it's trust store, I think this is the only was as of now.I see.. I'll give it a go. I'll take this one as a base and modify it per my needs.
soo
How do I download the original script then? I'll look for it in github.
you don't have to
you can just modify the pod's
spec.container.command
from ["sh", "-c", coder_agent.main.init_script]
to ["my_script_or_whatever", "&&", "sh", "-c", coder_agent.main.init_script]
kinda dirty but it will work
you could put the script in a volume so you don't have to feed it 900 argumentsI like the idea of building my own image here based on the
codercom/enterprise-base:ubuntu
image.
Follow up question - I use ECR (AWS image registry). Can I reference private registries that needs authentication?yes
let me find it
Where are you looking for it? In official docs?
I was about to tell you, you can look in the provider's documentation
Will do.
so, in that case it's
hashicorp/kubernetes
-> https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs
same goes for the coder provider coder/coder
if you're looking for coder-related stuff.
-> https://registry.terraform.io/providers/coder/coder/latest/docs
I know you can do it with the docker provider, you should be able to do it with this one too but I haven't seen it beforeI think its less related to the coder provider and more to the
kubernetes_pod
resourceit is, I was just giving that link for reference incase you're looking for docs for
coder_app
/any coder resources.
I think I found it
yup