Unverified Commit 176451f4 authored by Akihiro Suda's avatar Akihiro Suda Committed by GitHub

Fix rootless regression in 1.22 (Set KubeletInUserNamespace gate) (#3901)

Fix issue 3900 Kubernetes 1.22 requires `KuebletInUserNamespace` feature gate to be set for rootless: https://kubernetes.io/docs/tasks/administer-cluster/kubelet-in-userns/#userns-the-hard-waySigned-off-by: 's avatarAkihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
parent 66dacc6e
...@@ -18,6 +18,7 @@ import ( ...@@ -18,6 +18,7 @@ import (
) )
func createRootlessConfig(argsMap map[string]string, hasCFS, hasPIDs bool) { func createRootlessConfig(argsMap map[string]string, hasCFS, hasPIDs bool) {
argsMap["feature-gates=KubeletInUserNamespace"] = "true"
// "/sys/fs/cgroup" is namespaced // "/sys/fs/cgroup" is namespaced
cgroupfsWritable := unix.Access("/sys/fs/cgroup", unix.W_OK) == nil cgroupfsWritable := unix.Access("/sys/fs/cgroup", unix.W_OK) == nil
if hasCFS && hasPIDs && cgroupfsWritable { if hasCFS && hasPIDs && cgroupfsWritable {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment