Templates in Kubernetes
How can I access and access templates when I have deployed coder on Kubernetes.
When directly deploying on the machine, I can easily run the commands as provided for creating templates and workspaces. But how to do this for coder on Kubernetes
54 Replies
I have no experience with a kubernetes installation but may be you can try this,
Hi, After installation you should be able to access the coder webUI on your
ACCESS_URL
and create the first user then login to coder using your ACCESS_URL
After that it will be same I guess.Ah. Ok I am able to login
But another problem occured..
When I am creating a template, it says this
Error: Error when reading or editing GCE default service account: googleapi: Error 403: Request had insufficient authentication scope coder templates create
I have given access to this but still this error is occuringyou have given access but you didn't give it enough permissions it seems
So how can I get required permissions?
i thought you were using kubernetes, why the gce ?
I'm unsure, it should prompt you for which permissions you want to give it ?
So when I started with the steps, I just jumped here and there as I dont have idea about K8s or docker.
So I just popped up an Gcloud CE and started with configuring Kubernetes with it
I had no idea if its done like this or what
it's not
basically
when you upload the template, the kubernetes instance will be accessed from the machine that coder is running on
so it needs to be accessible from that machine
Oh..
I logged in on coder with the same CE on which I configured all this helm and kubectl
So where this piece of text has to be put?
in your template
but I think you should show me your template first
remove any secrets
I didnt did much just created using template init and choosed Linux on GCP and then coder templates create(where I got this error)
with that template every workspace will be a GCP instance
So does it mean that all the workspaces I create using that template (GCP-linux), It will be a seperate GCP VM?
yes
ah..
So whats the correct way?
Starting from scrach
choose the kubernetes/docker template
then fill in the required info in the template for coder to be able to connect to your endpoint
Okay..
And then what about the auth error?
that won't happen since it won't have to access to gcp
let me try it rn
says A template already exists named "kubernetes"!
Is this okay?
as I havent done this
maybe you already tried to do it ?
can you show me
ig it was because of the value.yaml in helm
i'm really not sure lol
do you have any idea that how to set this coder.serviceAccount.worksp... true as it says in comment
uuuuh no not really
I've never used k8s at all
I guess it's time to learn it
I doubt this would be related to your issue though
it wouldn't make sense
what command are you running ?
also, if I just assume that it has a template ready for me,
still it is not working for creating a workspace
could you show me the templates tab from your coder deployment ?
that coder tempaltes init and selection kubernetes
here
yeah
makes sense
and if I click create workspaces then it shows same
it tries to create the template on your server but it already exists
you should delete that template
how to delete a template?
click on it's name
and click settings
then scroll down and delete it
although it seems you can't access that page
try to visit
/templates/kubernetes/settings
ok cool
let me try
ok its deleted
now I am going to init it
see this
what should I choose
actually maybe that is the issue yeah
brb
okay
aight so
is your coder host running a k8s pod
I'd assume yes
yeah set to false
Ig..
If it was mentioned on K8s documentation so I have done that as said
I'm totally unsure lol
maybe @kyle can help, dunno who to ping
okay
btw whats coder host exactly?
the env coder is running in
so it can be a vm, a docker container, etc
so I have that GCP VM from I am executing commands to control cluster and I have logged into coder
other I have a K8s cluster from I guess where my coder is running
should I give a try to setting false?
also, I dont have a kube/config file on my VM so ig setting false will be the only option I guess...
Marked the thread as resolved.
Thanks @Phorcys its created
well yeah, but does the template actually work ?
I created a workspace with it.
now trying to get vscode web ide on workspace
Also, I had a doubt about stopping and starting coder on k8s?
How can I stop the code server without forcefully shutting down whole VM
and how to restart it.
So that when I'll not be using it, I'll stop it