You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: posts/running-coder-in-k3s/index.md
+19-9Lines changed: 19 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -10,20 +10,28 @@ This post aims at describing the deployment of [Coder](https://coder.com/) on a
10
10
11
11
[Coder](https://coder.com/) is an online development environment platform that offers the possibility to code directly from a web browser. All the compilation toolchain is then deported on the server. [Coder](https://coder.com/) provides a ready-to-use remote development environment and reduces the installation and configuration issues that could arise from the heterogeneity of developer's workstation architectures and software used.
12
12
13
-
This kind of solution has gained popularity in recent years, with several alternative solutions such as: [Gitpod](https://www.gitpod.io/), [EclipseCHE](https://www.eclipse.org/che/), [JupyterHub](https://jupyter.org/hub), [GitHub Codespaces](https://github.com/features/codespaces), or [Codeanywhere](https://codeanywhere.com/). These alternative solutions have a lot in common, but also some distinguishing features that can make them attractive.
13
+
This kind of solution has gained popularity in recent years, with several alternative solutions such as:
These alternative solutions have a lot in common, but also some distinguishing features that can make them attractive.
14
22
15
23
I am interested in deploying an online development platform within a higher education governmental institution. This platform is meant to be used by researchers and students. Several features are mandatory, such as self-hosting, open source, great community, ease of installation, and the ability to handle multiple programming languages.
16
24
17
25
A first experimentation was based on [Gitpod](https://www.gitpod.io/). Unfortunately, Gitpod no longer supports self-hosting, as explained on the [Gitpod blog](https://www.gitpod.io/blog/introducing-gitpod-dedicated). Furthermore, setting up [Gitpod](https://www.gitpod.io/) was not easy, and I can understand the choice made by [Gitpod](https://www.gitpod.io/) developers, as explained on the blog post, to drop support for self-hosting since there were many issues arising from the heterogeneity of Kubernetes distributions. A second solution was [JupyterHub](https://jupyter.org/hub), which was fairly easy to install but limited to the Python language. In a third experimentation, I therefore turned to [Coder](https://coder.com/). In this post I will explain how I deployed it on a [K3s](https://k3s.io/) cluster.
18
26
19
-
From a technical point of view, [Coder](https://coder.com/) provisions remote development environments via Terraform to supply users with Workspaces. For example, via Terraform, you can specify that you want to use a specific Docker image that contains the necessary compilation toolchain to build Java programs and that you want to install VIM as a code editor. Resources will also be specified, such as the memory or storage capacity of Workspaces. As for [K3s](https://k3s.io/), it is a lightweight Kubernetes distribution designed for production environments with limited resources, such as embedded systems. I appreciate [K3s](https://k3s.io/) because it is designed to be easy to install.
27
+
[Coder](https://coder.com/) solution matches all features I need, because it is [self-hosted](https://coder.com/docs/v2/latest/install), [open source](https://github.com/coder) and has a great[Discord community](https://discord.com/invite/coder). From a technical point of view, [Coder](https://coder.com/) provisions remote development environments via Terraform to supply users with Workspaces. For example, via Terraform, you can specify that you want to use a specific Docker image that contains the necessary compilation toolchain to build Java programs and that you want to install VIM as a code editor. Resources will also be specified, such as the memory or storage capacity of Workspaces. As for [K3s](https://k3s.io/), it is a lightweight Kubernetes distribution designed for production environments with limited resources, such as embedded systems. I appreciate [K3s](https://k3s.io/) because it is designed to be easy to install.
20
28
21
29
The deployment of [Coder](https://coder.com/) on a [K3s](https://k3s.io/) cluster is broken down into the following steps:
22
30
23
31
*[Setup](#setup)
24
32
*[Install k3s](#install-k3s)
25
33
*[Deploy Coder](#deploy-coder)
26
-
*[Deploy Reverse Proxy](#deploy-reverse-proxy)
34
+
*[Deploy reverse-proxy](#deploy-reverse-proxy)
27
35
*[NGINX](#nginx)
28
36
*[Apache HTTP](#apache-http)
29
37
*[Run and enjoy](#test-coder)
@@ -41,13 +49,15 @@ Before starting the [Coder](https://coder.com/) install process, you must have:
41
49
* All machines are on the same vlan.
42
50
* All machines have ports 22 (SSH), 80 (HTTP), 443 (HTTPS) and 6443 (Kubernetes) exposed.
43
51
* A domain (coder.mydomain.com), a subdomain (*.coder.mydomain.com) and a configured DNS to redirect to `k3sserver`.
44
-
* A reverse Proxy (Apache HTTP or NGINX) which will be hosted outside of the Kubernetes cluster.
45
-
* A [Docker](https://www.docker.com/) installation on `k3sserver` to deploy the Reverse Proxy.
52
+
* A reverse-proxy (Apache HTTP or NGINX) which will be hosted outside of the Kubernetes cluster.
53
+
* A [Docker](https://www.docker.com/) installation on `k3sserver` to deploy the reverse-proxy.
> **Note**: in the following infrastructure, I will present a configuration where TLS certificates will be managed by a reverse-proxy outside of Kubernetes. It is a **restriction** of my higher education governmental institution and I would like to reproduce the same setup and to show you this specific use case. But, I agree in many cases, the ingress could/should also be secured via [cert-manager](https://cert-manager.io/) or by passing TLS certificates in directly. It would be better to stay within the K8s infrastructure.
60
+
51
61
## Install [K3s](https://k3s.io/)
52
62
53
63
* Connect to the server node (`k3sserver`) and run:
> These instructions are based on the [Coder](https://coder.com/) website: https://coder.com/docs/v2/latest/install/kubernetes.
252
262
253
-
## Deploy Reverse Proxy
263
+
## Deploy reverse-proxy
254
264
255
-
As mentioned in the introduction, a Reverse Proxy will be deployed outside of your Kubernetes cluster.
265
+
As mentioned in the setup section, a reverse-proxy will be deployed outside of your Kubernetes cluster.
256
266
257
-
The Reverse Proxy will also be in charge of managing SSL/TLS certificates. Let's describe how to generate certificates with LetsEncrypt.
267
+
The reverse-proxy will also be in charge of managing SSL/TLS certificates. Let's describe how to generate certificates with LetsEncrypt.
258
268
259
269
* Connect to the server node (`k3sserver`) and install Certbot:
260
270
@@ -316,7 +326,7 @@ We suppose [Docker](https://www.docker.com/) is installed on the server node (`k
316
326
$ docker network create reverseproxynetwork
317
327
```
318
328
319
-
Two Reverse Proxy solutions will be presented: [NGINX](https://www.nginx.com/) and [Apache HTTP](https://httpd.apache.org/). Choose only ONE at your convenience.
329
+
Two reverse-proxy solutions will be presented: [NGINX](https://www.nginx.com/) and [Apache HTTP](https://httpd.apache.org/). Choose only ONE at your convenience.
0 commit comments