v1alpha1

package
v0.0.0-...-0227cab Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the redis.kun v1alpha1 API group +kubebuilder:object:generate=true +groupName=redis.kun

Index

Constants

View Source
const (
	// Dumplicate with clusterbuilder
	PrometheusExporterPort          = 9100
	PrometheusExporterTelemetryPath = "/metrics"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "redis.kun", Version: "v1alpha1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

This section is empty.

Types

type AffinityPolicy

type AffinityPolicy string

AffinityPolicy

const (
	// SoftAntiAffinity the master and slave will be scheduled on different node if possible
	SoftAntiAffinity AffinityPolicy = "SoftAntiAffinity"
	// AntiAffinityInSharding the master and slave must be scheduled on different node
	AntiAffinityInSharding AffinityPolicy = "AntiAffinityInSharding"
	// AntiAffinity all redis pods must be scheduled on different node
	AntiAffinity AffinityPolicy = "AntiAffinity"
)

type BackupSourceSpec

type BackupSourceSpec struct {
	Namespace string `json:"namespace"`
	Name      string `json:"name"`
	// Arguments to the restore job
	Args []string `json:"args,omitempty"`
}

func (*BackupSourceSpec) DeepCopy

func (in *BackupSourceSpec) DeepCopy() *BackupSourceSpec

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

func (*BackupSourceSpec) DeepCopyInto

func (in *BackupSourceSpec) DeepCopyInto(out *BackupSourceSpec)

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

type CheckerPolicy

type CheckerPolicy struct {
	PfailNodeCnt int  `json:"pfailNodeCnt,omitempty"`
	Retry        int  `json:"retry,omitempty"`
	Enable       bool `json:"enable,omitempty"`
}

func (*CheckerPolicy) DeepCopy

func (in *CheckerPolicy) DeepCopy() *CheckerPolicy

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

func (*CheckerPolicy) DeepCopyInto

func (in *CheckerPolicy) DeepCopyInto(out *CheckerPolicy)

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

type ClusterServiceStatus

type ClusterServiceStatus string

ClusterServiceStatus

const (
	ClusterInService    ClusterServiceStatus = "InService"
	ClusterOutOfService ClusterServiceStatus = "OutOfService"
)

type ClusterShardConfig

type ClusterShardConfig struct {
	// Slots is the slot range for the shard, eg: 0-1000,1002,1005-1100
	//+kubebuilder:validation:Pattern:=`^(\d{1,5}|(\d{1,5}-\d{1,5}))(,(\d{1,5}|(\d{1,5}-\d{1,5})))*$`
	Slots string `json:"slots,omitempty"`
}

func (*ClusterShardConfig) DeepCopy

func (in *ClusterShardConfig) DeepCopy() *ClusterShardConfig

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

func (*ClusterShardConfig) DeepCopyInto

func (in *ClusterShardConfig) DeepCopyInto(out *ClusterShardConfig)

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

type ClusterShards

type ClusterShards struct {
	// ID match the shard-id in redis 7.0
	Id string `json:"id,omitempty"`
	// Index the shard index
	Index int32 `json:"index"`
	// Slots records the slots status of this shard
	Slots []*ClusterShardsSlotStatus `json:"slots"`
}

ClusterShards

func (*ClusterShards) DeepCopy

func (in *ClusterShards) DeepCopy() *ClusterShards

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

func (*ClusterShards) DeepCopyInto

func (in *ClusterShards) DeepCopyInto(out *ClusterShards)

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

type ClusterShardsSlotStatus

type ClusterShardsSlotStatus struct {
	// Slots slots this shard holds or will holds
	Slots string `json:"slots,omitempty"`
	// Status the status of this status
	Status string `json:"status,omitempty"`
	// ShardIndex indicates the slots importing from or migrate to
	ShardIndex *int32 `json:"shardId"`
}

ClusterShardsSlotStatus

func (*ClusterShardsSlotStatus) DeepCopy

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

func (*ClusterShardsSlotStatus) DeepCopyInto

func (in *ClusterShardsSlotStatus) DeepCopyInto(out *ClusterShardsSlotStatus)

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

type ClusterStatus

type ClusterStatus string

ClusterStatus Redis Cluster status

const (
	// ClusterStatusOK ClusterStatus OK
	ClusterStatusOK ClusterStatus = "Healthy"
	// ClusterStatusKO ClusterStatus KO
	ClusterStatusKO ClusterStatus = "Failed"
	// ClusterStatusCreating ClusterStatus Creating
	ClusterStatusCreating = "Creating"
	// ClusterStatusRollingUpdate ClusterStatus RollingUpdate
	ClusterStatusRollingUpdate ClusterStatus = "RollingUpdate"
	// ClusterStatusRebalancing ClusterStatus rebalancing
	ClusterStatusRebalancing ClusterStatus = "Rebalancing"
	// clusterStatusPaused cluster status paused
	ClusterStatusPaused ClusterStatus = "Paused"
)

type DcOption

type DcOption struct {
	InitRole      redis.RedisRole `json:"initRole,omitempty"`
	InitADDRESS   []RedisAddress  `json:"initAddress,omitempty"`
	HealPolicy    HealPolicy      `json:"healPolicy,omitempty"`
	CheckerPolicy CheckerPolicy   `json:"checkerPolicy,omitempty"`
}

DC settings

func (*DcOption) DeepCopy

func (in *DcOption) DeepCopy() *DcOption

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

func (*DcOption) DeepCopyInto

func (in *DcOption) DeepCopyInto(out *DcOption)

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

type DistributedRedisCluster

type DistributedRedisCluster struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   DistributedRedisClusterSpec   `json:"spec,omitempty"`
	Status DistributedRedisClusterStatus `json:"status,omitempty"`
}

DistributedRedisCluster is the Schema for the distributedredisclusters API

func (*DistributedRedisCluster) DeepCopy

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

func (*DistributedRedisCluster) DeepCopyInto

func (in *DistributedRedisCluster) DeepCopyInto(out *DistributedRedisCluster)

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

func (*DistributedRedisCluster) DeepCopyObject

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

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

func (*DistributedRedisCluster) Init

func (ins *DistributedRedisCluster) Init() error

type DistributedRedisClusterList

type DistributedRedisClusterList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []DistributedRedisCluster `json:"items"`
}

DistributedRedisClusterList contains a list of DistributedRedisCluster

func (*DistributedRedisClusterList) DeepCopy

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

func (*DistributedRedisClusterList) DeepCopyInto

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

func (*DistributedRedisClusterList) DeepCopyObject

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

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

type DistributedRedisClusterSpec

type DistributedRedisClusterSpec struct {
	// Image is the Redis image to run.
	Image string `json:"image,omitempty"`
	// ImagePullPolicy is the pull policy for the Redis image.
	// +kubebuilder:validation:Enum=Always;Never;IfNotPresent
	ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
	// ImagePullSecrets is the list of pull secrets for the Redis image.
	ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
	// Command is the Redis image command.
	Command []string `json:"command,omitempty"`
	// Env inject envs to redis pods.
	Env []corev1.EnvVar `json:"env,omitempty"`
	// MasterSize is the number of shards
	MasterSize int32 `json:"masterSize,omitempty"`
	// ClusterReplicas is the number of replicas for each shard
	ClusterReplicas int32 `json:"clusterReplicas,omitempty"`
	// ServiceName is the name of the statefulset
	ServiceName string `json:"serviceName,omitempty"`

	// Use this map to setup redis service. Most of the settings is key-value format.
	//
	// For client-output-buffer-limit and rename, the values is split by group.
	Config map[string]string `json:"config,omitempty"`
	// This field specifies the assignment of cluster shard slots.
	// this config is only works for new create instance, update will not take effect after instance is startup
	Shards []ClusterShardConfig `json:"shards,omitempty"`

	// AffinityPolicy
	// +kubebuilder:validation:Enum=SoftAntiAffinity;AntiAffinityInSharding;AntiAffinity
	AffinityPolicy AffinityPolicy `json:"affinityPolicy,omitempty"`

	// Affinity
	// +kubebuilder:deprecated:warning="This version is deprecated in favor of AffinityPolicy"
	Affinity *corev1.Affinity `json:"affinity,omitempty"`
	// NodeSelector
	NodeSelector map[string]string `json:"nodeSelector,omitempty"`
	// Tolerations
	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

	// SecurityContext for redis pods
	SecurityContext *corev1.PodSecurityContext `json:"securityContext,omitempty"`
	// ContainerSecurityContext for redis container
	ContainerSecurityContext *corev1.SecurityContext `json:"containerSecurityContext,omitempty"`
	// Annotations annotations inject to redis pods
	Annotations map[string]string `json:"annotations,omitempty"`
	// Storage storage config for redis pods
	Storage *RedisStorage `json:"storage,omitempty"`
	// StorageType storage type for redis pods
	Resources *corev1.ResourceRequirements `json:"resources,omitempty"`
	// PasswordSecret password secret for redis pods
	PasswordSecret *corev1.LocalObjectReference `json:"passwordSecret,omitempty"`

	// Monitor
	Monitor *Monitor `json:"monitor,omitempty"`
	// ServiceMonitor
	ServiceMonitor redisfailoverv1alpha1.RedisServiceMonitorSpec `json:"serviceMonitor,omitempty"`

	// Set backup schedule
	Backup redisfailoverv1alpha1.RedisBackup `json:"backup,omitempty"`
	// Restore restore redis data from backup
	Restore redisfailoverv1alpha1.RedisRestore `json:"restore,omitempty"`
	// EnableTLS enable TLS for redis
	EnableTLS bool `json:"enableTLS,omitempty"`
	// Expose config for service access
	Expose redisfailoverv1alpha1.RedisExpose `json:"expose,omitempty"`
	// IPFamilyPrefer the prefered IP family, enum: IPv4, IPv6
	IPFamilyPrefer corev1.IPFamily `json:"ipFamilyPrefer,omitempty"`
}

DistributedRedisClusterSpec defines the desired state of DistributedRedisCluster

func (*DistributedRedisClusterSpec) DeepCopy

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

func (*DistributedRedisClusterSpec) DeepCopyInto

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

type DistributedRedisClusterStatus

type DistributedRedisClusterStatus struct {
	// Status the status of the cluster
	Status ClusterStatus `json:"status"`
	// Reason the reason of the status
	Reason string `json:"reason,omitempty"`
	// NumberOfMaster the number of master nodes
	NumberOfMaster int32 `json:"numberOfMaster,omitempty"`
	// MinReplicationFactor the min replication factor
	MinReplicationFactor int32 `json:"minReplicationFactor,omitempty"`
	// MaxReplicationFactor the max replication factor
	MaxReplicationFactor int32 `json:"maxReplicationFactor,omitempty"`
	// NodesPlacement the nodes placement mode
	NodesPlacement NodesPlacementInfo `json:"nodesPlacementInfo,omitempty"`
	// Nodes the redis cluster nodes
	Nodes []RedisClusterNode `json:"nodes,omitempty"`
	// ClusterStatus the cluster status
	ClusterStatus ClusterServiceStatus `json:"clusterStatus,omitempty"`
	// Shards the shards status
	Shards []*ClusterShards `json:"shards,omitempty"`
}

DistributedRedisClusterStatus defines the observed state of DistributedRedisCluster

func (*DistributedRedisClusterStatus) DeepCopy

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

func (*DistributedRedisClusterStatus) DeepCopyInto

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

type HealPolicy

type HealPolicy string
const (
	None              HealPolicy = "none"
	Normal            HealPolicy = "normal"
	Force             HealPolicy = "force"
	TakeOver          HealPolicy = "takeover"
	TakeOverAndForget HealPolicy = "takeoverAndForget"
)

type Monitor

type Monitor struct {
	// Image monitor image
	Image string `json:"image,omitempty"`

	// Arguments to the entrypoint.
	// The docker image's CMD is used if this is not provided.
	// Variable references $(VAR_NAME) are expanded using the container's environment. If a variable
	// cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax
	// can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded,
	// regardless of whether the variable exists or not.
	// Cannot be updated.
	// More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell
	// +optional
	Args []string `json:"args,omitempty"`
	// List of environment variables to set in the container.
	// Cannot be updated.
	// +optional
	// +patchMergeKey=name
	// +patchStrategy=merge
	Env []corev1.EnvVar `json:"env,omitempty" patchStrategy:"merge" patchMergeKey:"name"`
	// Compute Resources required by exporter container.
	// Cannot be updated.
	// More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/
	// +optional
	Resources *corev1.ResourceRequirements `json:"resources,omitempty"`
	// Security options the pod should run with.
	// More info: https://kubernetes.io/docs/concepts/policy/security-context/
	// More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
	// +optional
	SecurityContext *corev1.SecurityContext `json:"securityContext,omitempty"`
}

Monitor

func (*Monitor) DeepCopy

func (in *Monitor) DeepCopy() *Monitor

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

func (*Monitor) DeepCopyInto

func (in *Monitor) DeepCopyInto(out *Monitor)

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

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 RedisAddress

type RedisAddress struct {
	IP      string `json:"Ip,omitempty"`
	Port    string `json:"Port,omitempty"`
	BusPort string `json:"busPort,omitempty"`
}

func (*RedisAddress) DeepCopy

func (in *RedisAddress) DeepCopy() *RedisAddress

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

func (*RedisAddress) DeepCopyInto

func (in *RedisAddress) DeepCopyInto(out *RedisAddress)

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

type RedisBackup

type RedisBackup struct {
	Image    string     `json:"image,omitempty"`
	Schedule []Schedule `json:"schedule,omitempty"`
}

RedisBackup defines the structure used to backup the Redis Data

func (*RedisBackup) DeepCopy

func (in *RedisBackup) DeepCopy() *RedisBackup

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

func (*RedisBackup) DeepCopyInto

func (in *RedisBackup) DeepCopyInto(out *RedisBackup)

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

type RedisBackupStorage

type RedisBackupStorage struct {
	StorageClassName string            `json:"storageClassName,omitempty"`
	Size             resource.Quantity `json:"size,omitempty"`
}

func (*RedisBackupStorage) DeepCopy

func (in *RedisBackupStorage) DeepCopy() *RedisBackupStorage

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

func (*RedisBackupStorage) DeepCopyInto

func (in *RedisBackupStorage) DeepCopyInto(out *RedisBackupStorage)

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

type RedisClusterNode

type RedisClusterNode struct {
	// ID id of redis-server
	ID string `json:"id"`
	// Role redis-server role
	Role redis.RedisRole `json:"role"`
	// IP current pod ip
	IP string `json:"ip"`
	// Port current pod port
	Port string `json:"port"`
	// Slots this master node holds
	Slots []string `json:"slots,omitempty"`
	// MasterRef referred to the master node
	MasterRef string `json:"masterRef,omitempty"`
	// PodName pod name
	PodName string `json:"podName"`
	// NodeName node name the pod hosted
	NodeName string `json:"nodeName"`
	// StatefulSet the statefulset current pod belongs
	StatefulSet string `json:"statefulSet"`
}

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.

type RedisRestore

type RedisRestore struct {
	Image           string            `json:"image,omitempty"`
	ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
	BackupName      string            `json:"backupName,omitempty"`
}

RedisRestore defines the structure used to restore the Redis Data

func (*RedisRestore) DeepCopy

func (in *RedisRestore) DeepCopy() *RedisRestore

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

func (*RedisRestore) DeepCopyInto

func (in *RedisRestore) DeepCopyInto(out *RedisRestore)

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

type RedisStorage

type RedisStorage struct {
	Size        resource.Quantity `json:"size"`
	Type        StorageType       `json:"type,omitempty"`
	Class       string            `json:"class"`
	DeleteClaim bool              `json:"deleteClaim,omitempty"`
}

RedisStorage defines the structure used to store the Redis Data

func (*RedisStorage) DeepCopy

func (in *RedisStorage) DeepCopy() *RedisStorage

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

func (*RedisStorage) DeepCopyInto

func (in *RedisStorage) DeepCopyInto(out *RedisStorage)

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

type Schedule

type Schedule struct {
	Name              string                        `json:"name,omitempty"`
	Schedule          string                        `json:"schedule"`
	Keep              int32                         `json:"keep"`
	KeepAfterDeletion bool                          `json:"keepAfterDeletion,omitempty"`
	Storage           RedisBackupStorage            `json:"storage"`
	Target            databasesv1.RedisBackupTarget `json:"target,omitempty"`
}

func (*Schedule) DeepCopy

func (in *Schedule) DeepCopy() *Schedule

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

func (*Schedule) DeepCopyInto

func (in *Schedule) DeepCopyInto(out *Schedule)

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

type StorageType

type StorageType string

StorageType

const (
	PersistentClaim StorageType = "persistent-claim"
	Ephemeral       StorageType = "ephemeral"
)

Jump to

Keyboard shortcuts

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