How to connect VSCode with Workspace?I'm using kubernetes templates. Anyone have guide?

.
24 Replies
kimke5
kimke5OP2y ago
Could not establish connection to our workspace. Could you please advise me about fix it?thank
No description
Cian
Cian2y ago
Have you downloaded the CLI binary for your platform (https://github.com/coder/coder/releases) and run coder config-ssh ?
GitHub
Releases · coder/coder
A tool that provisions remote development environments via Terraform - coder/coder
Cian
Cian2y ago
kimke5
kimke5OP2y ago
@Cian coder is install and I can ssh from my terminal but cannot connect from VSCode
Cian
Cian2y ago
Is tar available in your workspace?
kimke5
kimke5OP2y ago
Could this be one of the reasons?
No description
Cian
Cian2y ago
That looks like a smoking gun to me. What are the perms on that folder?
kimke5
kimke5OP2y ago
@Cian I have deploy coder on K8s and this is a folder of workspace
No description
Cian
Cian2y ago
Can you show the YAML for your workspace's PersistentVolumeClaim?
kimke5
kimke5OP2y ago
you can see @Cian
No description
Cian
Cian2y ago
Sorry, coffee hasn't kicked in yet. The fsGroup would be specified in the spec.SecurityContext of your pod. https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
Kubernetes
Configure a Security Context for a Pod or Container
A security context defines privilege and access control settings for a Pod or Container. Security context settings include, but are not limited to: Discretionary Access Control: Permission to access an object, like a file, is based on user ID (UID) and group ID (GID). Security Enhanced Linux (SELinux): Objects are assigned security labels. Runni...
Cian
Cian2y ago
What kind of storageClass are you using?
kimke5
kimke5OP2y ago
this is my storageclass @Cian
No description
kimke5
kimke5OP2y ago
I'm using helm to deploy coder pod
Cian
Cian2y ago
So this is using the local-static-provisioner (https://github.com/kubernetes-sigs/sig-storage-local-static-provisioner) correct?
GitHub
GitHub - kubernetes-sigs/sig-storage-local-static-provisioner: Stat...
Static provisioner of local volumes. Contribute to kubernetes-sigs/sig-storage-local-static-provisioner development by creating an account on GitHub.
kimke5
kimke5OP2y ago
@Cian I run command "chown -R 1000:1000 my-folder" and then it working well
Cian
Cian2y ago
Yes, that will fix the issue temporarily My guess is that you would need to set fsGroup on your pod spec, and then hopefully Kubernetes would do that for you
kimke5
kimke5OP2y ago
Yes, I think so that 👍 Btw how can I connect with git or source control ?
Cian
Cian2y ago
Do you mean just cloning repositories to your workspace, or do you mean GitHub login with OAuth? Coder generates an SSH key for you, you can get it from your.coder.instance/settings/ssh-keys and then add it to GitHub or wherever you need
kimke5
kimke5OP2y ago
Do you have a guide for both? thank
Cian
Cian2y ago
Secrets - Coder v2 main docs
Learn how to use secrets in your workspace
Authentication - Coder v2 main docs
Learn how to set up authentication using GitHub or OpenID Connect
kimke5
kimke5OP2y ago
@Cian How to version control of git project if I update source code on VSCode? And how to commit on git repo?
Cian
Cian2y ago
It should "just work" with regular Git commands. Coder sets the GIT_SSH_COMMAND for you so you end up using your Git SSH key inside the workspace
Want results from more Discord servers?
Add your server