label

package
v0.0.0-...-12521ac Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// NameLabelKey is Kubernetes recommended label key, it represents the name of the application
	// It should always be redis-cluster in our case.
	NameLabelKey string = "app.kubernetes.io/name"
	// InstanceLabelKey is Kubernetes recommended label key, it represents a unique name identifying the instance of an application
	// It's the cluster name in our case
	InstanceLabelKey string = "app.kubernetes.io/instance"
	// ComponentLabelKey is Kubernetes recommended label key, it represents the component within the architecture
	ComponentLabelKey string = "app.kubernetes.io/component"
	// ManagedByLabelKey is Kubernetes recommended label key, it represents the tool being used to manage the operation of an application
	// For resources managed by Redis Operator, its value is always redis-operator
	ManagedByLabelKey string = "app.kubernetes.io/managed-by"

	// NamespaceLabelKey is label key used in PV for easy querying
	NamespaceLabelKey string = "app.kubernetes.io/namespace"

	// AnnPodNameKey is pod name annotation key used in PV/PVC for synchronizing redis cluster meta info
	AnnPodNameKey string = "anywhy.github.io/pod-name"
	// ClusterGroupIDLabelKey is pod name annotation key used for redis cluster group synchronizing redis cluster meta info
	ClusterGroupIDLabelKey string = "anywhy.github.io/cluster-group-id"
	// ClusterModeLabelKey is redis cluster mode
	ClusterModeLabelKey string = "anywhy.github.io/cluster-mode"
	// ClusterNodeRoleLabelKey is redis node role
	ClusterNodeRoleLabelKey string = "anywhy.github.io/node-role"

	// MasterNodeLabelKey redis master role label key
	MasterNodeLabelKey string = "master"
	// SlaveNodeLabelKey redis slave role label key
	SlaveNodeLabelKey string = "slave"
	// RedisLabelKey redis component label key
	RedisLabelKey string = "redis"
	// SentinelLabelKey redis sentinel  component label key
	SentinelLabelKey string = "sentinel"

	// ReplicaClusterLabelKey means that redis cluster is master/slave
	ReplicaClusterLabelKey string = "replica"
	// RedisClusterLabelKey means redis cluster is shard mode
	RedisClusterLabelKey string = "cluster"
)

Variables

This section is empty.

Functions

func ClusterListOptions

func ClusterListOptions(instanceName string) metav1.ListOptions

ClusterListOptions returns a cluster ListOptions filter

Types

type Label

type Label map[string]string

Label is the label field in metadatas

func New

func New() Label

New init a new Label for redis-opertator

func (Label) ClusterMode

func (l Label) ClusterMode(mode string) Label

ClusterMode add redis mode kv pair to label

func (Label) ClusterModeType

func (l Label) ClusterModeType() string

ClusterModeType return cluster mode

func (Label) Component

func (l Label) Component(name string) Label

Component adds redis component kv pair to label

func (Label) ComponentType

func (l Label) ComponentType() string

ComponentType returns component type

func (Label) GetGroup

func (l Label) GetGroup() string

GetGroup get redis cluster grop id

func (Label) Group

func (l Label) Group(groupID string) Label

Group add redis cluster group id kv pair to label

func (Label) Instance

func (l Label) Instance(name string) Label

Instance adds redis cluster kv pair to label

func (Label) IsMaster

func (l Label) IsMaster() bool

IsMaster label role is master

func (Label) IsSentinel

func (l Label) IsSentinel() bool

IsSentinel label componet is sentinel

func (Label) IsSlave

func (l Label) IsSlave() bool

IsSlave label role is slave

func (Label) LabelSelector

func (l Label) LabelSelector() *metav1.LabelSelector

LabelSelector gets LabelSelector from label

func (Label) Labels

func (l Label) Labels() map[string]string

Labels converts label to map[string]string

func (Label) Master

func (l Label) Master() Label

Master label assigned redis master

func (Label) Namespace

func (l Label) Namespace(name string) Label

Namespace adds namespace kv pair to label

func (Label) Redis

func (l Label) Redis() Label

Redis label assigned redis sentinel

func (Label) RedisClusterMode

func (l Label) RedisClusterMode() Label

RedisClusterMode redis cluster

func (Label) ReplicaMode

func (l Label) ReplicaMode() Label

ReplicaMode replica cluster

func (Label) Selector

func (l Label) Selector() (labels.Selector, error)

Selector gets labels.Selector from label

func (Label) Sentinel

func (l Label) Sentinel() Label

Sentinel label assigned redis sentinel

func (Label) Slave

func (l Label) Slave() Label

Slave label assigned redis slave

Jump to

Keyboard shortcuts

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