Skip to content

Commit 69b214d

Browse files
author
Kubernetes Submit Queue
authored
Merge pull request kubernetes#35652 from vishh/klet-overrride-mount-rootfs
Automatic merge from submit-queue Adding a root filesystem override for kubelet mounter This is necessary to get hostPath volumes to work with containerized kubelet mounter
2 parents cfdaf18 + e861a57 commit 69b214d

File tree

18 files changed

+3111
-3018
lines changed

18 files changed

+3111
-3018
lines changed

cmd/kube-proxy/app/conntrack.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func (realConntracker) SetTCPEstablishedTimeout(seconds int) error {
6767
func isSysFSWritable() (bool, error) {
6868
const permWritable = "rw"
6969
const sysfsDevice = "sysfs"
70-
m := mount.New("" /* default mount path */)
70+
m := mount.New()
7171
mountPoints, err := m.List()
7272
if err != nil {
7373
glog.Errorf("failed to list mount points: %v", err)

cmd/kubelet/app/options/options.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ func (s *KubeletServer) AddFlags(fs *pflag.FlagSet) {
198198
fs.BoolVar(&s.ExitOnLockContention, "exit-on-lock-contention", s.ExitOnLockContention, "Whether kubelet should exit upon lock-file contention.")
199199
fs.StringVar(&s.RktPath, "rkt-path", s.RktPath, "Path of rkt binary. Leave empty to use the first rkt in $PATH. Only used if --container-runtime='rkt'.")
200200
fs.StringVar(&s.ExperimentalMounterPath, "experimental-mounter-path", s.ExperimentalMounterPath, "[Experimental] Path of mounter binary. Leave empty to use the default mount.")
201+
fs.StringVar(&s.ExperimentalMounterRootfsPath, "experimental-mounter-rootfs-path", s.ExperimentalMounterRootfsPath, "[Experimental] Absolute path to the root filesystem for the mounter binary.")
201202
fs.StringVar(&s.RktAPIEndpoint, "rkt-api-endpoint", s.RktAPIEndpoint, "The endpoint of the rkt API service to communicate with. Only used if --container-runtime='rkt'.")
202203
fs.StringVar(&s.RktStage1Image, "rkt-stage1-image", s.RktStage1Image, "image to use as stage1. Local paths and http/https URLs are supported. If empty, the 'stage1.aci' in the same directory as '--rkt-path' will be used.")
203204
fs.MarkDeprecated("rkt-stage1-image", "Will be removed in a future version. The default stage1 image will be specified by the rkt configurations, see https://github.com/coreos/rkt/blob/master/Documentation/configuration.md for more details.")

cmd/kubelet/app/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ func UnsecuredKubeletDeps(s *options.KubeletServer) (*kubelet.KubeletDeps, error
118118
return nil, err
119119
}
120120

121-
mounter := mount.New(s.ExperimentalMounterPath)
121+
mounter := mount.NewCustomMounter(s.ExperimentalMounterPath, s.ExperimentalMounterRootfsPath)
122122
var writer kubeio.Writer = &kubeio.StdWriter{}
123123
if s.Containerized {
124124
glog.V(2).Info("Running kubelet in containerized mode (experimental)")

hack/verify-flags/known-flags.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ experimental-allowed-unsafe-sysctls
188188
experimental-bootstrap-kubeconfig
189189
experimental-keystone-url
190190
experimental-mounter-path
191+
experimental-mounter-rootfs-path
191192
experimental-nvidia-gpus
192193
experimental-prefix
193194
experimental-runtime-integration-type

0 commit comments

Comments
 (0)