controller

package
v0.0.0-...-f651441 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2019 License: MIT Imports: 32 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsPodReady

func IsPodReady(pod *apiv1.Pod) (bool, error)

IsPodReady check if pod is in ready condition, return the error message otherwise

func NewRedisAdmin

func NewRedisAdmin(pods []*apiv1.Pod, cfg *config.Redis) (redis.AdminInterface, error)

NewRedisAdmin builds and returns new redis.Admin from the list of pods

Types

type Config

type Config struct {
	NbWorker int
	// contains filtered or unexported fields
}

Config contains the Controller settings

func NewConfig

func NewConfig(nbWorker int, redis config.Redis) *Config

NewConfig builds and returns new Config instance

type Controller

type Controller struct {
	RedisClusterSynced cache.InformerSynced

	PodSynced cache.InformerSynced

	ServiceSynced cache.InformerSynced

	PodDiscruptionBudgetSynced cache.InformerSynced
	// contains filtered or unexported fields
}

Controller contains all controller fields

func NewController

func NewController(cfg *Config, kubeClient clientset.Interface, redisClient rclient.Interface, kubeInformer kubeinformers.SharedInformerFactory, rInformer rinformers.SharedInformerFactory) *Controller

NewController builds and return new controller instance

func (*Controller) Run

func (c *Controller) Run(stop <-chan struct{}) error

Run executes the Controller

type PodDisruptionBudgetsControl

type PodDisruptionBudgetsControl struct {
	KubeClient clientset.Interface
	Recorder   record.EventRecorder
}

PodDisruptionBudgetsControl contains all information for managing Kube PodDisruptionBudgets

func NewPodDisruptionBudgetsControl

func NewPodDisruptionBudgetsControl(client clientset.Interface, rec record.EventRecorder) *PodDisruptionBudgetsControl

NewPodDisruptionBudgetsControl builds and returns new PodDisruptionBudgetsControl instance

func (*PodDisruptionBudgetsControl) CreateRedisClusterPodDisruptionBudget

func (s *PodDisruptionBudgetsControl) CreateRedisClusterPodDisruptionBudget(redisCluster *rapi.RedisCluster) (*policyv1.PodDisruptionBudget, error)

CreateRedisClusterPodDisruptionBudget used to create the Kubernetes PodDisruptionBudget needed to access the Redis Cluster

func (*PodDisruptionBudgetsControl) DeleteRedisClusterPodDisruptionBudget

func (s *PodDisruptionBudgetsControl) DeleteRedisClusterPodDisruptionBudget(redisCluster *rapi.RedisCluster) error

DeleteRedisClusterPodDisruptionBudget used to delete the Kubernetes PodDisruptionBudget linked to the Redis Cluster

func (*PodDisruptionBudgetsControl) GetRedisClusterPodDisruptionBudget

func (s *PodDisruptionBudgetsControl) GetRedisClusterPodDisruptionBudget(redisCluster *rapi.RedisCluster) (*policyv1.PodDisruptionBudget, error)

GetRedisClusterPodDisruptionBudget used to retrieve the Kubernetes PodDisruptionBudget associated to the RedisCluster

type PodDisruptionBudgetsControlInterface

type PodDisruptionBudgetsControlInterface interface {
	// CreateRedisClusterPodDisruptionBudget used to create the Kubernetes PodDisruptionBudget needed to access the Redis Cluster
	CreateRedisClusterPodDisruptionBudget(redisCluster *rapi.RedisCluster) (*policyv1.PodDisruptionBudget, error)
	// DeleteRedisClusterPodDisruptionBudget used to delete the Kubernetes PodDisruptionBudget linked to the Redis Cluster
	DeleteRedisClusterPodDisruptionBudget(redisCluster *rapi.RedisCluster) error
	// GetRedisClusterPodDisruptionBudget used to retrieve the Kubernetes PodDisruptionBudget associated to the RedisCluster
	GetRedisClusterPodDisruptionBudget(redisCluster *rapi.RedisCluster) (*policyv1.PodDisruptionBudget, error)
}

PodDisruptionBudgetsControlInterface inferface for the PodDisruptionBudgetsControl

type ServicesControl

type ServicesControl struct {
	KubeClient clientset.Interface
	Recorder   record.EventRecorder
}

ServicesControl contains all information for managing Kube Services

func NewServicesControl

func NewServicesControl(client clientset.Interface, rec record.EventRecorder) *ServicesControl

NewServicesControl builds and returns new ServicesControl instance

func (*ServicesControl) CreateRedisClusterService

func (s *ServicesControl) CreateRedisClusterService(redisCluster *rapi.RedisCluster) (*kapiv1.Service, error)

CreateRedisClusterService used to create the Kubernetes Service needed to access the Redis Cluster

func (*ServicesControl) DeleteRedisClusterService

func (s *ServicesControl) DeleteRedisClusterService(redisCluster *rapi.RedisCluster) error

DeleteRedisClusterService used to delete the Kubernetes Service linked to the Redis Cluster

func (*ServicesControl) GetRedisClusterService

func (s *ServicesControl) GetRedisClusterService(redisCluster *rapi.RedisCluster) (*kapiv1.Service, error)

GetRedisClusterService used to retrieve the Kubernetes Service associated to the RedisCluster

type ServicesControlInterface

type ServicesControlInterface interface {
	// CreateRedisClusterService used to create the Kubernetes Service needed to access the Redis Cluster
	CreateRedisClusterService(redisCluster *rapi.RedisCluster) (*kapiv1.Service, error)
	// DeleteRedisClusterService used to delete the Kubernetes Service linked to the Redis Cluster
	DeleteRedisClusterService(redisCluster *rapi.RedisCluster) error
	// GetRedisClusterService used to retrieve the Kubernetes Service associated to the RedisCluster
	GetRedisClusterService(redisCluster *rapi.RedisCluster) (*kapiv1.Service, error)
}

ServicesControlInterface inferface for the ServicesControl

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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