Documentation ¶
Overview ¶
Package mon provides methods for creating clusters of Ceph mons in Kubernetes, for monitoring the cluster's status, for taking corrective actions if the status is non-ideal, and for reporting mon cluster failures.
Index ¶
- Constants
- Variables
- func CephSecretVolume() v1.Volume
- func CephSecretVolumeMount() v1.VolumeMount
- func CephUsernameEnvVar() v1.EnvVar
- func EndpointEnvVar() v1.EnvVar
- func GetFailureDomainLabel(spec cephv1.ClusterSpec) string
- func PodNamespaceEnvVar(namespace string) v1.EnvVar
- func PredicateMonEndpointChanges() predicate.Funcs
- func UpdateCephDeploymentAndWait(context *clusterd.Context, clusterInfo *client.ClusterInfo, ...) error
- func WriteConnectionConfig(context *clusterd.Context, clusterInfo *cephclient.ClusterInfo) error
- type Cluster
- type HealthChecker
- type SchedulingResult
Constants ¶
const ( //#nosec G101 -- This is only a path name CephSecretMountPath = "/var/lib/rook-ceph-mon" //#nosec G101 -- This is only a filename CephSecretFilename = "secret.keyring" )
const ( // EndpointConfigMapName is the name of the configmap with mon endpoints EndpointConfigMapName = "rook-ceph-mon-endpoints" // EndpointDataKey is the name of the key inside the mon configmap to get the endpoints EndpointDataKey = "data" // AppName is the name of the secret storing cluster mon.admin key, fsid and name AppName = "rook-ceph-mon" //nolint:gosec // OperatorCreds is the name of the secret OperatorCreds = "rook-ceph-operator-creds" // DefaultMonCount Default mon count for a cluster DefaultMonCount = 3 // MaxMonCount Maximum allowed mon count for a cluster MaxMonCount = 9 // DefaultMsgr1Port is the default port Ceph mons use to communicate amongst themselves prior // to Ceph Nautilus. DefaultMsgr1Port int32 = 6789 // DefaultMsgr2Port is the listening port of the messenger v2 protocol introduced in Ceph // Nautilus. In Nautilus and a few Ceph releases after, Ceph can use both v1 and v2 protocols. DefaultMsgr2Port int32 = 3300 DisasterProtectionFinalizerName = cephv1.CustomResourceGroup + "/disaster-protection" )
Variables ¶
var ( // HealthCheckInterval is the interval to check if the mons are in quorum HealthCheckInterval = 45 * time.Second // MonOutTimeout is the duration to wait before removing/failover to a new mon pod MonOutTimeout = 10 * time.Minute )
Functions ¶
func CephSecretVolume ¶
CephSecretVolume is a volume for the ceph admin secret
func CephSecretVolumeMount ¶
func CephSecretVolumeMount() v1.VolumeMount
CephSecretVolumeMount is a mount for the ceph admin secret
func CephUsernameEnvVar ¶
CephUsernameEnvVar is the ceph username environment var
func EndpointEnvVar ¶
EndpointEnvVar is the mon endpoint environment var
func GetFailureDomainLabel ¶
func GetFailureDomainLabel(spec cephv1.ClusterSpec) string
func PodNamespaceEnvVar ¶
PodNamespaceEnvVar is the cluster namespace environment var
func UpdateCephDeploymentAndWait ¶
func UpdateCephDeploymentAndWait(context *clusterd.Context, clusterInfo *client.ClusterInfo, deployment *apps.Deployment, daemonType, daemonName string, skipUpgradeChecks, continueUpgradeAfterChecksEvenIfNotHealthy bool) error
UpdateCephDeploymentAndWait verifies a deployment can be stopped or continued
func WriteConnectionConfig ¶
func WriteConnectionConfig(context *clusterd.Context, clusterInfo *cephclient.ClusterInfo) error
WriteConnectionConfig save monitor connection config to disk
Types ¶
type Cluster ¶
type Cluster struct { ClusterInfo *cephclient.ClusterInfo Namespace string Keyring string Port int32 // contains filtered or unexported fields }
Cluster represents the Rook and environment configuration settings needed to set up Ceph mons.
func New ¶
func New(ctx context.Context, clusterdContext *clusterd.Context, namespace string, spec cephv1.ClusterSpec, ownerInfo *k8sutil.OwnerInfo) *Cluster
New creates an instance of a mon cluster
func (*Cluster) ConfigureArbiter ¶
func (*Cluster) Start ¶
func (c *Cluster) Start(clusterInfo *cephclient.ClusterInfo, rookImage string, cephVersion cephver.CephVersion, spec cephv1.ClusterSpec) (*cephclient.ClusterInfo, error)
Start begins the process of running a cluster of Ceph mons.
type HealthChecker ¶
type HealthChecker struct {
// contains filtered or unexported fields
}
HealthChecker aggregates the mon/cluster info needed to check the health of the monitors
func NewHealthChecker ¶
func NewHealthChecker(monCluster *Cluster) *HealthChecker
NewHealthChecker creates a new HealthChecker object
func (*HealthChecker) Check ¶
func (hc *HealthChecker) Check(monitoringRoutines map[string]*controller.ClusterHealth, daemon string)
Check periodically checks the health of the monitors
type SchedulingResult ¶
type SchedulingResult struct { Node *v1.Node CanaryDeployment *apps.Deployment CanaryPVC string }