Running remote IDE's using DevPod (5 of 5)

Now we've made sure everything will be set up automatically once we create a namespace, and start our DevPod, we can start configuring DevPod itself. There's a few things we need to configure to make DevPod work nicely with the environment we set up.

Configuring DevPod

We need to add a Kubernetes type provider within the DevPod application. Then within the Options we'll set the namespace to the name of $USER. In my case, the namespace will be called yordipauptit, since that is what my username is on my workstation. Then we'll need to set the Build Repository to our private registry, which in my case will be ghcr.io/yp28/devpod.

In the Kubernetes Config section, we'll use the Kubernetes Config for our cluster. Is is the configuration file that your kubectl also uses to authenticate to the cluster, with the Kubernetes Context being the context you'll want to use to deploy this to.

In the Building section, we'll need to define a Buildkit Image, which we'll set to moby/buildkit:v0.12.0. We'll also check Buildkit Privileged to be active. This is not safe in a lot of environments, and there are most definitely ways to have Buildkit build your images without needing a privileged pod. Be sure to dive deeper into how to accomplish this before you run this in a production setting.

Within the Advanced Options section, we'll need to define that we'll use the default ServiceAccount. This is the ServiceAccount we bound our role to, and this will be used to generate our in-cluster kubeconfig. Next, make sure the Create Namespace option is checked to be active.

Creating a Workspace

Now we'll create the Workspace for our project. In the Workspaces section in DevPod, we can click create, and enter the Workspace source. This will be the repository of the project, and contains the .devcontainer.json file with our configuration.

We make sure the Provider we select is the Kubernetes provider we just configured, and the Default IDE we'll use in this example is VSCode.

You'll also have the option here to specify a Workspace Name, which by default will be the name of the repository, and a Prebuild Repository if needed.

Lastly, if in your project the .devcontainer.json/ .devcontainer/devcontainer.json has a different location, please make sure to specify it in the DevContainer Path option.

After all this configuration, we can now create the Workspace, and let DevPod build and start the workloads. If all is well, it should automatically open the local IDE client with the project. A terminal will be available in the IDE, which will be running on the remote.