-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Kubernetes UserNamespacesSupport alpha feature gate #3436
Comments
I need to read on the runc DMZ option, we avoid non-defaults since kind is for testing the project first and foremost, the other build options we set elsewhere so far are compiling out unused snapshotters or things of that nature. the directory permissions seem like an oversight more generally we intend to upgrade runc + containerd but have to be careful about it. I'm sure we'll get on it eventually but we normally only get on prerelease versions when we need a critical bug fix |
I faced the same failure with a similar setup.
diff --git a/images/base/Dockerfile b/images/base/Dockerfile
index 63060aee..5f1e6832 100644
--- a/images/base/Dockerfile
+++ b/images/base/Dockerfile
@@ -122,7 +122,7 @@ RUN eval "$(gimme "${GO_VERSION}")" \
# stage for building containerd
FROM go-build AS build-containerd
ARG TARGETARCH GO_VERSION
-ARG CONTAINERD_VERSION="v1.7.18"
+ARG CONTAINERD_VERSION="v2.0.0-rc.3"
ARG CONTAINERD_CLONE_URL="https://github.com/containerd/containerd"
# we don't build with optional snapshotters, we never select any of these
# they're not ideal inside kind anyhow, and we save some disk space
@@ -140,7 +140,7 @@ RUN git clone --filter=tree:0 "${CONTAINERD_CLONE_URL}" /containerd \
# stage for building runc
FROM go-build AS build-runc
ARG TARGETARCH GO_VERSION
-ARG RUNC_VERSION="v1.1.13"
+ARG RUNC_VERSION="v1.2.0-rc.2"
ARG RUNC_CLONE_URL="https://github.com/opencontainers/runc"
RUN git clone --filter=tree:0 "${RUNC_CLONE_URL}" /runc \
&& cd /runc \
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
featureGates:
"UserNamespacesSupport": true
nodes:
- role: control-plane
image: <above-bulit-image>
The kubelet reported the following error (the same one described in the initial issue)
I can confirm that the workaround provided by @dgl fixes the issue
To be honest, after this issue, I faced another one (exactly this containerd/containerd#10598) but this has probably nothing to do with KinD! Environment
|
What happened:
I'm working on parts of the Kubernetes user namespace support (currently an alpha feature). I'd like to use kind for testing it.
I enabled the
UserNamespacesSupport
feature gate. Pods that sethostUsers: false
fail with:After fixing that (below), I also saw:
What you expected to happen:
Sweet user namespace based isolation.
How to reproduce it (as minimally and precisely as possible):
Update runc to main in the base image, but also set
runc_nodmz
(because of the bug I reported in opencontainers/runc#4125):Also use containerd v2.0.0-pre version.
make quick
, build a node image based on a recent Kubernetes (something likekind build node-image ~/Code/kubernetes --image kindest/node:runc-main --base-image=gcr.io/k8s-staging-kind/base:v20231124-6a461ab5-dirty
).Create a kind cluster with:
Run a pod something like:
Fixes
sysfs
The first sysfs mount failed can be fixed by running:
This is because sysfs is mounted with "masks" -- the
/sys/devices/virtual/dmi/id/product_name
files which kind bind mounts over, except in that case the kernel does not let us mount a sysfs filesystem in a user namespace, because it is seen as masked. By (additionally) mounting sysfs elsewhere we can make the kernel's check succeed.(Still needs some thought/testing as to whether that should be readonly or readwrite, I suspect it should be rw, but that does seem to go against systemd's container interface, but for good reason.)
/kind/bin permissions
This just looks like a Dockerfile mistake, the directory isn't executable. A simple:
Fixes it.
Anything else we need to know?:
Mostly filing an issue for tracking and so other people might find this based on errors, if they try to use it. I'll open some PRs.
Environment:
kind version
): latest maindocker info
orpodman info
): docker 20.10.25/etc/os-release
): NixOS 23.05 (Stoat)kubectl version
): v1.30.0-alpha.0.5+d61cbac69aae97The text was updated successfully, but these errors were encountered: