Documentation
¶
Index ¶
- func BuildOwnerReference(cluster *rapi.RedisCluster) metav1.OwnerReference
- func CreateRedisClusterLabelSelector(cluster *rapi.RedisCluster) (labels.Selector, error)
- func GenerateMD5Spec(spec *kapiv1.PodSpec) (string, error)
- func GetAnnotationsSet(cluster *rapi.RedisCluster) (labels.Set, error)
- func GetClusterAnnotationsSet(cluster *rapi.RedisCluster) (labels.Set, error)
- func GetLabelsSet(cluster *rapi.RedisCluster) (labels.Set, error)
- type RedisClusterControl
- func (p *RedisClusterControl) CreatePod(redisCluster *rapi.RedisCluster) (*kapiv1.Pod, error)
- func (p *RedisClusterControl) CreatePodOnNode(redisCluster *rapi.RedisCluster, nodeName string) (*kapiv1.Pod, error)
- func (p *RedisClusterControl) DeletePod(redisCluster *rapi.RedisCluster, podName string) error
- func (p *RedisClusterControl) DeletePodNow(redisCluster *rapi.RedisCluster, podName string) error
- func (p *RedisClusterControl) GetRedisClusterPods(redisCluster *rapi.RedisCluster) ([]kapiv1.Pod, error)
- func (p *RedisClusterControl) SetPodLabels(pod kapiv1.Pod, podLabels map[string]string) error
- type RedisClusterControlInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildOwnerReference ¶
func BuildOwnerReference(cluster *rapi.RedisCluster) metav1.OwnerReference
BuildOwnerReference used to build the OwnerReference from a RedisCluster
func CreateRedisClusterLabelSelector ¶
func CreateRedisClusterLabelSelector(cluster *rapi.RedisCluster) (labels.Selector, error)
CreateRedisClusterLabelSelector creates label selector to select the jobs related to a redis cluster
func GenerateMD5Spec ¶
GenerateMD5Spec used to generate the PodSpec MD5 hash
func GetAnnotationsSet ¶
func GetAnnotationsSet(cluster *rapi.RedisCluster) (labels.Set, error)
GetAnnotationsSet return a labels.Set of annotations from the RedisCluster and the PodTemplate
func GetClusterAnnotationsSet ¶
func GetClusterAnnotationsSet(cluster *rapi.RedisCluster) (labels.Set, error)
GetClusterAnnotationsSet return a labels.Set of annotations from the RedisCluster
func GetLabelsSet ¶
func GetLabelsSet(cluster *rapi.RedisCluster) (labels.Set, error)
GetLabelsSet return labels associated to the redis-node pods
Types ¶
type RedisClusterControl ¶
type RedisClusterControl struct {
KubeClient client.Client
Recorder record.EventRecorder
}
RedisClusterControl contains requires accessor to managing the RedisCluster pods
func NewRedisClusterControl ¶
func NewRedisClusterControl(client client.Client, rec record.EventRecorder) *RedisClusterControl
NewRedisClusterControl builds and returns new NewRedisClusterControl instance
func (*RedisClusterControl) CreatePod ¶
func (p *RedisClusterControl) CreatePod(redisCluster *rapi.RedisCluster) (*kapiv1.Pod, error)
CreatePod used to create a Pod from the RedisCluster pod template
func (*RedisClusterControl) CreatePodOnNode ¶
func (p *RedisClusterControl) CreatePodOnNode(redisCluster *rapi.RedisCluster, nodeName string) (*kapiv1.Pod, error)
CreatePodOnNode used to create a Pod on the given node
func (*RedisClusterControl) DeletePod ¶
func (p *RedisClusterControl) DeletePod(redisCluster *rapi.RedisCluster, podName string) error
DeletePod used to delete a pod
func (*RedisClusterControl) DeletePodNow ¶
func (p *RedisClusterControl) DeletePodNow(redisCluster *rapi.RedisCluster, podName string) error
DeletePodNow used to for delete a pod now
func (*RedisClusterControl) GetRedisClusterPods ¶
func (p *RedisClusterControl) GetRedisClusterPods(redisCluster *rapi.RedisCluster) ([]kapiv1.Pod, error)
GetRedisClusterPods return list of Pod attached to a RedisCluster
func (*RedisClusterControl) SetPodLabels ¶
SetPodLabels used to set a new map of labels to pod
type RedisClusterControlInterface ¶
type RedisClusterControlInterface interface {
// GetRedisClusterPods return list of Pod attached to a RedisCluster
GetRedisClusterPods(redisCluster *rapi.RedisCluster) ([]kapiv1.Pod, error)
// CreatePod used to create a Pod from the RedisCluster pod template
CreatePod(redisCluster *rapi.RedisCluster) (*kapiv1.Pod, error)
// CreatePodOnNode used to create a Pod on the given node
CreatePodOnNode(redisCluster *rapi.RedisCluster, nodeName string) (*kapiv1.Pod, error)
// DeletePod used to delete a pod from its name
DeletePod(redisCluster *rapi.RedisCluster, podName string) error
// DeletePodNow used to delete now (force) a pod from its name
DeletePodNow(redisCluster *rapi.RedisCluster, podName string) error
// SetPodLabels used to set a new map of labels to pod
SetPodLabels(pod kapiv1.Pod, podLabels map[string]string) error
}
RedisClusterControlInterface interface for the RedisClusterPodControl