mon

package
v0.0.0-...-1ea1cc7 Latest Latest
Warning

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

Go to latest
Published: May 15, 2019 License: Apache-2.0 Imports: 30 Imported by: 0

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

View Source
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"
	// MaxMonIDKey is the name of the max mon id used
	MaxMonIDKey = "maxMonId"
	// MappingKey is the name of the mapping for the mon->node and node->port
	MappingKey = "mapping"

	// DefaultMonCount Default mon count for a cluster
	DefaultMonCount = 3
	// MaxMonCount Maximum allowed mon count for a cluster
	MaxMonCount = 9
)

Variables

View Source
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 = 300 * time.Second
)

Functions

func AdminSecretEnvVar

func AdminSecretEnvVar() v1.EnvVar

AdminSecretEnvVar is the admin secret environment var

func ClusterNameEnvVar

func ClusterNameEnvVar(name string) v1.EnvVar

ClusterNameEnvVar is the cluster name environment var

func EndpointEnvVar

func EndpointEnvVar() v1.EnvVar

EndpointEnvVar is the mon endpoint environment var

func SecretEnvVar

func SecretEnvVar() v1.EnvVar

SecretEnvVar is the mon secret environment var

Types

type Cluster

type Cluster struct {
	Namespace string
	Keyring   string

	Count                int
	AllowMultiplePerNode bool
	MonCountMutex        sync.Mutex
	Port                 int32

	HostNetwork bool
	// contains filtered or unexported fields
}

Cluster represents the Rook and environment configuration settings needed to set up Ceph mons.

func New

func New(context *clusterd.Context, namespace, dataDirHostPath, rookVersion string, cephVersion cephv1.CephVersionSpec, mon cephv1.MonSpec,
	placement rookalpha.Placement, hostNetwork bool, resources v1.ResourceRequirements, ownerRef metav1.OwnerReference) *Cluster

New creates an instance of a mon cluster

func (*Cluster) Start

func (c *Cluster) Start() 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(stopCh chan struct{})

Check periodically checks the health of the monitors

type Mapping

type Mapping struct {
	Node map[string]*NodeInfo `json:"node"`
	Port map[string]int32     `json:"port"`
}

Mapping is mon node and port mapping

func CreateOrLoadClusterInfo

func CreateOrLoadClusterInfo(context *clusterd.Context, namespace string, ownerRef *metav1.OwnerReference) (*cephconfig.ClusterInfo, int, *Mapping, error)

CreateOrLoadClusterInfo constructs or loads a clusterinfo and returns it along with the maxMonID

func LoadClusterInfo

func LoadClusterInfo(context *clusterd.Context, namespace string) (*cephconfig.ClusterInfo, int, *Mapping, error)

LoadClusterInfo constructs or loads a clusterinfo and returns it along with the maxMonID

type NodeInfo

type NodeInfo struct {
	Name     string
	Hostname string
	Address  string
}

NodeInfo contains name and address of a node

Jump to

Keyboard shortcuts

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