Documentation
¶
Overview ¶
Package controller contains the functions in PostgreSQL instance manager that reacts to changes to the Cluster resource.
Index ¶
- Variables
- type InstanceReconciler
- func (r *InstanceReconciler) GetClient() ctrl.Client
- func (r *InstanceReconciler) GetCluster(ctx context.Context) (*apiv1.Cluster, error)
- func (r *InstanceReconciler) GetExecutedCondition() *concurrency.Executed
- func (r *InstanceReconciler) GetSecret(ctx context.Context, name string) (*corev1.Secret, error)
- func (r *InstanceReconciler) Instance() *postgres.Instance
- func (r *InstanceReconciler) IsDBUp(ctx context.Context) error
- func (r *InstanceReconciler) Reconcile(ctx context.Context, _ reconcile.Request) (reconcile.Result, error)
- func (r *InstanceReconciler) ReconcileTablespaces(ctx context.Context, cluster *apiv1.Cluster) error
Constants ¶
This section is empty.
Variables ¶
var RetryUntilWalReceiverDown = wait.Backoff{ Duration: 1 * time.Second, Steps: math.MaxInt32, }
RetryUntilWalReceiverDown is the default retry configuration that is used to wait for the WAL receiver process to be down
Functions ¶
This section is empty.
Types ¶
type InstanceReconciler ¶
type InstanceReconciler struct {
// contains filtered or unexported fields
}
InstanceReconciler reconciles the status of the Cluster resource with the one of this PostgreSQL instance. Also, the configuration in the ConfigMap is applied when needed
func NewInstanceReconciler ¶
func NewInstanceReconciler( instance *postgres.Instance, client ctrl.Client, metricsExporter *metricserver.Exporter, ) *InstanceReconciler
NewInstanceReconciler creates a new instance reconciler
func (*InstanceReconciler) GetClient ¶
func (r *InstanceReconciler) GetClient() ctrl.Client
GetClient returns the dynamic client that is being used for a certain reconciler
func (*InstanceReconciler) GetCluster ¶
GetCluster gets the managed cluster through the client
func (*InstanceReconciler) GetExecutedCondition ¶
func (r *InstanceReconciler) GetExecutedCondition() *concurrency.Executed
GetExecutedCondition returns the condition that can be checked in order to be sure initialization has been done
func (*InstanceReconciler) Instance ¶
func (r *InstanceReconciler) Instance() *postgres.Instance
Instance get the PostgreSQL instance that this reconciler is working on
func (*InstanceReconciler) IsDBUp ¶
func (r *InstanceReconciler) IsDBUp(ctx context.Context) error
IsDBUp checks whether the superuserdb is reachable and returns an error if that's not the case
func (*InstanceReconciler) Reconcile ¶
func (r *InstanceReconciler) Reconcile( ctx context.Context, _ reconcile.Request, ) (reconcile.Result, error)
Reconcile is the main reconciliation loop for the instance TODO this function needs to be refactor
func (*InstanceReconciler) ReconcileTablespaces ¶ added in v1.22.0
func (r *InstanceReconciler) ReconcileTablespaces( ctx context.Context, cluster *apiv1.Cluster, ) error
ReconcileTablespaces ensures the mount points created for the tablespaces are there, and creates a subdirectory in each of them, which will therefore be owned by the `postgres` user (rather than `root` as the mount point), as required in order to hold PostgreSQL Tablespaces
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package externalservers contains the reconciler of external servers, taking care of enabling connectivity to every server defined in the relative section of the CR
|
Package externalservers contains the reconciler of external servers, taking care of enabling connectivity to every server defined in the relative section of the CR |
|
Package roles contains the code needed to reconcile roles with PostgreSQL
|
Package roles contains the code needed to reconcile roles with PostgreSQL |
|
slots
|
|
|
infrastructure
Package infrastructure contains the structs and interfaces needed to manage replication slots
|
Package infrastructure contains the structs and interfaces needed to manage replication slots |
|
reconciler
Package reconciler contains all the logic needed to reconcile replication slots
|
Package reconciler contains all the logic needed to reconcile replication slots |
|
runner
Package runner contains the runner that replicates slots from the primary to the replicas
|
Package runner contains the runner that replicates slots from the primary to the replicas |
|
Package tablespaces contains the runner to declarative tablespace
|
Package tablespaces contains the runner to declarative tablespace |
|
infrastructure
Package infrastructure contains the structs and interfaces needed to manage declarative tablespace
|
Package infrastructure contains the structs and interfaces needed to manage declarative tablespace |