This repository was archived by the owner on Aug 18, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 82
chore: add CODER_RUNTIME var to docs #410
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
9b9e914
Avoid pulling full values file during install (#401)
deansheather 88fda0a
chore: Add solution for Docker problems (#369)
kylecarbs 9f4384e
Configuring external database validation (#352)
d51fed1
Clarify that the quota counts running workspaces (#407)
a82bab8
Add CODER_RUNTIME var to docs
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,115 @@ | ||
--- | ||
title: Docker key storage issues | ||
description: Learn how to solve Docker key storage issues inside Coder workspaces. | ||
--- | ||
|
||
When using Coder, you may encounter the following error: | ||
|
||
```console | ||
docker: Error response from daemon: OCI runtime create failed: | ||
container_linux.go:370: starting container process caused: | ||
process_linux.go:459: container init caused: join session keyring: | ||
create session key: disk quota exceeded: unknown. | ||
``` | ||
|
||
## Why this happens | ||
|
||
The kernel allocates a system key for each container created. When lots of | ||
developers are sharing the same instance, you may run into limits on the number | ||
and size of keys each user can have. | ||
|
||
## Resolution | ||
|
||
To fix this error, you can increase `maxkeys` and `maxbytes`. These are global | ||
settings that apply to *all* users sharing the same system. You can modify this | ||
by adding the following to the `sysctl` configuration file: | ||
|
||
```console | ||
sudo sysctl -w kernel.keys.maxkeys=20000 | ||
sudo sysctl -w kernel.keys.maxbytes=400000 | ||
``` | ||
|
||
Alternatively, you can use a DaemonSet with `kubectl apply` to make changes to | ||
`sysctl`: | ||
|
||
```yaml | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
name: increase-limits | ||
namespace: kube-system | ||
labels: | ||
app: increase-limits | ||
k8s-app: increase-limits | ||
spec: | ||
selector: | ||
matchLabels: | ||
k8s-app: increase-limits | ||
template: | ||
metadata: | ||
labels: | ||
name: increase-limits | ||
k8s-app: increase-limits | ||
annotations: | ||
seccomp.security.alpha.kubernetes.io/defaultProfileName: runtime/default | ||
apparmor.security.beta.kubernetes.io/defaultProfileName: runtime/default | ||
spec: | ||
nodeSelector: | ||
kubernetes.io/os: linux | ||
initContainers: | ||
- name: sysctl | ||
image: alpine:3 | ||
command: | ||
- sysctl | ||
- -w | ||
- kernel.keys.maxkeys=20000 | ||
- kernel.keys.maxbytes=400000 | ||
resources: | ||
requests: | ||
cpu: 10m | ||
memory: 1Mi | ||
limits: | ||
cpu: 100m | ||
memory: 5Mi | ||
securityContext: | ||
# We need to run as root in a privileged container to modify | ||
# /proc/sys on the host (for sysctl) | ||
runAsUser: 0 | ||
privileged: true | ||
readOnlyRootFilesystem: true | ||
capabilities: | ||
drop: | ||
- ALL | ||
containers: | ||
- name: pause | ||
image: k8s.gcr.io/pause:3.5 | ||
command: | ||
- /pause | ||
resources: | ||
requests: | ||
cpu: 10m | ||
memory: 1Mi | ||
limits: | ||
cpu: 100m | ||
memory: 5Mi | ||
securityContext: | ||
runAsNonRoot: true | ||
runAsUser: 65535 | ||
allowPrivilegeEscalation: false | ||
privileged: false | ||
readOnlyRootFilesystem: true | ||
capabilities: | ||
drop: | ||
- ALL | ||
terminationGracePeriodSeconds: 5 | ||
``` | ||
|
||
At a later point, you can delete the DaemonSet by running: | ||
|
||
```console | ||
$ kubectl delete --namespace=kube-system daemonset increase-limits | ||
daemonset.apps "increase-limits" deleted | ||
``` | ||
|
||
However, note that the setting will persist until the node restarts or another | ||
program sets the `kernel.keys.maxkeys` and `kernel.keys.maxkeys` settings. |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think
is a
makes sense, since "containerized virtual machine" is a category, rather than something that can be turned on or off (this setting can't be changed after creation).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry that I'm late to this, CODER_RUNTIME is set to the runtime name, currently either
kubernetes/default
orkubernetes/sysbox
(for CVMs). The goal is that we would later support other runtimes, so this isn't a boolean flag: it is the name of the container runtime that we're using to start the workspace.Code reference: https://github.com/cdr/m/blob/5cf9288a2b3e506dfa2b31098eaf730ce99a1a4c/product/coder/pkg/model/environments_stages.go#L283-L286
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jawnsy Thanks, I'll update this in the release branch!