resource

package
v0.0.0-...-7a7d364 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VGManagerUnit = "vg-manager"
)

Variables

View Source
var (
	CSIPluginVolName = "csi-plugin-dir"
	CSIPluginVol     = corev1.Volume{
		Name: CSIPluginVolName,
		VolumeSource: corev1.VolumeSource{
			HostPath: &corev1.HostPathVolumeSource{
				Path: fmt.Sprintf("%splugins/kubernetes.io/csi", GetAbsoluteKubeletPath(constants.CSIKubeletRootDir)),
				Type: &HostPathDirectoryOrCreate}},
	}
	CSIPluginVolMount = corev1.VolumeMount{
		Name:             CSIPluginVolName,
		MountPath:        fmt.Sprintf("%splugins/kubernetes.io/csi", GetAbsoluteKubeletPath(constants.CSIKubeletRootDir)),
		MountPropagation: &mountPropagationBidirectional,
	}
)
View Source
var (
	NodePluginVolName = "node-plugin-dir"
	NodePluginVol     = corev1.Volume{
		Name: NodePluginVolName,
		VolumeSource: corev1.VolumeSource{
			HostPath: &corev1.HostPathVolumeSource{
				Path: fmt.Sprintf("%splugins/topolvm.io/node", GetAbsoluteKubeletPath(constants.CSIKubeletRootDir)),
				Type: &HostPathDirectoryOrCreate}},
	}
	NodePluginVolMount = corev1.VolumeMount{
		Name: NodePluginVolName, MountPath: filepath.Dir(constants.DefaultCSISocket),
	}
)
View Source
var (
	RegistrationVolName = "registration-dir"
	RegistrationVol     = corev1.Volume{
		Name: RegistrationVolName,
		VolumeSource: corev1.VolumeSource{
			HostPath: &corev1.HostPathVolumeSource{
				Path: fmt.Sprintf("%splugins_registry/", GetAbsoluteKubeletPath(constants.CSIKubeletRootDir)),
				Type: &HostPathDirectoryOrCreate}},
	}
	RegistrationVolMount = corev1.VolumeMount{
		Name: RegistrationVolName, MountPath: constants.DefaultPluginRegistrationPath,
	}
)
View Source
var (
	PodVolName = "pod-volumes-dir"
	PodVol     = corev1.Volume{
		Name: PodVolName,
		VolumeSource: corev1.VolumeSource{
			HostPath: &corev1.HostPathVolumeSource{
				Path: fmt.Sprintf("%spods/", GetAbsoluteKubeletPath(constants.CSIKubeletRootDir)),
				Type: &HostPathDirectoryOrCreate}},
	}
	PodVolMount = corev1.VolumeMount{
		Name:             PodVolName,
		MountPath:        fmt.Sprintf("%spods", GetAbsoluteKubeletPath(constants.CSIKubeletRootDir)),
		MountPropagation: &mountPropagationBidirectional,
	}
)
View Source
var (
	LVMDConfMapVolName = "lvmd-config"
	LVMDConfMapVol     = corev1.Volume{
		Name: LVMDConfMapVolName,
		VolumeSource: corev1.VolumeSource{
			HostPath: &corev1.HostPathVolumeSource{
				Path: filepath.Dir(lvmd.DefaultFileConfigPath),
				Type: &HostPathDirectoryOrCreate},
		},
	}
	LVMDConfMapVolMount = corev1.VolumeMount{
		Name:             LVMDConfMapVolName,
		MountPath:        filepath.Dir(lvmd.DefaultFileConfigPath),
		MountPropagation: &hostContainerPropagation,
	}
)
View Source
var (
	DevDirVolName = "device-dir"
	// DevHostDirVol  is the corev1.Volume definition for the "/dev" bind mount used to
	// list block devices.
	// DevMount is the corresponding mount
	DevHostDirVol = corev1.Volume{
		Name: DevDirVolName,
		VolumeSource: corev1.VolumeSource{
			HostPath: &corev1.HostPathVolumeSource{
				Path: devDirPath,
				Type: &directoryHostPath,
			},
		},
	}

	// DevHostDirVolMount is the corresponding mount for DevHostDirVol
	DevHostDirVolMount = corev1.VolumeMount{
		Name:             DevDirVolName,
		MountPath:        devDirPath,
		MountPropagation: &hostContainerPropagation,
	}
)
View Source
var (
	UdevVolName = "run-udev"
	// UDevHostDirVol is the corev1.Volume definition for the
	// "/run/udev" host bind-mount. This helps lsblk give more accurate output.
	// UDevMount is the corresponding mount
	UDevHostDirVol = corev1.Volume{
		Name: UdevVolName,
		VolumeSource: corev1.VolumeSource{
			HostPath: &corev1.HostPathVolumeSource{Path: udevPath},
		},
	}
	// UDevHostDirVolMount is the corresponding mount for UDevHostDirVol
	UDevHostDirVolMount = corev1.VolumeMount{
		Name:             UdevVolName,
		MountPath:        udevPath,
		MountPropagation: &hostContainerPropagation,
	}
)
View Source
var (
	SysVolName = "sys"
	// SysHostDirVol is the corev1.Volume definition for the
	// "/sys" host bind-mount. This helps discover information about blockd devices
	SysHostDirVol = corev1.Volume{
		Name: SysVolName,
		VolumeSource: corev1.VolumeSource{
			HostPath: &corev1.HostPathVolumeSource{Path: sysPath},
		},
	}

	// SysHostDirVolMount is the corresponding mount for SysHostDirVol
	SysHostDirVolMount = corev1.VolumeMount{
		Name:             SysVolName,
		MountPath:        sysPath,
		MountPropagation: &hostContainerPropagation,
	}
)
View Source
var (
	MetricsCertsVolName = "metrics-cert"
	// MetricsCertsDirVol is the corev1.Volume definition for the
	// certs to be used in metrics endpoint.
	MetricsCertsDirVol = corev1.Volume{
		Name: MetricsCertsVolName,
		VolumeSource: corev1.VolumeSource{
			Secret: &corev1.SecretVolumeSource{
				SecretName:  "vg-manager-metrics-cert",
				DefaultMode: ptr.To[int32](420),
			},
		},
	}
	// MetricsCertsDirVolMount is the corresponding mount for MetricsCertsDirVol
	MetricsCertsDirVolMount = corev1.VolumeMount{
		Name:      MetricsCertsVolName,
		MountPath: metricsCertsDirPath,
		ReadOnly:  true,
	}
)
View Source
var (
	HostPathDirectoryOrCreate = corev1.HostPathDirectoryOrCreate
)

Functions

func GetAbsoluteKubeletPath

func GetAbsoluteKubeletPath(name string) string

func GetStorageClassName

func GetStorageClassName(deviceName string) string

func GetVolumeSnapshotClassName

func GetVolumeSnapshotClassName(deviceName string) string

Types

type Manager

type Manager interface {

	// GetName should return a camelCase name of this unit of reconciliation
	GetName() string

	// EnsureCreated should check the resources managed by this unit
	EnsureCreated(Reconciler, context.Context, *lvmv1alpha1.LVMCluster) error

	// EnsureDeleted should wait for the resources to be cleaned up
	EnsureDeleted(Reconciler, context.Context, *lvmv1alpha1.LVMCluster) error
}

Manager NOTE: when updating this, please also update docs/design/lvm-operator-manager.md

func CSIDriver

func CSIDriver() Manager

func LVMVGs

func LVMVGs() Manager

func OpenShiftSCCs

func OpenShiftSCCs() Manager

func TopoLVMStorageClass

func TopoLVMStorageClass() Manager

func TopoLVMVolumeSnapshotClass

func TopoLVMVolumeSnapshotClass() Manager

func VGManager

func VGManager() Manager

type Reconciler

type Reconciler interface {
	client.Client

	GetNamespace() string
	GetImageName() string
	SnapshotsEnabled() bool
	GetVGManagerCommand() []string

	// GetTopoLVMLeaderElectionPassthrough uses the given leaderElection when initializing TopoLVM to synchronize
	// leader election configuration
	GetTopoLVMLeaderElectionPassthrough() configv1.LeaderElection

	// GetLogPassthroughOptions passes log information for resource managers to consume
	GetLogPassthroughOptions() *logpassthrough.Options
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL