installer

package
v0.0.0-...-cfb3faf Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OperatorChartName    = "rook-ceph"
	CephClusterChartName = "rook-ceph-cluster"
)
View Source
const (
	BlockPoolName     = "ceph-block-test"
	BlockPoolSCName   = "ceph-block-test-sc"
	FilesystemName    = "ceph-filesystem-test"
	FilesystemSCName  = "ceph-filesystem-test-sc"
	ObjectStoreName   = "ceph-objectstore-test"
	ObjectStoreSCName = "ceph-bucket-test-sc"
)

The Ceph Storage CustomResource and StorageClass names used in testing

View Source
const (
	// LocalBuildTag tag for the latest manifests
	LocalBuildTag = "local-build"

	// test suite names
	CassandraTestSuite = "cassandra"
	CephTestSuite      = "ceph"
	NFSTestSuite       = "nfs"
)
View Source
const (
	// The version from which the upgrade test will start
	Version1_13 = "v1.13.6"
)

Variables

View Source
var (
	QuincyVersion      = cephv1.CephVersionSpec{Image: quincyTestImage}
	QuincyDevelVersion = cephv1.CephVersionSpec{Image: quincyDevelTestImage}
	ReefVersion        = cephv1.CephVersionSpec{Image: reefTestImage}
	ReefDevelVersion   = cephv1.CephVersionSpec{Image: reefDevelTestImage}
	MainVersion        = cephv1.CephVersionSpec{Image: mainTestImage, AllowUnsupported: true}
)

Functions

func CreateHostPathPVs

func CreateHostPathPVs(k8shelper *utils.K8sHelper, count int, readOnly bool, pvcSize string) error

************************************************************************************************ HostPath provisioner functions ************************************************************************************************

func DeleteHostPathPVs

func DeleteHostPathPVs(k8shelper *utils.K8sHelper) error

func GetPVC

func GetPVC(claimName, namespace, storageClassName, accessModes, size string) string

func GetPVCClone

func GetPVCClone(cloneClaimName, parentClaimName, namespace, storageClassName, accessModes, size string) string

func GetPVCRestore

func GetPVCRestore(claimName, snapshotName, namespace, storageClassName, accessModes, size string) string

func GetPodWithVolume

func GetPodWithVolume(podName, claimName, namespace, mountPath string, readOnly bool) string

func GetSnapshot

func GetSnapshot(snapshotName, claimName, snapshotClassName, namespace string) string

func IsAdditionalDeviceAvailableOnCluster

func IsAdditionalDeviceAvailableOnCluster() bool

IsAdditionalDeviceAvailableOnCluster checks whether a given device is available to become an OSD

func ReturnCephVersion

func ReturnCephVersion() cephv1.CephVersionSpec

func StorageClassName

func StorageClassName() string

func SystemNamespace

func SystemNamespace(namespace string) string

func TestLogCollectionLevel

func TestLogCollectionLevel() string

TestLogCollectionLevel gets whether to collect all logs

func TestScratchDevice

func TestScratchDevice() string

TestScratchDevice get the scratch device to be used for OSD

func UsePVC

func UsePVC() bool

Types

type CephInstaller

type CephInstaller struct {
	Manifests CephManifests

	T func() *testing.T
	// contains filtered or unexported fields
}

CephInstaller wraps installing and uninstalling rook on a platform

func NewCephInstaller

func NewCephInstaller(t func() *testing.T, clientset *kubernetes.Clientset, settings *TestCephSettings) *CephInstaller

NewCephInstaller creates new instance of CephInstaller

func (*CephInstaller) CollectOperatorLog

func (h *CephInstaller) CollectOperatorLog(suiteName, testName string)

func (*CephInstaller) ConfirmHelmClusterInstalledCorrectly

func (h *CephInstaller) ConfirmHelmClusterInstalledCorrectly() error

ConfirmHelmClusterInstalledCorrectly runs some validation to check whether the helm chart installed correctly.

func (*CephInstaller) CreateBlockPoolConfiguration

func (h *CephInstaller) CreateBlockPoolConfiguration(values map[string]interface{}, name, scName string) error

CreateBlockPoolConfiguration creates a block store configuration

func (*CephInstaller) CreateCephCluster

func (h *CephInstaller) CreateCephCluster() error

CreateCephCluster creates rook cluster via kubectl

func (*CephInstaller) CreateCephOperator

func (h *CephInstaller) CreateCephOperator() (err error)

CreateCephOperator creates rook-operator via kubectl

func (*CephInstaller) CreateFileSystemConfiguration

func (h *CephInstaller) CreateFileSystemConfiguration(values map[string]interface{}, name, scName string) error

CreateFileSystemConfiguration creates a filesystem configuration

func (*CephInstaller) CreateObjectStoreConfiguration

func (h *CephInstaller) CreateObjectStoreConfiguration(values map[string]interface{}, name, scName string) error

CreateObjectStoreConfiguration creates an object store configuration

func (*CephInstaller) CreateRookCephClusterViaHelm

func (h *CephInstaller) CreateRookCephClusterViaHelm() error

CreateRookCephClusterViaHelm creates rook cluster via Helm

func (*CephInstaller) CreateRookExternalCluster

func (h *CephInstaller) CreateRookExternalCluster(externalManifests CephManifests) error

CreateRookExternalCluster creates rook external cluster via kubectl

func (*CephInstaller) CreateRookOperatorViaHelm

func (h *CephInstaller) CreateRookOperatorViaHelm() error

CreateRookOperatorViaHelm creates rook operator via Helm chart named local/rook present in local repo

func (*CephInstaller) CreateRookToolbox

func (h *CephInstaller) CreateRookToolbox(manifests CephManifests) (err error)

CreateRookToolbox creates rook-ceph-tools via kubectl

func (*CephInstaller) CreateVolumeReplicationCRDs

func (h *CephInstaller) CreateVolumeReplicationCRDs() (err error)

func (*CephInstaller) Execute

func (h *CephInstaller) Execute(command string, parameters []string, namespace string) (error, string)

Execute a command in the ceph toolbox

func (*CephInstaller) GatherAllRookLogs

func (h *CephInstaller) GatherAllRookLogs(testName string, namespaces ...string)

func (*CephInstaller) GetCleanupPod

func (h *CephInstaller) GetCleanupPod(node, removalDir string) string

GetCleanupPod gets a cleanup Pod that cleans up the dataDirHostPath

func (*CephInstaller) GetCleanupVerificationPod

func (h *CephInstaller) GetCleanupVerificationPod(node, hostPathDir string) string

GetCleanupVerificationPod verifies that the dataDirHostPath is empty

func (*CephInstaller) GetNodeHostnames

func (h *CephInstaller) GetNodeHostnames() ([]string, error)

GetNodeHostnames returns the list of nodes in the k8s cluster

func (*CephInstaller) GetRookExternalClusterMonConfigMap

func (h *CephInstaller) GetRookExternalClusterMonConfigMap() (*v1.ConfigMap, error)

GetRookExternalClusterMonConfigMap gets the monitor kubernetes configmap of the external cluster

func (*CephInstaller) GetRookExternalClusterMonSecret

func (h *CephInstaller) GetRookExternalClusterMonSecret() (*v1.Secret, error)

GetRookExternalClusterMonSecret gets the monitor kubernetes secret of the external cluster

func (*CephInstaller) InstallRook

func (h *CephInstaller) InstallRook() (bool, error)

func (*CephInstaller) UninstallRook

func (h *CephInstaller) UninstallRook()

UninstallRook uninstalls rook from k8s

func (*CephInstaller) UninstallRookFromMultipleNS

func (h *CephInstaller) UninstallRookFromMultipleNS(manifests ...CephManifests)

UninstallRookFromMultipleNS uninstalls rook from multiple namespaces in k8s

func (*CephInstaller) UpgradeRookCephClusterViaHelm

func (h *CephInstaller) UpgradeRookCephClusterViaHelm() error

func (*CephInstaller) UpgradeRookOperatorViaHelm

func (h *CephInstaller) UpgradeRookOperatorViaHelm() error

func (*CephInstaller) WaitForToolbox

func (h *CephInstaller) WaitForToolbox(namespace string) error

type CephManifests

type CephManifests interface {
	Settings() *TestCephSettings
	GetCRDs(k8shelper *utils.K8sHelper) string
	GetCSINFSRBAC() string
	GetOperator() string
	GetCommon() string
	GetCommonExternal() string
	GetCephCluster() string
	GetExternalCephCluster() string
	GetToolbox() string
	GetBlockPool(poolName, replicaSize string) string
	GetBlockStorageClass(poolName, storageClassName, reclaimPolicy string) string
	GetFileStorageClass(fsName, storageClassName string) string
	GetNFSStorageClass(fsName, nfsClusterName, server, storageClassName string) string
	GetNFSSnapshotClass(fsName, snapshotClassName string) string
	GetBlockSnapshotClass(snapshotClassName, reclaimPolicy string) string
	GetFileStorageSnapshotClass(snapshotClassName, reclaimPolicy string) string
	GetFilesystem(name string, activeCount int) string
	GetNFS(name string, daemonCount int) string
	GetNFSPool() string
	GetRBDMirror(name string, daemonCount int) string
	GetObjectStore(name string, replicaCount, port int, tlsEnable bool) string
	GetObjectStoreUser(name, displayName, store, usercaps, maxsize string, maxbuckets, maxobjects int) string
	GetBucketStorageClass(storeName, storageClassName, reclaimPolicy string) string
	GetOBC(obcName, storageClassName, bucketName string, maxObject string, createBucket bool) string
	GetOBCNotification(obcName, storageClassName, bucketName string, notificationName string, createBucket bool) string
	GetBucketNotification(notificationName string, topicName string) string
	GetBucketTopic(topicName string, storeName string, httpEndpointService string) string
	GetClient(name string, caps map[string]string) string
	GetFilesystemSubvolumeGroup(fsName, groupName string) string
	GetCOSIDriver() string
	GetBucketClass(name, objectstoreUserName, deletionPolicy string) string
	GetBucketClaim(claimName, className string) string
}

func NewCephManifests

func NewCephManifests(settings *TestCephSettings) CephManifests

NewCephManifests gets the manifest type depending on the Rook version desired

type CephManifestsMaster

type CephManifestsMaster struct {
	// contains filtered or unexported fields
}

CephManifestsMaster wraps rook yaml definitions

func (*CephManifestsMaster) GetBlockPool

func (m *CephManifestsMaster) GetBlockPool(poolName string, replicaSize string) string

func (*CephManifestsMaster) GetBlockSnapshotClass

func (m *CephManifestsMaster) GetBlockSnapshotClass(snapshotClassName, reclaimPolicy string) string

func (*CephManifestsMaster) GetBlockStorageClass

func (m *CephManifestsMaster) GetBlockStorageClass(poolName, storageClassName, reclaimPolicy string) string

func (*CephManifestsMaster) GetBucketClaim

func (m *CephManifestsMaster) GetBucketClaim(name, bucketClassName string) string

func (*CephManifestsMaster) GetBucketClass

func (m *CephManifestsMaster) GetBucketClass(name, objectStoreUserSecretName, deletionPolicy string) string

func (*CephManifestsMaster) GetBucketNotification

func (m *CephManifestsMaster) GetBucketNotification(notificationName string, topicName string) string

GetBucketNotification returns the manifest to create ceph bucket notification

func (*CephManifestsMaster) GetBucketStorageClass

func (m *CephManifestsMaster) GetBucketStorageClass(storeName, storageClassName, reclaimPolicy string) string

GetBucketStorageClass returns the manifest to create object bucket

func (*CephManifestsMaster) GetBucketTopic

func (m *CephManifestsMaster) GetBucketTopic(topicName string, storeName string, httpEndpointService string) string

GetBucketTopic returns the manifest to create ceph bucket topic

func (*CephManifestsMaster) GetCOSIDriver

func (m *CephManifestsMaster) GetCOSIDriver() string

func (*CephManifestsMaster) GetCRDs

func (m *CephManifestsMaster) GetCRDs(k8shelper *utils.K8sHelper) string

func (*CephManifestsMaster) GetCSINFSRBAC

func (m *CephManifestsMaster) GetCSINFSRBAC() string

func (*CephManifestsMaster) GetCephCluster

func (m *CephManifestsMaster) GetCephCluster() string

func (*CephManifestsMaster) GetClient

func (m *CephManifestsMaster) GetClient(claimName string, caps map[string]string) string

func (*CephManifestsMaster) GetCommon

func (m *CephManifestsMaster) GetCommon() string

func (*CephManifestsMaster) GetCommonExternal

func (m *CephManifestsMaster) GetCommonExternal() string

func (*CephManifestsMaster) GetExternalCephCluster

func (m *CephManifestsMaster) GetExternalCephCluster() string

func (*CephManifestsMaster) GetFileStorageClass

func (m *CephManifestsMaster) GetFileStorageClass(fsName, storageClassName string) string

func (*CephManifestsMaster) GetFileStorageSnapshotClass

func (m *CephManifestsMaster) GetFileStorageSnapshotClass(snapshotClassName, reclaimPolicy string) string

func (*CephManifestsMaster) GetFilesystem

func (m *CephManifestsMaster) GetFilesystem(name string, activeCount int) string

GetFilesystem returns the manifest to create a Rook filesystem resource with the given config.

func (*CephManifestsMaster) GetFilesystemSubvolumeGroup

func (m *CephManifestsMaster) GetFilesystemSubvolumeGroup(fsName, groupName string) string

func (*CephManifestsMaster) GetNFS

func (m *CephManifestsMaster) GetNFS(name string, count int) string

GetFilesystem returns the manifest to create a Rook Ceph NFS resource with the given config.

func (*CephManifestsMaster) GetNFSPool

func (m *CephManifestsMaster) GetNFSPool() string

GetFilesystem returns the manifest to create a Rook Ceph NFS resource with the given config.

func (*CephManifestsMaster) GetNFSSnapshotClass

func (m *CephManifestsMaster) GetNFSSnapshotClass(snapshotClassName, reclaimPolicy string) string

func (*CephManifestsMaster) GetNFSStorageClass

func (m *CephManifestsMaster) GetNFSStorageClass(fsName, nfsClusterName, server, storageClassName string) string

func (*CephManifestsMaster) GetOBC

func (m *CephManifestsMaster) GetOBC(claimName string, storageClassName string, objectBucketName string, maxObject string, varBucketName bool) string

GetOBC returns the manifest to create object bucket claim

func (*CephManifestsMaster) GetOBCNotification

func (m *CephManifestsMaster) GetOBCNotification(claimName string, storageClassName string, objectBucketName string, notificationName string, varBucketName bool) string

GetOBCNotification returns the manifest to create object bucket claim

func (*CephManifestsMaster) GetObjectStore

func (m *CephManifestsMaster) GetObjectStore(name string, replicaCount, port int, tlsEnable bool) string

func (*CephManifestsMaster) GetObjectStoreUser

func (m *CephManifestsMaster) GetObjectStoreUser(name, displayName, store, usercaps, maxsize string, maxbuckets, maxobjects int) string

func (*CephManifestsMaster) GetOperator

func (m *CephManifestsMaster) GetOperator() string

func (*CephManifestsMaster) GetRBDMirror

func (m *CephManifestsMaster) GetRBDMirror(name string, count int) string

GetRBDMirror returns the manifest to create a Rook Ceph RBD Mirror resource with the given config.

func (*CephManifestsMaster) GetToolbox

func (m *CephManifestsMaster) GetToolbox() string

func (*CephManifestsMaster) Settings

func (m *CephManifestsMaster) Settings() *TestCephSettings

type CephManifestsPreviousVersion

type CephManifestsPreviousVersion struct {
	// contains filtered or unexported fields
}

CephManifestsPreviousVersion wraps rook yaml definitions

func (*CephManifestsPreviousVersion) GetBlockPool

func (m *CephManifestsPreviousVersion) GetBlockPool(poolName, replicaSize string) string

func (*CephManifestsPreviousVersion) GetBlockSnapshotClass

func (m *CephManifestsPreviousVersion) GetBlockSnapshotClass(snapshotClassName, reclaimPolicy string) string

func (*CephManifestsPreviousVersion) GetBlockStorageClass

func (m *CephManifestsPreviousVersion) GetBlockStorageClass(poolName, storageClassName, reclaimPolicy string) string

func (*CephManifestsPreviousVersion) GetBucketClaim

func (m *CephManifestsPreviousVersion) GetBucketClaim(name, bucketClassName string) string

func (*CephManifestsPreviousVersion) GetBucketClass

func (m *CephManifestsPreviousVersion) GetBucketClass(name, objectStoreUserSecretName, deletionPolicy string) string

func (*CephManifestsPreviousVersion) GetBucketNotification

func (m *CephManifestsPreviousVersion) GetBucketNotification(notificationName, topicName string) string

GetBucketNotification returns the manifest to create ceph bucket notification

func (*CephManifestsPreviousVersion) GetBucketStorageClass

func (m *CephManifestsPreviousVersion) GetBucketStorageClass(storeName, storageClassName, reclaimPolicy string) string

GetBucketStorageClass returns the manifest to create object bucket

func (*CephManifestsPreviousVersion) GetBucketTopic

func (m *CephManifestsPreviousVersion) GetBucketTopic(topicName, storeName, httpEndpointService string) string

GetBucketTopic returns the manifest to create ceph bucket topic

func (*CephManifestsPreviousVersion) GetCOSIDriver

func (m *CephManifestsPreviousVersion) GetCOSIDriver() string

func (*CephManifestsPreviousVersion) GetCRDs

func (m *CephManifestsPreviousVersion) GetCRDs(k8shelper *utils.K8sHelper) string

func (*CephManifestsPreviousVersion) GetCSINFSRBAC

func (m *CephManifestsPreviousVersion) GetCSINFSRBAC() string

func (*CephManifestsPreviousVersion) GetCephCluster

func (m *CephManifestsPreviousVersion) GetCephCluster() string

GetRookCluster returns rook-cluster manifest

func (*CephManifestsPreviousVersion) GetClient

func (m *CephManifestsPreviousVersion) GetClient(claimName string, caps map[string]string) string

func (*CephManifestsPreviousVersion) GetCommon

func (m *CephManifestsPreviousVersion) GetCommon() string

GetCommon returns rook-cluster manifest

func (*CephManifestsPreviousVersion) GetCommonExternal

func (m *CephManifestsPreviousVersion) GetCommonExternal() string

func (*CephManifestsPreviousVersion) GetExternalCephCluster

func (m *CephManifestsPreviousVersion) GetExternalCephCluster() string

func (*CephManifestsPreviousVersion) GetFileStorageClass

func (m *CephManifestsPreviousVersion) GetFileStorageClass(fsName, storageClassName string) string

func (*CephManifestsPreviousVersion) GetFileStorageSnapshotClass

func (m *CephManifestsPreviousVersion) GetFileStorageSnapshotClass(snapshotClassName, reclaimPolicy string) string

func (*CephManifestsPreviousVersion) GetFilesystem

func (m *CephManifestsPreviousVersion) GetFilesystem(name string, activeCount int) string

GetFilesystem returns the manifest to create a Rook filesystem resource with the given config.

func (*CephManifestsPreviousVersion) GetFilesystemSubvolumeGroup

func (m *CephManifestsPreviousVersion) GetFilesystemSubvolumeGroup(fsName, groupName string) string

func (*CephManifestsPreviousVersion) GetNFS

func (m *CephManifestsPreviousVersion) GetNFS(name string, count int) string

GetNFS returns the manifest to create a Rook Ceph NFS resource with the given config.

func (*CephManifestsPreviousVersion) GetNFSPool

func (m *CephManifestsPreviousVersion) GetNFSPool() string

func (*CephManifestsPreviousVersion) GetNFSSnapshotClass

func (m *CephManifestsPreviousVersion) GetNFSSnapshotClass(fsName, snapshotClassName string) string

func (*CephManifestsPreviousVersion) GetNFSStorageClass

func (m *CephManifestsPreviousVersion) GetNFSStorageClass(fsName, nfsClusterName, server, storageClassName string) string

func (*CephManifestsPreviousVersion) GetOBC

func (m *CephManifestsPreviousVersion) GetOBC(claimName, storageClassName, objectBucketName, maxObject string, varBucketName bool) string

GetOBC returns the manifest to create object bucket claim

func (*CephManifestsPreviousVersion) GetOBCNotification

func (m *CephManifestsPreviousVersion) GetOBCNotification(claimName, storageClassName, objectBucketName, notificationName string, varBucketName bool) string

GetOBCNotification returns the manifest to create object bucket claim

func (*CephManifestsPreviousVersion) GetObjectStore

func (m *CephManifestsPreviousVersion) GetObjectStore(name string, replicaCount, port int, tlsEnable bool) string

func (*CephManifestsPreviousVersion) GetObjectStoreUser

func (m *CephManifestsPreviousVersion) GetObjectStoreUser(name, displayName, store, usercaps, maxsize string, maxbuckets, maxobjects int) string

func (*CephManifestsPreviousVersion) GetOperator

func (m *CephManifestsPreviousVersion) GetOperator() string

GetRookOperator returns rook Operator manifest

func (*CephManifestsPreviousVersion) GetRBDMirror

func (m *CephManifestsPreviousVersion) GetRBDMirror(name string, count int) string

GetRBDMirror returns the manifest to create a Rook Ceph RBD Mirror resource with the given config.

func (*CephManifestsPreviousVersion) GetToolbox

func (m *CephManifestsPreviousVersion) GetToolbox() string

GetRookToolBox returns rook-toolbox manifest

func (*CephManifestsPreviousVersion) Settings

type TestCephSettings

type TestCephSettings struct {
	DataDirHostPath             string
	ClusterName                 string
	Namespace                   string
	OperatorNamespace           string
	StorageClassName            string
	UseHelm                     bool
	RetainHelmDefaultStorageCRs bool
	UsePVC                      bool
	Mons                        int
	UseCrashPruner              bool
	MultipleMgrs                bool
	SkipOSDCreation             bool
	EnableDiscovery             bool
	IsExternal                  bool
	SkipClusterCleanup          bool
	SkipCleanupPolicy           bool
	DirectMountToolbox          bool
	ConnectionsEncrypted        bool
	ConnectionsCompressed       bool
	RequireMsgr2                bool
	EnableVolumeReplication     bool
	TestNFSCSI                  bool
	ChangeHostName              bool
	RookVersion                 string
	CephVersion                 cephv1.CephVersionSpec
	KubernetesVersion           string
}

TestCephSettings struct for handling panic and test suite tear down

func (*TestCephSettings) ApplyEnvVars

func (s *TestCephSettings) ApplyEnvVars()

Jump to

Keyboard shortcuts

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