otmachinery

package
v0.0.0-...-11f2f4f Latest Latest
Warning

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

Go to latest
Published: May 9, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

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

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

func GenerateMetaInformation(resourceKind string, apiVersion string) metav1.TypeMeta

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

func GenerateSecretAnots() map[string]string

GenerateSecretAnots generates and returns secrets annotations

func GenerateServiceAnots

func GenerateServiceAnots() map[string]string

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

func GenerateStatefulSetsAnots() map[string]string

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

type RedisDetails struct {
	PodName   string
	Namespace string
}

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

Jump to

Keyboard shortcuts

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