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
After [installing Sysbox on Kubernetes](https://github.com/nestybox/sysbox/blob/master/docs/user-guide/install-k8s.md), modify your template to use the sysbox-runc RuntimeClass.
41
-
42
-
> Currently, the official [Kubernetes Terraform Provider](https://registry.terraform.io/providers/hashicorp/kubernetes/latest) does not support specifying a custom RuntimeClass. [mingfang/k8s](https://registry.terraform.io/providers/mingfang/k8s), a third-party provider, can be used instead.
40
+
After [installing Sysbox on Kubernetes](https://github.com/nestybox/sysbox/blob/master/docs/user-guide/install-k8s.md), modify your template to use the sysbox-runc RuntimeClass. This requires the Kubernetes Terraform provider version 2.16.0 or greater.
43
41
44
42
```hcl
43
+
terraform {
44
+
required_providers {
45
+
coder = {
46
+
source = "coder/coder"
47
+
}
48
+
kubernetes = {
49
+
source = "hashicorp/kubernetes"
50
+
version = "2.16.0"
51
+
}
52
+
}
53
+
}
54
+
55
+
variable "workspaces_namespace" {
56
+
default = "coder-namespace"
57
+
}
58
+
59
+
data "coder_workspace" "me" {}
60
+
45
61
resource "coder_agent" "main" {
46
62
os = "linux"
47
63
arch = "amd64"
@@ -56,7 +72,7 @@ resource "coder_agent" "main" {
56
72
EOF
57
73
}
58
74
59
-
resource "k8s_core_v1_pod" "dev" {
75
+
resource "kubernetes_pod" "dev" {
60
76
count = data.coder_workspace.me.start_count
61
77
metadata {
62
78
name = "coder-${data.coder_workspace.me.owner}-${data.coder_workspace.me.name}"
While less secure, you can attach a [privileged container](https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities) to your templates. This may come in handy if your nodes cannot run Sysbox.
95
110
96
-
### Use a privileged sidecar container in Docker-based templates:
111
+
### Use a privileged sidecar container in Docker-based templates
Additionally, [Sysbox](https://github.com/nestybox/sysbox) can be used to give workspaces full `systemd` capabilities.
181
214
182
-
### Use systemd in Docker-based templates:
215
+
### Use systemd in Docker-based templates
183
216
184
217
After [installing Sysbox](https://github.com/nestybox/sysbox#installation) on the Coder host, modify your template to use the sysbox-runc runtime and start systemd:
After [installing Sysbox on Kubernetes](https://github.com/nestybox/sysbox/blob/master/docs/user-guide/install-k8s.md), modify your template to use the sysbox-runc RuntimeClass.
255
+
### Use systemd in Kubernetes-based templates
225
256
226
-
> Currently, the official [Kubernetes Terraform Provider](https://registry.terraform.io/providers/hashicorp/kubernetes/latest) does not support specifying a custom RuntimeClass. [mingfang/k8s](https://registry.terraform.io/providers/mingfang/k8s), a third-party provider, can be used instead.
257
+
After [installing Sysbox on Kubernetes](https://github.com/nestybox/sysbox/blob/master/docs/user-guide/install-k8s.md),
258
+
modify your template to use the sysbox-runc RuntimeClass. This requires the Kubernetes Terraform provider version 2.16.0 or greater.
227
259
228
260
```hcl
229
261
terraform {
230
262
required_providers {
231
263
coder = {
232
264
source = "coder/coder"
233
265
}
234
-
k8s = {
235
-
source = "mingfang/k8s"
266
+
kubernetes = {
267
+
source = "hashicorp/kubernetes"
268
+
version = "2.16.0"
236
269
}
237
270
}
238
271
}
239
272
273
+
variable "workspaces_namespace" {
274
+
default = "coder-namespace"
275
+
}
276
+
277
+
data "coder_workspace" "me" {}
240
278
241
279
resource "coder_agent" "main" {
242
280
os = "linux"
243
281
arch = "amd64"
244
282
dir = "/home/coder"
245
283
}
246
284
247
-
resource "k8s_core_v1_pod" "dev" {
285
+
resource "kubernetes_pod" "dev" {
248
286
count = data.coder_workspace.me.start_count
249
287
metadata {
250
288
name = "coder-${data.coder_workspace.me.owner}-${data.coder_workspace.me.name}"
0 commit comments