Documentation ¶
Index ¶
- func AddOwnerRefToObject(obj metav1.Object, ownerRef metav1.OwnerReference)
- func AsOwner(cr *redisv1alpha1.Redis) metav1.OwnerReference
- func CheckRedisCluster(cr *redisv1alpha1.Redis) int
- func CompareAndCreateService(cr *redisv1alpha1.Redis, service ServiceInterface, err error)
- func CompareAndCreateStateful(cr *redisv1alpha1.Redis, clusterInfo StatefulInterface, err error)
- func CreateMasterHeadlessService(cr *redisv1alpha1.Redis)
- func CreateMasterService(cr *redisv1alpha1.Redis)
- func CreatePVCTemplate(cr *redisv1alpha1.Redis, role string) corev1.PersistentVolumeClaim
- func CreateRedisMaster(cr *redisv1alpha1.Redis)
- func CreateRedisReplicationCommand(cr *redisv1alpha1.Redis, nodeNumber string) []string
- func CreateRedisSecret(cr *redisv1alpha1.Redis)
- func CreateRedisSlave(cr *redisv1alpha1.Redis)
- func CreateRedisStandalone(cr *redisv1alpha1.Redis)
- func CreateSlaveHeadlessService(cr *redisv1alpha1.Redis)
- func CreateSlaveService(cr *redisv1alpha1.Redis)
- func CreateStandaloneService(cr *redisv1alpha1.Redis)
- func ExecuteCommand(cr *redisv1alpha1.Redis, cmd []string)
- func ExecuteRedisClusterCommand(cr *redisv1alpha1.Redis)
- func ExecuteRedisReplicationCommand(cr *redisv1alpha1.Redis)
- func FinalContainerDef(cr *redisv1alpha1.Redis, role string) []corev1.Container
- func GenerateContainerDef(cr *redisv1alpha1.Redis, role string) corev1.Container
- func GenerateK8sClient() *kubernetes.Clientset
- func GenerateMetaInformation(resourceKind string, apiVersion string) metav1.TypeMeta
- func GenerateObjectMetaInformation(name string, namespace string, labels map[string]string, ...) metav1.ObjectMeta
- func GenerateSecret(cr *redisv1alpha1.Redis) *corev1.Secret
- func GenerateSecretAnots() map[string]string
- func GenerateServiceAnots() map[string]string
- func GenerateServiceDef(cr *redisv1alpha1.Redis, labels map[string]string, portNumber int32, ...) *corev1.Service
- func GenerateStateFulSetsDef(cr *redisv1alpha1.Redis, labels map[string]string, role string, ...) *appsv1.StatefulSet
- func GenerateStatefulSetsAnots() map[string]string
- func GetRedisServerIP(redisInfo RedisDetails) string
- func LabelSelectors(labels map[string]string) *metav1.LabelSelector
- type RedisDetails
- type ServiceInterface
- type StatefulInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddOwnerRefToObject ¶
func AddOwnerRefToObject(obj metav1.Object, ownerRef metav1.OwnerReference)
AddOwnerRefToObject adds the owner references to object
func AsOwner ¶
func AsOwner(cr *redisv1alpha1.Redis) metav1.OwnerReference
AsOwner generates and returns object refernece
func CheckRedisCluster ¶
func CheckRedisCluster(cr *redisv1alpha1.Redis) int
CheckRedisCluster will check the redis cluster have sufficient nodes or not
func CompareAndCreateService ¶
func CompareAndCreateService(cr *redisv1alpha1.Redis, service ServiceInterface, err error)
CompareAndCreateService compares and creates service
func CompareAndCreateStateful ¶
func CompareAndCreateStateful(cr *redisv1alpha1.Redis, clusterInfo StatefulInterface, err error)
CompareAndCreateStateful will compare and create a statefulset pod
func CreateMasterHeadlessService ¶
func CreateMasterHeadlessService(cr *redisv1alpha1.Redis)
CreateMasterHeadlessService creates master headless service
func CreateMasterService ¶
func CreateMasterService(cr *redisv1alpha1.Redis)
CreateMasterService creates different services for master
func CreatePVCTemplate ¶
func CreatePVCTemplate(cr *redisv1alpha1.Redis, role string) corev1.PersistentVolumeClaim
CreatePVCTemplate will create the persistent volume claim template
func CreateRedisMaster ¶
func CreateRedisMaster(cr *redisv1alpha1.Redis)
CreateRedisMaster will create a Redis Master
func CreateRedisReplicationCommand ¶
func CreateRedisReplicationCommand(cr *redisv1alpha1.Redis, nodeNumber string) []string
CreateRedisReplicationCommand will create redis replication creation command
func CreateRedisSecret ¶
func CreateRedisSecret(cr *redisv1alpha1.Redis)
CreateRedisSecret method will create a redis secret
func CreateRedisSlave ¶
func CreateRedisSlave(cr *redisv1alpha1.Redis)
CreateRedisSlave will create a Redis Slave
func CreateRedisStandalone ¶
func CreateRedisStandalone(cr *redisv1alpha1.Redis)
CreateRedisStandalone will create a Redis Standalone server
func CreateSlaveHeadlessService ¶
func CreateSlaveHeadlessService(cr *redisv1alpha1.Redis)
CreateSlaveHeadlessService creates slave headless service
func CreateSlaveService ¶
func CreateSlaveService(cr *redisv1alpha1.Redis)
CreateSlaveService creates different services for slave
func CreateStandaloneService ¶
func CreateStandaloneService(cr *redisv1alpha1.Redis)
CreateStandaloneService creates redis standalone service
func ExecuteCommand ¶
func ExecuteCommand(cr *redisv1alpha1.Redis, cmd []string)
ExecuteCommand will execute the commands in pod
func ExecuteRedisClusterCommand ¶
func ExecuteRedisClusterCommand(cr *redisv1alpha1.Redis)
ExecuteRedisClusterCommand will execute redis cluster creation command
func ExecuteRedisReplicationCommand ¶
func ExecuteRedisReplicationCommand(cr *redisv1alpha1.Redis)
ExecuteRedisReplicationCommand will execute the replication command
func FinalContainerDef ¶
func FinalContainerDef(cr *redisv1alpha1.Redis, role string) []corev1.Container
FinalContainerDef will generate the final statefulset definition
func GenerateContainerDef ¶
func GenerateContainerDef(cr *redisv1alpha1.Redis, role string) corev1.Container
GenerateContainerDef generates container definition
func GenerateK8sClient ¶
func GenerateK8sClient() *kubernetes.Clientset
GenerateK8sClient create client for kubernetes
func GenerateMetaInformation ¶
GenerateMetaInformation generates the meta information
func GenerateObjectMetaInformation ¶
func GenerateObjectMetaInformation(name string, namespace string, labels map[string]string, annotations map[string]string) metav1.ObjectMeta
GenerateObjectMetaInformation generates the object meta information
func GenerateSecret ¶
func GenerateSecret(cr *redisv1alpha1.Redis) *corev1.Secret
GenerateSecret is a method that will generate a secret interface
func GenerateSecretAnots ¶
GenerateSecretAnots generates and returns secrets annotations
func GenerateServiceAnots ¶
GenerateServiceAnots generates and returns service annotations
func GenerateServiceDef ¶
func GenerateServiceDef(cr *redisv1alpha1.Redis, labels map[string]string, portNumber int32, role string, serviceName string, clusterIP string) *corev1.Service
GenerateServiceDef generate service definition
func GenerateStateFulSetsDef ¶
func GenerateStateFulSetsDef(cr *redisv1alpha1.Redis, labels map[string]string, role string, replicas *int32) *appsv1.StatefulSet
GenerateStateFulSetsDef generates the statefulsets definition
func GenerateStatefulSetsAnots ¶
GenerateStatefulSetsAnots generates and returns statefulsets annotations
func GetRedisServerIP ¶
func GetRedisServerIP(redisInfo RedisDetails) string
GetRedisServerIP will return the IP of redis service
func LabelSelectors ¶
func LabelSelectors(labels map[string]string) *metav1.LabelSelector
LabelSelectors generates object for label selection
Types ¶
type RedisDetails ¶
RedisDetails will hold the information for Redis Pod
type ServiceInterface ¶
type ServiceInterface struct { ExistingService *corev1.Service NewServiceDefinition *corev1.Service ServiceType string }
ServiceInterface is the interface to pass service information accross methods
type StatefulInterface ¶
type StatefulInterface struct { Existing *appsv1.StatefulSet Desired *appsv1.StatefulSet Type string }
StatefulInterface is the interface to pass statefulset information accross methods