Documentation ¶
Index ¶
- Constants
- type Instance
- func (i Instance) IsAvailable() (available bool, known bool)
- func (i Instance) IsPrimary() (primary bool, known bool)
- func (i Instance) IsReady() (ready bool, known bool)
- func (i Instance) IsRunning(container string) (running bool, known bool)
- func (i Instance) IsTerminating() (terminating bool, known bool)
- func (i Instance) IsWritable() (writable, known bool)
- func (i Instance) PodMatchesPodTemplate() (matches bool, known bool)
- type Reconciler
- type RepoResources
Constants ¶
const ( // ConditionPostgresDataInitialized is the type used in a condition to indicate whether or not the // PostgresCluster's PostgreSQL data directory has been initialized (e.g. via a restore) ConditionPostgresDataInitialized = "PostgresDataInitialized" // ConditionManualBackupSuccessful is the type used in a condition to indicate whether or not // the manual backup for the current backup ID (as provided via annotation) was successful ConditionManualBackupSuccessful = "PGBackRestManualBackupSuccessful" // ConditionReplicaCreate is the type used in a condition to indicate whether or not // pgBackRest can be utilized for replica creation ConditionReplicaCreate = "PGBackRestReplicaCreate" // ConditionReplicaRepoReady is the type used in a condition to indicate whether or not // the pgBackRest repository for creating replicas is ready ConditionReplicaRepoReady = "PGBackRestReplicaRepoReady" // ConditionRepoHostReady is the type used in a condition to indicate whether or not a // pgBackRest repository host PostgresCluster is ready ConditionRepoHostReady = "PGBackRestRepoHostReady" // ConditionPGBackRestRestoreProgressing is the type used in a condition to indicate that // and in-place pgBackRest restore is in progress ConditionPGBackRestRestoreProgressing = "PGBackRestoreProgressing" // EventRepoHostNotFound is used to indicate that a pgBackRest repository was not // found when reconciling EventRepoHostNotFound = "RepoDeploymentNotFound" // EventRepoHostCreated is the event reason utilized when a pgBackRest repository host is // created EventRepoHostCreated = "RepoHostCreated" // EventUnableToCreateStanzas is the event reason utilized when pgBackRest is unable to create // stanzas for the repositories in a PostgreSQL cluster EventUnableToCreateStanzas = "UnableToCreateStanzas" // EventStanzasCreated is the event reason utilized when a pgBackRest stanza create command // completes successfully EventStanzasCreated = "StanzasCreated" // EventUnableToCreatePGBackRestCronJob is the event reason utilized when a pgBackRest backup // CronJob fails to create successfully EventUnableToCreatePGBackRestCronJob = "UnableToCreatePGBackRestCronJob" // ReasonReadyForRestore is the reason utilized within ConditionPGBackRestRestoreProgressing // to indicate that the restore Job can proceed because the cluster is now ready to be // restored (i.e. it has been properly prepared for a restore). ReasonReadyForRestore = "ReadyForRestore" )
const (
// ControllerName is the name of the PostgresCluster controller
ControllerName = "postgrescluster-controller"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Instance ¶
type Instance struct { Name string Pods []*corev1.Pod Runner *appsv1.StatefulSet Spec *v1beta1.PostgresInstanceSetSpec }
Instance represents a single PostgreSQL instance of a PostgresCluster.
func (Instance) IsAvailable ¶
IsAvailable is used to choose which instances to redeploy during rolling update. It combines information from metadata and status similar to the notion of "available" in corev1.Deployment and "healthy" in appsv1.StatefulSet.
func (Instance) IsReady ¶
IsReady returns whether or not this instance is ready to receive PostgreSQL connections.
func (Instance) IsTerminating ¶
IsTerminating returns whether or not this instance is in the process of not running.
func (Instance) IsWritable ¶
IsWritable returns whether or not a PostgreSQL connection could write to its database.
func (Instance) PodMatchesPodTemplate ¶
PodMatchesPodTemplate returns whether or not the Pod for this instance matches its specified PodTemplate. When it does not match, the Pod needs to be redeployed.
type Reconciler ¶
type Reconciler struct { Client client.Client Owner client.FieldOwner Recorder record.EventRecorder Tracer trace.Tracer IsOpenShift bool PodExec func( namespace, pod, container string, stdin io.Reader, stdout, stderr io.Writer, command ...string, ) error }
Reconciler holds resources for the PostgresCluster reconciler
func (*Reconciler) Reconcile ¶
func (r *Reconciler) Reconcile( ctx context.Context, request reconcile.Request) (reconcile.Result, error, )
Reconcile reconciles a ConfigMap in a namespace managed by the PostgreSQL Operator
func (*Reconciler) SetupWithManager ¶
func (r *Reconciler) SetupWithManager(mgr manager.Manager) error
SetupWithManager adds the PostgresCluster controller to the provided runtime manager
type RepoResources ¶
type RepoResources struct {
// contains filtered or unexported fields
}
RepoResources is used to store various resources for pgBackRest repositories and repository hosts