Documentation
¶
Index ¶
- Constants
- Variables
- func CephVersionGreaterOrEqual(currentVersion, requiredVersion *CephVersion) bool
- func Contains(list []string, s string) bool
- func FindDiskName(name string, diskReport *DiskDaemonDisksReport) (string, error)
- func GetCephVersionFromImage(cephImage string) string
- func GetNode(ctx context.Context, kubeClient kubernetes.Interface, nodename string) (*corev1.Node, error)
- func GetNodeList(ctx context.Context, kubeClient kubernetes.Interface, ...) (*corev1.NodeList, error)
- func GetObjectOwnerRef(obj runtime.Object, scheme *runtime.Scheme) ([]metav1.OwnerReference, error)
- func GetStringSha256(s string) string
- func InitLogger(objectField bool) zerolog.Logger
- func IsCephToolboxCLIAvailable(ctx context.Context, kubeClient kubernetes.Interface, namespace string) bool
- func IsClusterMaintenanceActing(ctx context.Context, cephLcmclientset lcmclient.Interface, ...) (bool, error)
- func IsDaemonSetReady(ds *appsv1.DaemonSet) bool
- func IsDeploymentReady(deploy *appsv1.Deployment) bool
- func IsNodeAvailable(node corev1.Node) (bool, string)
- func IsNodeWithDiskDaemon(node corev1.Node, lcmDiskDaemonLabel string) bool
- func IsOpenStackPoolsPresent(pools []cephlcmv1alpha1.CephPool) bool
- func LookupEnvVar(varName string) (string, error)
- func PathDevPrepended(name string) string
- func RestartDeployment(ctx context.Context, log zerolog.Logger, kubeclientset kubernetes.Interface, ...) error
- func RunAndParseCephToolboxCLI(ctx context.Context, kubeClient kubernetes.Interface, config *rest.Config, ...) error
- func RunAndParseDiskDaemonCLI(ctx context.Context, kubeClient kubernetes.Interface, config *rest.Config, ...) error
- func RunCephToolboxCLI(ctx context.Context, kubeClient kubernetes.Interface, config *rest.Config, ...) (string, error)
- func RunFuncWithRetry(times int, interval time.Duration, funcToRun func() (interface{}, error)) (interface{}, error)
- func RunPodCmdAndCheckError(e ExecConfig) (string, string, error)
- func ScaleDeployment(ctx context.Context, kubeClient kubernetes.Interface, ...) error
- func ShowObjectDiff(l zerolog.Logger, oldObject, newObject interface{})
- func SortedMapKeys(m map[string]string) []string
- func VerifyCertificateExpireDate(cacert []byte) error
- type BlockDeviceInfo
- type CSIKeyring
- type CephConnection
- type CephDetails
- type CephVersion
- type ClassStats
- type DiskDaemonDisksReport
- type DiskDaemonOsdsReport
- type DiskDaemonReport
- type DiskDaemonState
- type ExecConfig
- type MgrModuleLs
- type OsdDaemonInfo
- type OsdDevice
- type OsdInfo
- type OsdMetadataInfo
- type OsdPartition
- type OsdTree
- type PoolDetails
- type PoolStats
- type RgwUserKeys
- type ZoneGroupInfo
Constants ¶
View Source
const ( // app names for disk-daemon and toolbox PelagiaToolBox = "pelagia-ceph-toolbox" PelagiaDiskDaemon = "pelagia-disk-daemon" // csi plugin names CephCSIRBDPluginDaemonSetName = "csi-rbdplugin" CephCSICephFSPluginDaemonSetName = "csi-cephfsplugin" // rook related vars RookCephOperatorName = "rook-ceph-operator" RookDiscoverName = "rook-discover" RookCephMonSecretName = "rook-ceph-mon" RookOperatorConfigMapName = "rook-ceph-operator-config" MonMapConfigMapName = "rook-ceph-mon-endpoints" // default data dir host path if not specified in spec DefaultDataDirHostPath = "/var/lib/rook" // lcm related vars RunCephCommandTimeout = 10 // marker for stray osds StrayOsdNodeMarker = "__stray" // marker to detect lvm created by rook, since rook always create vg/lv with // prefix 'osd-' any manual lvm should not start with that prefix RookLVMarker = "osd-" //DeploymentRestartAnnotation indicates timestamp when deployment restart was requested DeploymentRestartAnnotation = "cephdeployment.lcm.mirantis.com/restartedAt" )
View Source
const ( // CephCSIRBDNodeClientName is the name of CSI RBD node client CephCSIRBDNodeClientName = "csi-rbd-node" // CephCSIRBDProvisionerClientName is the name of CSI RBD provisioner client CephCSIRBDProvisionerClientName = "csi-rbd-provisioner" // CephCSICephFSNodeClientName is the name of CSI CephFS node client CephCSICephFSNodeClientName = "csi-cephfs-node" // CephCSICephFSProvisionerClientName is the name of CSI CephFS provisioner client CephCSICephFSProvisionerClientName = "csi-cephfs-provisioner" )
View Source
const LoggerObjectField = "object"
Variables ¶
View Source
var ( // pure pod command run with exec config RunPodCommand = runPodCommand // validate exec config and run pod command RunPodCommandWithValidation = runPodCommandWithValidation )
View Source
var ( Squid = &CephVersion{ Name: "Squid", MajorVersion: "v19.2", Order: 19, SupportedMinors: []string{"3"}, } Reef = &CephVersion{ Name: "Reef", MajorVersion: "v18.2", Order: 18, SupportedMinors: []string{"3", "4", "7"}, } LatestRelease = Squid )
View Source
var AvailableCephVersions = []*CephVersion{Squid, Reef}
View Source
var GenerateSelfSignedCert = generateSelfSignedCert
View Source
var GetCurrentTimeString = getCurrentTimeString
View Source
var GetCurrentUnixTimeString = getCurrentUnixTimeString
View Source
var LookupEnv = os.LookupEnv
Functions ¶
func CephVersionGreaterOrEqual ¶
func CephVersionGreaterOrEqual(currentVersion, requiredVersion *CephVersion) bool
func FindDiskName ¶
func FindDiskName(name string, diskReport *DiskDaemonDisksReport) (string, error)
func GetCephVersionFromImage ¶
func GetNodeList ¶
func GetNodeList(ctx context.Context, kubeClient kubernetes.Interface, listOptions metav1.ListOptions) (*corev1.NodeList, error)
func GetObjectOwnerRef ¶
func GetStringSha256 ¶
func InitLogger ¶
func IsDaemonSetReady ¶
func IsDeploymentReady ¶
func IsDeploymentReady(deploy *appsv1.Deployment) bool
func IsNodeWithDiskDaemon ¶
func IsOpenStackPoolsPresent ¶
func IsOpenStackPoolsPresent(pools []cephlcmv1alpha1.CephPool) bool
func LookupEnvVar ¶
func PathDevPrepended ¶
func RestartDeployment ¶
func RunCephToolboxCLI ¶
func RunFuncWithRetry ¶
func RunPodCmdAndCheckError ¶
func RunPodCmdAndCheckError(e ExecConfig) (string, string, error)
func ScaleDeployment ¶
func ShowObjectDiff ¶
func SortedMapKeys ¶
Types ¶
type BlockDeviceInfo ¶
type BlockDeviceInfo struct {
// pkg kernel device name
Kname string `json:"kname"`
// device serial number
Serial string `json:"serial,omitempty"`
// device type: disk, part, lvm, raid
Type string `json:"type"`
// rotational device
Rotational bool `json:"rota"`
// major:minor device number
MajMin string `json:"maj:min"`
// aliases for block device by-{id,path,uuid}
Symlinks []string `json:"symlinks"`
// pkg parent kernel device name
Parent []string `json:"parent,omitempty"`
// childrens for device
Childrens []string `json:"children,omitempty"`
}
type CSIKeyring ¶
type CephConnection ¶
type CephConnection struct {
ClientName string `json:"client_name"`
ClientKeyring string `json:"client_keyring"`
FSID string `json:"fsid"`
MonEndpoints string `json:"mon_endpoints_map"`
// csi keyring info
RBDKeyring *CSIKeyring `json:"rbd_keyring_info,omitempty"`
CephFSKeyring *CSIKeyring `json:"cephfs_keyring_info,omitempty"`
// rgw admin ops user creds
RgwAdminUserKeys *RgwUserKeys `json:"rgw_admin_keys,omitempty"`
}
type CephDetails ¶
type CephDetails struct {
StatsByClass map[string]ClassStats `json:"stats_by_class"`
Pools []PoolDetails `json:"pools"`
}
type CephVersion ¶
type CephVersion struct {
// ceph release name
Name string
// ceph major version
MajorVersion string
// ceph minor version
MinorVersion string
// major version for simple compare with other versions
Order int
// minor versions supported and available to use
SupportedMinors []string
}
func CheckExpectedCephVersion ¶
func CheckExpectedCephVersion(expectedCephImage, expectedCephRelease string) (*CephVersion, error)
func ParseCephVersion ¶
func ParseCephVersion(version string) (*CephVersion, error)
type ClassStats ¶
type DiskDaemonDisksReport ¶
type DiskDaemonDisksReport struct {
// parsed info from lsblk and udevadm cmds
BlockInfo map[string]BlockDeviceInfo `json:"block_info"`
// aliases map to block device name
Aliases map[string]string `json:"aliases"`
// Map for quick search disk -> osd on it
DiskToOsd map[string][]string `json:"disk_to_osd_map,omitempty"`
}
type DiskDaemonOsdsReport ¶
type DiskDaemonOsdsReport struct {
// warnings faced during osd report prepare
Warnings []string `json:"warnings,omitempty"`
// regular osd devices info
Osds map[string][]OsdDaemonInfo `json:"osds,omitempty"`
}
type DiskDaemonReport ¶
type DiskDaemonReport struct {
// current osd report state
State DiskDaemonState `json:"state"`
// current issues for node
Issues []string `json:"issues,omitempty"`
// current ready disk report
DisksReport *DiskDaemonDisksReport `json:"disks_report,omitempty"`
// current ready osd disk usage report
OsdsReport *DiskDaemonOsdsReport `json:"osds_report,omitempty"`
}
type DiskDaemonState ¶
type DiskDaemonState string
const ( DiskDaemonStateOk DiskDaemonState = "ok" DiskDaemonStateFailed DiskDaemonState = "failed" DiskDaemonStateInProgress DiskDaemonState = "preparing" DiskDaemonStateSkipped DiskDaemonState = "skipped" )
type ExecConfig ¶
type MgrModuleLs ¶
type OsdDaemonInfo ¶
type OsdDaemonInfo struct {
OsdUUID string `json:"osd_uuid,omitempty"`
ClusterFSID string `json:"osd_fsid,omitempty"`
Devices []OsdDevice `json:"osd_device,omitempty"`
Partitions []OsdPartition `json:"osd_partitions,omitempty"`
}
type OsdMetadataInfo ¶
type OsdMetadataInfo struct {
Devices string `json:"devices"`
DevicePathes string `json:"device_paths"`
DeviceIDs string `json:"device_ids"`
Hostname string `json:"hostname"`
BluestoreDevices string `json:"bluestore_bdev_devices"`
BluestoreDeviceType string `json:"bluestore_bdev_type"`
BluestorePartition string `json:"bluestore_bdev_partition_path"`
MetadataDiskUsed string `json:"bluefs_dedicated_db"`
MetadataDevices string `json:"bluefs_db_devices"`
MetadataDeviceType string `json:"bluefs_db_type"`
MetadataPartition string `json:"bluefs_db_partition_path"`
OsdID int `json:"id"`
}
type OsdPartition ¶
type OsdTree ¶
type OsdTree struct {
Nodes []struct {
ID int `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
Children []int `json:"children,omitempty"`
DeviceClass string `json:"device_class"`
Status string `json:"status"`
Weight float64 `json:"crush_weight"`
Reweight int `json:"reweight"`
} `json:"nodes"`
}
type PoolDetails ¶
type RgwUserKeys ¶
type ZoneGroupInfo ¶
type ZoneGroupInfo struct {
Hostnames []string `json:"hostnames"`
}
Click to show internal directories.
Click to hide internal directories.