v1

package
v0.0.0-...-f651441 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package v1 is the v1 version of the API. +groupName=redisoperator.k8s.io

Index

Constants

View Source
const (
	// ClusterNameLabelKey Label key for the ClusterName
	ClusterNameLabelKey string = "redis-operator.k8s.io/cluster-name"
	// PodSpecMD5LabelKey label key for the PodSpec MD5 hash
	PodSpecMD5LabelKey string = "redis-operator.k8s.io/podspec-md5"
)
View Source
const (
	// ResourcePlural is the id to indentify pluarals
	ResourcePlural = "redisclusters"
	// ResourceSingular represents the id for identify singular resource
	ResourceSingular = "rediscluster"
	// ResourceKind represent the resource kind
	ResourceKind = "RedisCluster"
	// ResourceVersion represent the resource version
	ResourceVersion = "v1"
)

Variables

View Source
var (
	// SchemeBuilder localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
	SchemeBuilder runtime.SchemeBuilder

	// AddToScheme localSchemeBuilder AddToScheme
	AddToScheme = localSchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: redis.GroupName, Version: "v1alpha1"}

SchemeGroupVersion is group version used to register these objects

Functions

func IsRedisClusterDefaulted

func IsRedisClusterDefaulted(rc *RedisCluster) bool

IsRedisClusterDefaulted check if the RedisCluster is already defaulted

func NewInt32

func NewInt32(val int32) *int32

NewInt32 use to instanciate a int32 pointer

func RegisterDeepCopies deprecated

func RegisterDeepCopies(scheme *runtime.Scheme) error

RegisterDeepCopies adds deep-copy functions to the given scheme. Public to allow building arbitrary schemes.

Deprecated: deepcopy registration will go away when static deepcopy is fully implemented.

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type ClusterStatus

type ClusterStatus string

ClusterStatus Redis Cluster status

const (
	// ClusterStatusOK ClusterStatus OK
	ClusterStatusOK ClusterStatus = "OK"
	// ClusterStatusKO ClusterStatus KO
	ClusterStatusKO ClusterStatus = "KO"
	// ClusterStatusScaling ClusterStatus Scaling
	ClusterStatusScaling ClusterStatus = "Scaling"
	// ClusterStatusCalculatingRebalancing ClusterStatus Rebalancing
	ClusterStatusCalculatingRebalancing ClusterStatus = "Calculating Rebalancing"
	// ClusterStatusRebalancing ClusterStatus Rebalancing
	ClusterStatusRebalancing ClusterStatus = "Rebalancing"
	// ClusterStatusRollingUpdate ClusterStatus RollingUpdate
	ClusterStatusRollingUpdate ClusterStatus = "RollingUpdate"
)

type NodesPlacementInfo

type NodesPlacementInfo string

NodesPlacementInfo Redis Nodes placement mode information

const (
	// NodesPlacementInfoBestEffort the cluster nodes placement is in best effort,
	// it means you can have 2 masters (or more) on the same VM.
	NodesPlacementInfoBestEffort NodesPlacementInfo = "BestEffort"
	// NodesPlacementInfoOptimal the cluster nodes placement is optimal,
	// it means on master by VM
	NodesPlacementInfoOptimal NodesPlacementInfo = "Optimal"
)

type RedisCluster

type RedisCluster struct {
	metav1.TypeMeta `json:",inline"`
	// Standard object's metadata.
	// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Spec represents the desired RedisCluster specification
	Spec RedisClusterSpec `json:"spec,omitempty"`

	// Status represents the current RedisCluster status
	Status RedisClusterStatus `json:"status,omitempty"`
}

RedisCluster represents a Redis Cluster +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func DefaultRedisCluster

func DefaultRedisCluster(undefaultRedisCluster *RedisCluster) *RedisCluster

DefaultRedisCluster defaults RedisCluster

func (*RedisCluster) DeepCopy

func (in *RedisCluster) DeepCopy() *RedisCluster

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RedisCluster.

func (*RedisCluster) DeepCopyInto

func (in *RedisCluster) DeepCopyInto(out *RedisCluster)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*RedisCluster) DeepCopyObject

func (in *RedisCluster) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type RedisClusterClusterStatus

type RedisClusterClusterStatus struct {
	Status               ClusterStatus `json:"status"`
	NumberOfMaster       int32         `json:"numberOfMaster,omitempty"`
	MinReplicationFactor int32         `json:"minReplicationFactor,omitempty"`
	MaxReplicationFactor int32         `json:"maxReplicationFactor,omitempty"`

	NodesPlacement NodesPlacementInfo `json:"nodesPlacementInfo,omitempty"`

	// In theory, we always have NbPods > NbRedisRunning > NbPodsReady
	NbPods         int32 `json:"nbPods,omitempty"`
	NbPodsReady    int32 `json:"nbPodsReady,omitempty"`
	NbRedisRunning int32 `json:"nbRedisNodesRunning,omitempty"`

	Nodes []RedisClusterNode `json:"nodes"`
}

RedisClusterClusterStatus represent the Redis Cluster status

func (*RedisClusterClusterStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RedisClusterClusterStatus.

func (*RedisClusterClusterStatus) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (RedisClusterClusterStatus) String

func (s RedisClusterClusterStatus) String() string

type RedisClusterCondition

type RedisClusterCondition struct {
	// Type of workflow condition
	Type RedisClusterConditionType `json:"type"`
	// Status of the condition, one of True, False, Unknown.
	Status kapiv1.ConditionStatus `json:"status"`
	// Last time the condition was checked.
	LastProbeTime metav1.Time `json:"lastProbeTime,omitempty"`
	// Last time the condition transited from one status to another.
	LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
	// (brief) reason for the condition's last transition.
	Reason string `json:"reason,omitempty"`
	// Human readable message indicating details about last transition.
	Message string `json:"message,omitempty"`
}

RedisClusterCondition represent the condition of the RedisCluster

func (*RedisClusterCondition) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RedisClusterCondition.

func (*RedisClusterCondition) DeepCopyInto

func (in *RedisClusterCondition) DeepCopyInto(out *RedisClusterCondition)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RedisClusterConditionType

type RedisClusterConditionType string

RedisClusterConditionType is the type of RedisClusterCondition

const (
	// RedisClusterOK means the RedisCluster is in a good shape
	RedisClusterOK RedisClusterConditionType = "ClusterOK"
	// RedisClusterScaling means the RedisCluster is currenlty in a scaling stage
	RedisClusterScaling RedisClusterConditionType = "Scaling"
	// RedisClusterRebalancing means the RedisCluster is currenlty rebalancing slots and keys
	RedisClusterRebalancing RedisClusterConditionType = "Rebalancing"
	// RedisClusterRollingUpdate means the RedisCluster is currenlty performing a rolling update of its nodes
	RedisClusterRollingUpdate RedisClusterConditionType = "RollingUpdate"
)

type RedisClusterList

type RedisClusterList struct {
	metav1.TypeMeta `json:",inline"`
	// Standard list metadata
	// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
	metav1.ListMeta `json:"metadata,omitempty"`

	// Items is the list of RedisCluster
	Items []RedisCluster `json:"items"`
}

RedisClusterList implements list of RedisCluster. +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*RedisClusterList) DeepCopy

func (in *RedisClusterList) DeepCopy() *RedisClusterList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RedisClusterList.

func (*RedisClusterList) DeepCopyInto

func (in *RedisClusterList) DeepCopyInto(out *RedisClusterList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*RedisClusterList) DeepCopyObject

func (in *RedisClusterList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type RedisClusterNode

type RedisClusterNode struct {
	ID        string               `json:"id"`
	Role      RedisClusterNodeRole `json:"role"`
	IP        string               `json:"ip"`
	Port      string               `json:"port"`
	Slots     []string             `json:"slots,omitempty"`
	MasterRef string               `json:"masterRef,omitempty"`
	PodName   string               `json:"podName"`
	Pod       *kapiv1.Pod          `json:"-"`
}

RedisClusterNode represent a RedisCluster Node

func (*RedisClusterNode) DeepCopy

func (in *RedisClusterNode) DeepCopy() *RedisClusterNode

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RedisClusterNode.

func (*RedisClusterNode) DeepCopyInto

func (in *RedisClusterNode) DeepCopyInto(out *RedisClusterNode)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (RedisClusterNode) String

func (n RedisClusterNode) String() string

type RedisClusterNodeRole

type RedisClusterNodeRole string

RedisClusterNodeRole RedisCluster Node Role type

const (
	// RedisClusterNodeRoleMaster RedisCluster Master node role
	RedisClusterNodeRoleMaster RedisClusterNodeRole = "Master"
	// RedisClusterNodeRoleSlave RedisCluster Master node role
	RedisClusterNodeRoleSlave RedisClusterNodeRole = "Slave"
	// RedisClusterNodeRoleNone None node role
	RedisClusterNodeRoleNone RedisClusterNodeRole = "None"
)

type RedisClusterSpec

type RedisClusterSpec struct {
	NumberOfMaster    *int32 `json:"numberOfMaster,omitempty"`
	ReplicationFactor *int32 `json:"replicationFactor,omitempty"`

	// ServiceName name used to create the Kubernetes Service that reference the Redis Cluster nodes.
	// if ServiceName is empty, the RedisCluster.Name will be use for creating the service.
	ServiceName string `json:"serviceName,omitempty"`

	// PodTemplate contains the pod specificaton that should run the redis-server process
	PodTemplate *kapiv1.PodTemplateSpec `json:"podTemplate,omitempty"`

	// Labels for created redis-cluster (deployment, rs, pod) (if any)
	AdditionalLabels map[string]string `json:"AdditionalLabels,omitempty"`
}

RedisClusterSpec contains RedisCluster specification

func (*RedisClusterSpec) DeepCopy

func (in *RedisClusterSpec) DeepCopy() *RedisClusterSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RedisClusterSpec.

func (*RedisClusterSpec) DeepCopyInto

func (in *RedisClusterSpec) DeepCopyInto(out *RedisClusterSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RedisClusterStatus

type RedisClusterStatus struct {
	// Conditions represent the latest available observations of an object's current state.
	Conditions []RedisClusterCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
	// Status of the condition, one of True, False, Unknown.
	Status kapiv1.ConditionStatus `json:"status"`
	// StartTime represents time when the workflow was acknowledged by the Workflow controller
	// It is not guaranteed to be set in happens-before order across separate operations.
	// It is represented in RFC3339 form and is in UTC.
	// StartTime doesn't consider startime of `ExternalReference`
	StartTime *metav1.Time `json:"startTime,omitempty"`
	// (brief) reason for the condition's last transition.
	Reason string `json:"reason,omitempty"`
	// Human readable message indicating details about last transition.
	Message string `json:"message,omitempty"`
	// Cluster a view of the current RedisCluster
	Cluster RedisClusterClusterStatus
}

RedisClusterStatus contains RedisCluster status

func (*RedisClusterStatus) DeepCopy

func (in *RedisClusterStatus) DeepCopy() *RedisClusterStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RedisClusterStatus.

func (*RedisClusterStatus) DeepCopyInto

func (in *RedisClusterStatus) DeepCopyInto(out *RedisClusterStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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