mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-17 07:39:22 +00:00
kubelet: expose node.status.runtimeClasses
For KEP-3857: Recursive Read-only (RRO) mounts Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This commit is contained in:
parent
8db07446f1
commit
dd0882a83e
@ -741,6 +741,7 @@ func (kl *Kubelet) defaultNodeStatusFuncs() []func(context.Context, *v1.Node) er
|
|||||||
nodestatus.DaemonEndpoints(kl.daemonEndpoints),
|
nodestatus.DaemonEndpoints(kl.daemonEndpoints),
|
||||||
nodestatus.Images(kl.nodeStatusMaxImages, kl.imageManager.GetImageList),
|
nodestatus.Images(kl.nodeStatusMaxImages, kl.imageManager.GetImageList),
|
||||||
nodestatus.GoRuntime(),
|
nodestatus.GoRuntime(),
|
||||||
|
nodestatus.RuntimeClasses(kl.runtimeState.runtimeHandlers),
|
||||||
)
|
)
|
||||||
// Volume limits
|
// Volume limits
|
||||||
setters = append(setters, nodestatus.VolumeLimits(kl.volumePluginMgr.ListVolumePluginWithLimits))
|
setters = append(setters, nodestatus.VolumeLimits(kl.volumePluginMgr.ListVolumePluginWithLimits))
|
||||||
|
@ -480,6 +480,26 @@ func GoRuntime() Setter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RuntimeClasses returns a Setter that sets RuntimeClasses on the node.
|
||||||
|
func RuntimeClasses(fn func() []kubecontainer.RuntimeHandler) Setter {
|
||||||
|
return func(ctx context.Context, node *v1.Node) error {
|
||||||
|
if !utilfeature.DefaultFeatureGate.Enabled(features.RecursiveReadOnlyMounts) {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
handlers := fn()
|
||||||
|
node.Status.RuntimeClasses = make([]v1.NodeRuntimeClass, len(handlers))
|
||||||
|
for i, h := range handlers {
|
||||||
|
node.Status.RuntimeClasses[i] = v1.NodeRuntimeClass{
|
||||||
|
Name: h.Name,
|
||||||
|
Features: &v1.NodeRuntimeClassFeatures{
|
||||||
|
RecursiveReadOnlyMounts: &h.SupportsRecursiveReadOnlyMounts,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ReadyCondition returns a Setter that updates the v1.NodeReady condition on the node.
|
// ReadyCondition returns a Setter that updates the v1.NodeReady condition on the node.
|
||||||
func ReadyCondition(
|
func ReadyCondition(
|
||||||
nowFunc func() time.Time, // typically Kubelet.clock.Now
|
nowFunc func() time.Time, // typically Kubelet.clock.Now
|
||||||
|
Loading…
Reference in New Issue
Block a user