mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-14 13:45:06 +00:00
Adding volume metrics support for vSphere Cloud Provider
This commit is contained in:
@@ -52,6 +52,10 @@ const (
|
|||||||
vsphereVolumePluginName = "kubernetes.io/vsphere-volume"
|
vsphereVolumePluginName = "kubernetes.io/vsphere-volume"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func getPath(uid types.UID, volName string, host volume.VolumeHost) string {
|
||||||
|
return host.GetPodVolumeDir(uid, utilstrings.EscapeQualifiedNameForDisk(vsphereVolumePluginName), volName)
|
||||||
|
}
|
||||||
|
|
||||||
// vSphere Volume Plugin
|
// vSphere Volume Plugin
|
||||||
func (plugin *vsphereVolumePlugin) Init(host volume.VolumeHost) error {
|
func (plugin *vsphereVolumePlugin) Init(host volume.VolumeHost) error {
|
||||||
plugin.host = host
|
plugin.host = host
|
||||||
@@ -113,6 +117,7 @@ func (plugin *vsphereVolumePlugin) newMounterInternal(spec *volume.Spec, podUID
|
|||||||
manager: manager,
|
manager: manager,
|
||||||
mounter: mounter,
|
mounter: mounter,
|
||||||
plugin: plugin,
|
plugin: plugin,
|
||||||
|
MetricsProvider: volume.NewMetricsStatFS(getPath(podUID, spec.Name(), plugin.host)),
|
||||||
},
|
},
|
||||||
fsType: fsType,
|
fsType: fsType,
|
||||||
diskMounter: volumehelper.NewSafeFormatAndMountFromHost(plugin.GetPluginName(), plugin.host)}, nil
|
diskMounter: volumehelper.NewSafeFormatAndMountFromHost(plugin.GetPluginName(), plugin.host)}, nil
|
||||||
@@ -126,6 +131,7 @@ func (plugin *vsphereVolumePlugin) newUnmounterInternal(volName string, podUID t
|
|||||||
manager: manager,
|
manager: manager,
|
||||||
mounter: mounter,
|
mounter: mounter,
|
||||||
plugin: plugin,
|
plugin: plugin,
|
||||||
|
MetricsProvider: volume.NewMetricsStatFS(getPath(podUID, volName, plugin.host)),
|
||||||
}}, nil
|
}}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -174,7 +180,7 @@ type vsphereVolume struct {
|
|||||||
// diskMounter provides the interface that is used to mount the actual block device.
|
// diskMounter provides the interface that is used to mount the actual block device.
|
||||||
diskMounter mount.Interface
|
diskMounter mount.Interface
|
||||||
plugin *vsphereVolumePlugin
|
plugin *vsphereVolumePlugin
|
||||||
volume.MetricsNil
|
volume.MetricsProvider
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ volume.Mounter = &vsphereVolumeMounter{}
|
var _ volume.Mounter = &vsphereVolumeMounter{}
|
||||||
|
Reference in New Issue
Block a user