clusterdisruption

package
v1.3.9 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2020 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Overview

Package clusterdisruption implements the controller for ensuring that drains occus in a safe manner. The design and purpose for clusterdisruption management is found at: https://github.com/rook/rook/blob/master/design/ceph/ceph-managed-disruptionbudgets.md

Index

Constants

View Source
const (
	// PDBAppName is that app label value for pdbs targeting osds
	PDBAppName = "rook-ceph-osd-pdb"

	// DefaultMaintenanceTimeout is the period for which a drained failure domain will remain in noout
	DefaultMaintenanceTimeout = 30 * time.Minute
)
View Source
const (
	// MonPDBAppName for monitor daemon poddisruptionbudgets
	MonPDBAppName = "rook-ceph-mon-pdb"
)

Variables

This section is empty.

Functions

func Add

func Add(mgr manager.Manager, context *controllerconfig.Context) error

Add adds a new Controller to the Manager based on clusterdisruption.ReconcileClusterDisruption and registers the relevant watches and handlers. Read more about how Managers, Controllers, and their Watches, Handlers, Predicates, etc work here: https://godoc.org/github.com/kubernetes-sigs/controller-runtime/pkg

Types

type ClusterMap

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

ClusterMap maintains the association between namespace and clusername

func (*ClusterMap) GetCluster

func (c *ClusterMap) GetCluster(namespace string) (*cephv1.CephCluster, bool)

GetCluster returns vars cluster, found. cluster is the cephcluster associated with that namespace and found is the boolean indicating whether a cluster was populated for that namespace or not.

func (*ClusterMap) GetClusterMap

func (c *ClusterMap) GetClusterMap() map[string]*cephv1.CephCluster

GetClusterMap returns the internal clustermap for iteration purporses

func (*ClusterMap) GetClusterName

func (c *ClusterMap) GetClusterName(namespace string) (string, bool)

GetClusterName returns vars clusterName, found. clusterName is the cluster name associated with that namespace and found is the boolean indicating whether a cluster was populated for that namespace or not.

func (*ClusterMap) UpdateClusterMap

func (c *ClusterMap) UpdateClusterMap(namespace string, cluster *cephv1.CephCluster)

UpdateClusterMap to populate the clusterName for the namespace

type OSDCrushLocationMap

type OSDCrushLocationMap struct {
	ResyncPeriod time.Duration
	Context      *clusterd.Context
	// contains filtered or unexported fields
}

OSDCrushLocationMap is used to maintain a cache of map of osd id to cephClientCrushhFindResults the crush position of osds wrt to the failureDomain is not expected to change often, so a default Resync period of half an hour is used, but if a use case arises where this is needed, ResyncPeriod should be made smaller.

func (*OSDCrushLocationMap) Get

func (o *OSDCrushLocationMap) Get(clusterNamespace string, id int) (*cephClient.CrushFindResult, error)

Get takes an osd id and returns a CrushFindResult from cache

type OsdData

type OsdData struct {
	Deployment appsv1.Deployment
	CrushMeta  *cephClient.CrushFindResult
}

OsdData stores the deployment and the Crush Data of the osd together

type ReconcileClusterDisruption

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

ReconcileClusterDisruption reconciles ReplicaSets

func (*ReconcileClusterDisruption) Reconcile

Reconcile reconciles a node and ensures that it has a drain-detection deployment attached to it. The Controller will requeue the Request to be processed again if an error is non-nil or Result.Requeue is true, otherwise upon completion it will remove the work from the queue.

Jump to

Keyboard shortcuts

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