-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update gvisor extension after testing
This extension was tested with Talos, there's one issue with cgroups which required disabling cgroup support in `runsc`. Fixed up manifest and added documentation on using the extension. Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
- Loading branch information
Showing
5 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# gVisor extension | ||
|
||
## Usage | ||
|
||
Enable the extension in the machine configuration before installing Talos: | ||
|
||
```yaml | ||
machine: | ||
install: | ||
extensions: | ||
- image: ghcr.io/talos-systems/gvisor:<VERSION> | ||
``` | ||
gVisor requires unprivileged user namespace creation, so Talos default setting | ||
should be overridden: | ||
```yaml | ||
machine: | ||
sysctls: | ||
user.max_user_namespaces: "11255" | ||
``` | ||
> Warning! This disables [KSPP best practices](https://kernsec.org/wiki/index.php/Kernel_Self_Protection_Project/Recommended_Settings#sysctls) setting. | ||
## Testing | ||
Apply the following manifest to run nginx pod via gVisor: | ||
```yaml | ||
apiVersion: node.k8s.io/v1 | ||
kind: RuntimeClass | ||
metadata: | ||
name: gvisor | ||
handler: runsc | ||
--- | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: nginx-gvisor | ||
spec: | ||
runtimeClassName: gvisor | ||
containers: | ||
- name: nginx | ||
image: nginx | ||
``` | ||
The pod should be up and running: | ||
```bash | ||
$ kubectl get pods | ||
NAME READY STATUS RESTARTS AGE | ||
nginx-gvisor 1/1 Running 0 40s | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runsc] | ||
runtime_type = "io.containerd.runsc.v1" | ||
|
||
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runsc.options] | ||
TypeUrl = "io.containerd.runsc.v1.options" | ||
ConfigPath = "/etc/cri/conf.d/runsc.toml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[runsc_config] | ||
# See https://github.com/talos-systems/extensions/issues/4 | ||
ignore-cgroups = "true" |