Documentation ¶
Overview ¶
Package cluster holds the cluster CRD logic and definitions A cluster is comprised of a primary service, replica service, primary deployment, and replica deployment
Package cluster holds the cluster CRD logic and definitions A cluster is comprised of a primary service, replica service, primary deployment, and replica deployment
Package cluster holds the cluster CRD logic and definitions A cluster is comprised of a primary service, replica service, primary deployment, and replica deployment
Package cluster holds the cluster CRD logic and definitions A cluster is comprised of a primary service, replica service, primary deployment, and replica deployment
Package cluster holds the cluster CRD logic and definitions A cluster is comprised of a primary service, replica service, primary deployment, and replica deployment
Package cluster holds the cluster CRD logic and definitions A cluster is comprised of a primary service, replica service, primary deployment, and replica deployment
Package cluster holds the cluster CRD logic and definitions A cluster is comprised of a primary service, replica service, primary deployment, and replica deployment
Package cluster holds the cluster CRD logic and definitions A cluster is comprised of a primary service, replica service, primary deployment, and replica deployment
Index ¶
- Constants
- func AddClusterBase(clientset *kubernetes.Clientset, client *rest.RESTClient, cl *crv1.Pgcluster, ...)
- func AddPgbouncer(clientset *kubernetes.Clientset, cl *crv1.Pgcluster, namespace string, ...) error
- func AddPgbouncerFromTask(clientset *kubernetes.Clientset, restclient *rest.RESTClient, ...)
- func AddPgpool(clientset *kubernetes.Clientset, cl *crv1.Pgcluster, namespace string, ...) error
- func AddPgpoolFromTask(clientset *kubernetes.Clientset, restclient *rest.RESTClient, ...)
- func AddUpgrade(clientset *kubernetes.Clientset, restclient *rest.RESTClient, ...)
- func AddUpgradeBase(clientset *kubernetes.Clientset, client *rest.RESTClient, ...) error
- func AutofailBase(clientset *kubernetes.Clientset, restclient *rest.RESTClient, ready bool, ...)
- func CreatePgpoolSecret(clientset *kubernetes.Clientset, ...) error
- func CreateService(clientset *kubernetes.Clientset, fields *ServiceTemplateFields, ...) error
- func DeleteClusterBase(clientset *kubernetes.Clientset, restclient *rest.RESTClient, ...)
- func DeletePgbouncer(clientset *kubernetes.Clientset, clusterName, namespace string)
- func DeletePgbouncerFromTask(clientset *kubernetes.Clientset, restclient *rest.RESTClient, ...)
- func DeletePgpool(clientset *kubernetes.Clientset, clusterName, namespace string)
- func DeletePgpoolFromTask(clientset *kubernetes.Clientset, restclient *rest.RESTClient, ...)
- func DeletePgreplicas(restclient *rest.RESTClient, clusterName, namespace string)
- func DeleteUpgrade(clientset *kubernetes.Clientset, restclient *rest.RESTClient, ...)
- func FailoverBase(namespace string, clientset *kubernetes.Clientset, client *rest.RESTClient, ...)
- func InitializeAutoFailover(clientset *kubernetes.Clientset, restclient *rest.RESTClient, ns string) error
- func ProcessPolicies(clientset *kubernetes.Clientset, restclient *rest.RESTClient, ...)
- func ReconfigurePgbouncerFromTask(clientset *kubernetes.Clientset, restclient *rest.RESTClient, ...)
- func ReconfigurePgpoolFromTask(clientset *kubernetes.Clientset, restclient *rest.RESTClient, ...)
- func ScaleBase(clientset *kubernetes.Clientset, client *rest.RESTClient, ...)
- func ScaleDownBase(clientset *kubernetes.Clientset, client *rest.RESTClient, ...)
- type AutoFailoverTask
- func (*AutoFailoverTask) AddEvent(restclient *rest.RESTClient, clusterName, eventType, namespace string)
- func (*AutoFailoverTask) Clear(restclient *rest.RESTClient, clusterName, namespace string)
- func (*AutoFailoverTask) Exists(restclient *rest.RESTClient, clusterName, namespace string) bool
- func (*AutoFailoverTask) GetEvents(restclient *rest.RESTClient, clusterName, namespace string) (string, map[string]string)
- func (*AutoFailoverTask) Print(restclient *rest.RESTClient, namespace string)
- type FailoverEvent
- type PgbouncerConfFields
- type PgbouncerHBAFields
- type PgbouncerPasswdFields
- type PgbouncerTemplateFields
- type PgpoolConfFields
- type PgpoolHBAFields
- type PgpoolPasswdFields
- type PgpoolTemplateFields
- type ServiceTemplateFields
- type StateMachine
- type Strategy
- type Strategy1
- func (r Strategy1) AddCluster(clientset *kubernetes.Clientset, client *rest.RESTClient, cl *crv1.Pgcluster, ...) error
- func (r Strategy1) DeleteCluster(clientset *kubernetes.Clientset, restclient *rest.RESTClient, ...) error
- func (r Strategy1) DeleteReplica(clientset *kubernetes.Clientset, cl *crv1.Pgreplica, namespace string) error
- func (r Strategy1) Failover(clientset *kubernetes.Clientset, client *rest.RESTClient, clusterName string, ...) error
- func (r Strategy1) MinorUpgrade(clientset *kubernetes.Clientset, restclient *rest.RESTClient, ...) error
- func (r Strategy1) Scale(clientset *kubernetes.Clientset, client *rest.RESTClient, ...) error
- func (r Strategy1) UpdatePolicyLabels(clientset *kubernetes.Clientset, clusterName string, namespace string, ...) error
Constants ¶
const FAILOVER_EVENT_NOT_READY = "NotReady"
const FAILOVER_EVENT_READY = "Ready"
const PGBOUNCER_SUFFIX = "-pgbouncer"
const PGPOOL_SUFFIX = "-pgpool"
const ReplicaSuffix = "-replica"
ReplicaSuffix ...
Variables ¶
This section is empty.
Functions ¶
func AddClusterBase ¶
func AddClusterBase(clientset *kubernetes.Clientset, client *rest.RESTClient, cl *crv1.Pgcluster, namespace string)
AddClusterBase ...
func AddPgbouncer ¶
func AddPgbouncer(clientset *kubernetes.Clientset, cl *crv1.Pgcluster, namespace string, createService bool, updateCreds bool) error
ProcessPgbouncer ...
func AddPgbouncerFromTask ¶
func AddPgbouncerFromTask(clientset *kubernetes.Clientset, restclient *rest.RESTClient, task *crv1.Pgtask, namespace string)
func AddPgpool ¶
func AddPgpool(clientset *kubernetes.Clientset, cl *crv1.Pgcluster, namespace string, createService bool) error
ProcessPgpool ...
func AddPgpoolFromTask ¶
func AddPgpoolFromTask(clientset *kubernetes.Clientset, restclient *rest.RESTClient, task *crv1.Pgtask, namespace string)
func AddUpgrade ¶
func AddUpgrade(clientset *kubernetes.Clientset, restclient *rest.RESTClient, upgrade *crv1.Pgupgrade, namespace string)
AddUpgrade creates a pgupgrade job
func AddUpgradeBase ¶
func AddUpgradeBase(clientset *kubernetes.Clientset, client *rest.RESTClient, upgrade *crv1.Pgupgrade, namespace string, cl *crv1.Pgcluster) error
AddUpgradeBase ...
func AutofailBase ¶
func AutofailBase(clientset *kubernetes.Clientset, restclient *rest.RESTClient, ready bool, clusterName, namespace string)
AutofailBase ...
func CreatePgpoolSecret ¶
func CreatePgpoolSecret(clientset *kubernetes.Clientset, primary, replica, db, secretName, namespace string) error
CreatePgpoolSecret create a secret used by pgpool
func CreateService ¶
func CreateService(clientset *kubernetes.Clientset, fields *ServiceTemplateFields, namespace string) error
CreateService ...
func DeleteClusterBase ¶
func DeleteClusterBase(clientset *kubernetes.Clientset, restclient *rest.RESTClient, cl *crv1.Pgcluster, namespace string)
DeleteClusterBase ...
func DeletePgbouncer ¶
func DeletePgbouncer(clientset *kubernetes.Clientset, clusterName, namespace string)
DeletePgbouncer
func DeletePgbouncerFromTask ¶
func DeletePgbouncerFromTask(clientset *kubernetes.Clientset, restclient *rest.RESTClient, task *crv1.Pgtask, namespace string)
func DeletePgpool ¶
func DeletePgpool(clientset *kubernetes.Clientset, clusterName, namespace string)
DeletePgpool
func DeletePgpoolFromTask ¶
func DeletePgpoolFromTask(clientset *kubernetes.Clientset, restclient *rest.RESTClient, task *crv1.Pgtask, namespace string)
func DeletePgreplicas ¶
func DeletePgreplicas(restclient *rest.RESTClient, clusterName, namespace string)
DeletePgreplicas
func DeleteUpgrade ¶
func DeleteUpgrade(clientset *kubernetes.Clientset, restclient *rest.RESTClient, upgrade *crv1.Pgupgrade, namespace string)
DeleteUpgrade deletes a pgupgrade job
func FailoverBase ¶
func FailoverBase(namespace string, clientset *kubernetes.Clientset, client *rest.RESTClient, task *crv1.Pgtask, restconfig *rest.Config)
FailoverBase ...
func InitializeAutoFailover ¶
func InitializeAutoFailover(clientset *kubernetes.Clientset, restclient *rest.RESTClient, ns string) error
at operator startup, add a state machine for each primary pod that has autofail enabled
func ProcessPolicies ¶
func ProcessPolicies(clientset *kubernetes.Clientset, restclient *rest.RESTClient, stopchan chan struct{}, namespace string)
ProcessPolicies ...
func ReconfigurePgbouncerFromTask ¶
func ReconfigurePgbouncerFromTask(clientset *kubernetes.Clientset, restclient *rest.RESTClient, task *crv1.Pgtask, namespace string)
func ReconfigurePgpoolFromTask ¶
func ReconfigurePgpoolFromTask(clientset *kubernetes.Clientset, restclient *rest.RESTClient, task *crv1.Pgtask, namespace string)
func ScaleBase ¶
func ScaleBase(clientset *kubernetes.Clientset, client *rest.RESTClient, replica *crv1.Pgreplica, namespace string)
ScaleBase ...
func ScaleDownBase ¶
func ScaleDownBase(clientset *kubernetes.Clientset, client *rest.RESTClient, replica *crv1.Pgreplica, namespace string)
ScaleDownBase ...
Types ¶
type AutoFailoverTask ¶
type AutoFailoverTask struct { }
func (*AutoFailoverTask) AddEvent ¶
func (*AutoFailoverTask) AddEvent(restclient *rest.RESTClient, clusterName, eventType, namespace string)
func (*AutoFailoverTask) Clear ¶
func (*AutoFailoverTask) Clear(restclient *rest.RESTClient, clusterName, namespace string)
func (*AutoFailoverTask) Exists ¶
func (*AutoFailoverTask) Exists(restclient *rest.RESTClient, clusterName, namespace string) bool
func (*AutoFailoverTask) GetEvents ¶
func (*AutoFailoverTask) GetEvents(restclient *rest.RESTClient, clusterName, namespace string) (string, map[string]string)
func (*AutoFailoverTask) Print ¶
func (*AutoFailoverTask) Print(restclient *rest.RESTClient, namespace string)
type FailoverEvent ¶
FailoverEvent holds a record of a NotReady or other event that is used by the failover algorithm, FailoverEvents can build up for a given cluster
type PgbouncerConfFields ¶
type PgbouncerHBAFields ¶
type PgbouncerHBAFields struct { }
type PgbouncerPasswdFields ¶
type PgbouncerTemplateFields ¶
type PgpoolConfFields ¶
type PgpoolHBAFields ¶
type PgpoolHBAFields struct { }
type PgpoolPasswdFields ¶
type PgpoolTemplateFields ¶
type ServiceTemplateFields ¶
type ServiceTemplateFields struct { Name string ServiceName string ClusterName string Port string ServiceType string }
ServiceTemplateFields ...
type StateMachine ¶
type StateMachine struct { Clientset *kubernetes.Clientset RESTClient *rest.RESTClient Namespace string ClusterName string SleepSeconds int }
StateMachine holds a state machine that is created when a cluster has received a NotReady event, this is the start The StateMachine is executed in a separate goroutine for any cluster founds to be NotReady
func (*StateMachine) Evaluate ¶
func (s *StateMachine) Evaluate(status string, events map[string]string) bool
Evaluate returns true if the autofail status is NotReady
func (*StateMachine) Print ¶
func (s *StateMachine) Print()
func (*StateMachine) Run ¶
func (s *StateMachine) Run()
Run is the heart of the failover state machine, started when a NotReady event is caught by the cluster watcher process, this statemachine runs until
type Strategy ¶
type Strategy interface { Scale(*kubernetes.Clientset, *rest.RESTClient, *crv1.Pgreplica, string, string, *crv1.Pgcluster) error AddCluster(*kubernetes.Clientset, *rest.RESTClient, *crv1.Pgcluster, string, string) error Failover(*kubernetes.Clientset, *rest.RESTClient, string, *crv1.Pgtask, string, *rest.Config) error DeleteCluster(*kubernetes.Clientset, *rest.RESTClient, *crv1.Pgcluster, string) error DeleteReplica(*kubernetes.Clientset, *crv1.Pgreplica, string) error MinorUpgrade(*kubernetes.Clientset, *rest.RESTClient, *crv1.Pgcluster, *crv1.Pgupgrade, string) error UpdatePolicyLabels(*kubernetes.Clientset, string, string, map[string]string) error }
Strategy ....
type Strategy1 ¶
type Strategy1 struct{}
Strategy1 ...
func (Strategy1) AddCluster ¶
func (r Strategy1) AddCluster(clientset *kubernetes.Clientset, client *rest.RESTClient, cl *crv1.Pgcluster, namespace string, primaryPVCName string) error
AddCluster ...
func (Strategy1) DeleteCluster ¶
func (r Strategy1) DeleteCluster(clientset *kubernetes.Clientset, restclient *rest.RESTClient, cl *crv1.Pgcluster, namespace string) error
DeleteCluster ...
func (Strategy1) DeleteReplica ¶
func (r Strategy1) DeleteReplica(clientset *kubernetes.Clientset, cl *crv1.Pgreplica, namespace string) error
DeleteReplica ...
func (Strategy1) Failover ¶
func (r Strategy1) Failover(clientset *kubernetes.Clientset, client *rest.RESTClient, clusterName string, task *crv1.Pgtask, namespace string, restconfig *rest.Config) error
AddCluster ...
func (Strategy1) MinorUpgrade ¶
func (r Strategy1) MinorUpgrade(clientset *kubernetes.Clientset, restclient *rest.RESTClient, cl *crv1.Pgcluster, upgrade *crv1.Pgupgrade, namespace string) error
MinorUpgrade ..
func (Strategy1) Scale ¶
func (r Strategy1) Scale(clientset *kubernetes.Clientset, client *rest.RESTClient, replica *crv1.Pgreplica, namespace, pvcName string, cluster *crv1.Pgcluster) error
Scale ...
func (Strategy1) UpdatePolicyLabels ¶
func (r Strategy1) UpdatePolicyLabels(clientset *kubernetes.Clientset, clusterName string, namespace string, newLabels map[string]string) error
UpdatePolicyLabels ...