v1beta2

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package v1beta2 contains API Schema definitions for the redis v1beta2 API group +kubebuilder:object:generate=true +groupName=redis.redis.opstreelabs.in

Index

Constants

View Source
const (
	InitializingClusterLeaderReason   string = "RedisCluster is initializing leaders"
	InitializingClusterFollowerReason string = "RedisCluster is initializing followers"
	BootstrapClusterReason            string = "RedisCluster is bootstrapping"
	ReadyClusterReason                string = "RedisCluster is ready"
)

Variables

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

	// 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 ClusterStorage

type ClusterStorage struct {
	// +kubebuilder:default=false
	NodeConfVolume              bool                         `json:"nodeConfVolume,omitempty"`
	NodeConfVolumeClaimTemplate corev1.PersistentVolumeClaim `json:"nodeConfVolumeClaimTemplate,omitempty"`
	common.Storage              `json:",inline"`
}

Node-conf needs to be added only in redis cluster

func (*ClusterStorage) DeepCopy

func (in *ClusterStorage) DeepCopy() *ClusterStorage

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

func (*ClusterStorage) DeepCopyInto

func (in *ClusterStorage) DeepCopyInto(out *ClusterStorage)

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

type RedisCluster

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

	Spec   RedisClusterSpec   `json:"spec"`
	Status RedisClusterStatus `json:"status,omitempty"`
}

RedisCluster is the Schema for the redisclusters API

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.

func (*RedisCluster) Hub

func (*RedisCluster) Hub()

Hub marks this type as a conversion hub.

func (*RedisCluster) SetDefault

func (r *RedisCluster) SetDefault()

SetDefault sets default values for the RedisCluster object.

func (*RedisCluster) SetupWebhookWithManager

func (r *RedisCluster) SetupWebhookWithManager(mgr ctrl.Manager) error

type RedisClusterList

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

RedisClusterList contains a list of RedisCluster

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 RedisClusterSpec

type RedisClusterSpec struct {
	Size             *int32                  `json:"clusterSize"`
	KubernetesConfig common.KubernetesConfig `json:"kubernetesConfig"`
	HostNetwork      bool                    `json:"hostNetwork,omitempty"`
	// +kubebuilder:default:=6379
	Port *int `json:"port,omitempty"`
	// +kubebuilder:default:=v7
	ClusterVersion     *string                      `json:"clusterVersion,omitempty"`
	RedisConfig        *common.RedisConfig          `json:"redisConfig,omitempty"`
	RedisLeader        RedisLeader                  `json:"redisLeader,omitempty"`
	RedisFollower      RedisFollower                `json:"redisFollower,omitempty"`
	RedisExporter      *common.RedisExporter        `json:"redisExporter,omitempty"`
	Storage            *ClusterStorage              `json:"storage,omitempty"`
	PodSecurityContext *corev1.PodSecurityContext   `json:"podSecurityContext,omitempty"`
	PriorityClassName  string                       `json:"priorityClassName,omitempty"`
	Resources          *corev1.ResourceRequirements `json:"resources,omitempty"`
	TLS                *common.TLSConfig            `json:"TLS,omitempty"`
	ACL                *common.ACLConfig            `json:"acl,omitempty"`
	InitContainer      *common.InitContainer        `json:"initContainer,omitempty"`
	Sidecars           *[]common.Sidecar            `json:"sidecars,omitempty"`
	ServiceAccountName *string                      `json:"serviceAccountName,omitempty"`
	PersistenceEnabled *bool                        `json:"persistenceEnabled,omitempty"`
	EnvVars            *[]corev1.EnvVar             `json:"env,omitempty"`
	HostPort           *int                         `json:"hostPort,omitempty"`
}

RedisClusterSpec defines the desired state of RedisCluster

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.

func (*RedisClusterSpec) GetRedisDynamicConfig

func (cr *RedisClusterSpec) GetRedisDynamicConfig() []string

GetRedisDynamicConfig returns Redis dynamic configuration parameters. Priority: top-level config > leader config > follower config

func (*RedisClusterSpec) GetRedisFollowerResources

func (cr *RedisClusterSpec) GetRedisFollowerResources() *corev1.ResourceRequirements

GetRedisFollowerResources returns the resources for the redis follower, if not set, it will return the default resources

func (*RedisClusterSpec) GetRedisLeaderResources

func (cr *RedisClusterSpec) GetRedisLeaderResources() *corev1.ResourceRequirements

GetRedisLeaderResources returns the resources for the redis leader, if not set, it will return the default resources

func (*RedisClusterSpec) GetReplicaCounts

func (cr *RedisClusterSpec) GetReplicaCounts(t string) int32

type RedisClusterState

type RedisClusterState string
const (
	RedisClusterInitializing RedisClusterState = "Initializing"
	RedisClusterBootstrap    RedisClusterState = "Bootstrap"
	// RedisClusterReady means the RedisCluster is ready for use, we use redis-cli --cluster check 127.0.0.1:6379 to check the cluster status
	RedisClusterReady  RedisClusterState = "Ready"
	RedisClusterFailed RedisClusterState = "Failed"
)

Status Field of the Redis Cluster

type RedisClusterStatus

type RedisClusterStatus struct {
	State  RedisClusterState `json:"state,omitempty"`
	Reason string            `json:"reason,omitempty"`
	// +kubebuilder:default=0
	ReadyLeaderReplicas int32 `json:"readyLeaderReplicas,omitempty"`
	// +kubebuilder:default=0
	ReadyFollowerReplicas int32 `json:"readyFollowerReplicas,omitempty"`
}

RedisClusterStatus defines the observed state of RedisCluster +kubebuilder:subresource: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.

type RedisFollower

type RedisFollower struct {
	common.RedisFollower          `json:",inline"`
	SecurityContext               *corev1.SecurityContext      `json:"securityContext,omitempty"`
	TerminationGracePeriodSeconds *int64                       `json:"terminationGracePeriodSeconds,omitempty" protobuf:"varint,4,opt,name=terminationGracePeriodSeconds"`
	Resources                     *corev1.ResourceRequirements `json:"resources,omitempty"`
}

RedisFollower interface will have the redis follower configuration

func (*RedisFollower) DeepCopy

func (in *RedisFollower) DeepCopy() *RedisFollower

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

func (*RedisFollower) DeepCopyInto

func (in *RedisFollower) DeepCopyInto(out *RedisFollower)

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

type RedisLeader

type RedisLeader struct {
	common.RedisLeader            `json:",inline"`
	SecurityContext               *corev1.SecurityContext      `json:"securityContext,omitempty"`
	TerminationGracePeriodSeconds *int64                       `json:"terminationGracePeriodSeconds,omitempty" protobuf:"varint,4,opt,name=terminationGracePeriodSeconds"`
	Resources                     *corev1.ResourceRequirements `json:"resources,omitempty"`
}

RedisLeader interface will have the redis leader configuration

func (*RedisLeader) DeepCopy

func (in *RedisLeader) DeepCopy() *RedisLeader

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

func (*RedisLeader) DeepCopyInto

func (in *RedisLeader) DeepCopyInto(out *RedisLeader)

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