Add flag to skip imagefs uuid related logic.
Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
parent
896cbd70f7
commit
dca05358dc
@ -96,6 +96,9 @@ type Config struct {
|
|||||||
ProfilingPort string `toml:"profiling_port" json:"profilingPort,omitempty"`
|
ProfilingPort string `toml:"profiling_port" json:"profilingPort,omitempty"`
|
||||||
// ProfilingAddress is address for profiling via host:port/debug/pprof/
|
// ProfilingAddress is address for profiling via host:port/debug/pprof/
|
||||||
ProfilingAddress string `toml:"profiling_addr" json:"profilingAddress,omitempty"`
|
ProfilingAddress string `toml:"profiling_addr" json:"profilingAddress,omitempty"`
|
||||||
|
// SkipImageFSUUID skips retrieving imagefs uuid.
|
||||||
|
// TODO(random-liu): Remove this after we find a generic way to get imagefs uuid.
|
||||||
|
SkipImageFSUUID bool `toml:"skip_imagefs_uuid" json:"skipImageFSUUID,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CRIContainerdOptions contains cri-containerd command line and toml options.
|
// CRIContainerdOptions contains cri-containerd command line and toml options.
|
||||||
@ -158,6 +161,8 @@ func (c *CRIContainerdOptions) AddFlags(fs *pflag.FlagSet) {
|
|||||||
defaults.ProfilingPort, "Profiling port for web interface host:port/debug/pprof/.")
|
defaults.ProfilingPort, "Profiling port for web interface host:port/debug/pprof/.")
|
||||||
fs.StringVar(&c.ProfilingAddress, "profiling-addr",
|
fs.StringVar(&c.ProfilingAddress, "profiling-addr",
|
||||||
defaults.ProfilingAddress, "Profiling address for web interface host:port/debug/pprof/.")
|
defaults.ProfilingAddress, "Profiling address for web interface host:port/debug/pprof/.")
|
||||||
|
fs.BoolVar(&c.SkipImageFSUUID, "skip-imagefs-uuid",
|
||||||
|
defaults.SkipImageFSUUID, "Skip retrieval of imagefs uuid. When turned on, kubelet will not be able to get imagefs capacity or perform imagefs disk eviction.")
|
||||||
}
|
}
|
||||||
|
|
||||||
// InitFlags load configurations from config file, and then overwrite with flags.
|
// InitFlags load configurations from config file, and then overwrite with flags.
|
||||||
@ -228,5 +233,6 @@ func defaultConfig() Config {
|
|||||||
EnableProfiling: true,
|
EnableProfiling: true,
|
||||||
ProfilingPort: "10011",
|
ProfilingPort: "10011",
|
||||||
ProfilingAddress: "127.0.0.1",
|
ProfilingAddress: "127.0.0.1",
|
||||||
|
SkipImageFSUUID: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -134,12 +134,16 @@ func NewCRIContainerdService(config options.Config) (CRIContainerdService, error
|
|||||||
client: client,
|
client: client,
|
||||||
}
|
}
|
||||||
|
|
||||||
imageFSPath := imageFSPath(config.ContainerdConfig.RootDir, config.ContainerdConfig.Snapshotter)
|
if !c.config.SkipImageFSUUID {
|
||||||
c.imageFSUUID, err = c.getDeviceUUID(imageFSPath)
|
imageFSPath := imageFSPath(config.ContainerdConfig.RootDir, config.ContainerdConfig.Snapshotter)
|
||||||
if err != nil {
|
c.imageFSUUID, err = c.getDeviceUUID(imageFSPath)
|
||||||
return nil, fmt.Errorf("failed to get imagefs uuid of %q: %v", imageFSPath, err)
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("failed to get imagefs uuid of %q: %v", imageFSPath, err)
|
||||||
|
}
|
||||||
|
glog.V(2).Infof("Get device uuid %q for image filesystem %q", c.imageFSUUID, imageFSPath)
|
||||||
|
} else {
|
||||||
|
glog.Warning("Skip retrieving imagefs UUID, kubelet will not be able to get imagefs capacity or perform imagefs disk eviction.")
|
||||||
}
|
}
|
||||||
glog.V(2).Infof("Get device uuid %q for image filesystem %q", c.imageFSUUID, imageFSPath)
|
|
||||||
|
|
||||||
c.netPlugin, err = ocicni.InitCNI(config.NetworkPluginConfDir, config.NetworkPluginBinDir)
|
c.netPlugin, err = ocicni.InitCNI(config.NetworkPluginConfDir, config.NetworkPluginBinDir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user