Documentation ¶
Index ¶
- type CPUAndMem
- type Condition
- type ConditionType
- type Phase
- type RedisFailover
- type RedisFailoverResources
- type RedisFailoverSpec
- type RedisFailoverStatus
- type RedisOperator
- func (ro *RedisOperator) Convert(sg *apistructs.ServiceGroup) interface{}
- func (ro *RedisOperator) Create(k8syml interface{}) error
- func (ro *RedisOperator) Inspect(sg *apistructs.ServiceGroup) (*apistructs.ServiceGroup, error)
- func (ro *RedisOperator) IsSupported() bool
- func (ro *RedisOperator) Remove(sg *apistructs.ServiceGroup) error
- func (ro *RedisOperator) Update(k8syml interface{}) error
- func (ro *RedisOperator) Validate(sg *apistructs.ServiceGroup) error
- type RedisSettings
- type RedisStorage
- type SentinelSettings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Condition ¶
type Condition struct { Type ConditionType `json:"type"` Reason string `json:"reason"` TransitionTime string `json:"transitionTime"` }
Condition saves the state information of the redisfailover
type ConditionType ¶
type ConditionType string
ConditionType defines the condition that the RF can have
type RedisFailover ¶
type RedisFailover struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec RedisFailoverSpec `json:"spec"` Status RedisFailoverStatus `json:"status,omitempty"` }
type RedisFailoverResources ¶
type RedisFailoverResources struct { Requests CPUAndMem `json:"requests,omitempty"` Limits CPUAndMem `json:"limits,omitempty"` }
RedisFailoverResources sets the limits and requests for a container
type RedisFailoverSpec ¶
type RedisFailoverSpec struct { // Redis defines its failover settings Redis RedisSettings `json:"redis,omitempty"` // Sentinel defines its failover settings Sentinel SentinelSettings `json:"sentinel,omitempty"` // HardAntiAffinity defines if the PodAntiAffinity on the deployments and // statefulsets has to be hard (it's soft by default) HardAntiAffinity bool `json:"hardAntiAffinity,omitempty"` // NodeAffinity defines the rules for scheduling the Redis and Sentinel // nodes NodeAffinity *corev1.NodeAffinity `json:"nodeAffinity,omitempty"` // SecurityContext defines which user and group the Sentinel and Redis containers run as SecurityContext *corev1.PodSecurityContext `json:"securityContext,omitempty"` //Tolerations provides a way to schedule Pods on Tainted Nodes Tolerations []corev1.Toleration `json:"tolerations,omitempty"` }
RedisFailoverSpec represents a Redis failover spec
type RedisFailoverStatus ¶
type RedisFailoverStatus struct { Phase Phase `json:"phase"` Conditions []Condition `json:"conditions"` Master string `json:"master"` }
RedisFailoverStatus has the status of the cluster
type RedisOperator ¶
type RedisOperator struct {
// contains filtered or unexported fields
}
func New ¶
func New(k8sutil addon.K8SUtil, deploy addon.DeploymentUtil, sts addon.StatefulsetUtil, service addon.ServiceUtil, ns addon.NamespaceUtil, overcommit addon.OvercommitUtil, client *httpclient.HTTPClient) *RedisOperator
func (*RedisOperator) Convert ¶
func (ro *RedisOperator) Convert(sg *apistructs.ServiceGroup) interface{}
func (*RedisOperator) Create ¶
func (ro *RedisOperator) Create(k8syml interface{}) error
func (*RedisOperator) Inspect ¶
func (ro *RedisOperator) Inspect(sg *apistructs.ServiceGroup) (*apistructs.ServiceGroup, error)
func (*RedisOperator) IsSupported ¶
func (ro *RedisOperator) IsSupported() bool
func (*RedisOperator) Remove ¶
func (ro *RedisOperator) Remove(sg *apistructs.ServiceGroup) error
func (*RedisOperator) Update ¶
func (ro *RedisOperator) Update(k8syml interface{}) error
func (*RedisOperator) Validate ¶
func (ro *RedisOperator) Validate(sg *apistructs.ServiceGroup) error
Validate
type RedisSettings ¶
type RedisSettings struct { Envs map[string]string `json:"envs,omitempty"` Replicas int32 `json:"replicas,omitempty"` Resources RedisFailoverResources `json:"resources,omitempty"` Exporter bool `json:"exporter,omitempty"` ExporterImage string `json:"exporterImage,omitempty"` ExporterVersion string `json:"exporterVersion,omitempty"` DisableExporterProbes bool `json:"disableExporterProbes,omitempty"` Image string `json:"image,omitempty"` Version string `json:"version,omitempty"` CustomConfig []string `json:"customConfig,omitempty"` Command []string `json:"command,omitempty"` ShutdownConfigMap string `json:"shutdownConfigMap,omitempty"` Storage RedisStorage `json:"storage,omitempty"` }
RedisSettings defines the specification of the redis cluster
type RedisStorage ¶
type RedisStorage struct { KeepAfterDeletion bool `json:"keepAfterDeletion,omitempty"` EmptyDir *corev1.EmptyDirVolumeSource `json:"emptyDir,omitempty"` PersistentVolumeClaim *corev1.PersistentVolumeClaim `json:"persistentVolumeClaim,omitempty"` }
RedisStorage defines the structure used to store the Redis Data
type SentinelSettings ¶
type SentinelSettings struct { Envs map[string]string `json:"envs,omitempty"` Replicas int32 `json:"replicas,omitempty"` Resources RedisFailoverResources `json:"resources,omitempty"` CustomConfig []string `json:"customConfig,omitempty"` Command []string `json:"command,omitempty"` }
SentinelSettings defines the specification of the sentinel cluster
Click to show internal directories.
Click to hide internal directories.