Documentation ¶
Index ¶
- func Backrest(namespace string, clientset kubeapi.Interface, task *crv1.Pgtask)
- func CleanBackupResources(clientset kubeapi.Interface, namespace, clusterName string) error
- func CleanStanzaCreateResources(namespace, clusterName string, clientset kubeapi.Interface) error
- func CreateBackup(clientset pgo.Interface, namespace, clusterName, podName string, ...) (*crv1.Pgtask, error)
- func CreateInitialBackup(clientset pgo.Interface, namespace, clusterName, podName string) (*crv1.Pgtask, error)
- func CreatePostFailoverBackup(clientset pgo.Interface, namespace, clusterName, podName string) (*crv1.Pgtask, error)
- func CreateRepoDeployment(clientset kubernetes.Interface, cluster *crv1.Pgcluster, ...) error
- func CreateRepoSecret(clientset kubernetes.Interface, cluster *crv1.Pgcluster) error
- func GCSRepoTypeCLIOptionExists(opts string) bool
- func PrepareClusterForRestore(clientset kubeapi.Interface, cluster *crv1.Pgcluster, task *crv1.Pgtask) (*crv1.Pgcluster, error)
- func PublishRestore(clusterName, username, namespace string)
- func ResizePVC(clientset kubeapi.Interface, cluster *crv1.Pgcluster) error
- func S3RepoTypeCLIOptionExists(opts string) bool
- func StanzaCreate(namespace, clusterName string, clientset kubeapi.Interface)
- func UpdateAnnotations(clientset kubernetes.Interface, cluster *crv1.Pgcluster, ...) error
- func UpdateBackrestRepoImage(clientset kubernetes.Interface, cluster *crv1.Pgcluster) error
- func UpdatePGClusterSpecForRestore(clientset kubeapi.Interface, cluster *crv1.Pgcluster, task *crv1.Pgtask)
- func UpdateResources(clientset kubernetes.Interface, cluster *crv1.Pgcluster) error
- func UpdateWorkflow(clientset pgo.Interface, workflowID, namespace, status string) error
- type RepoDeploymentTemplateFields
- type RepoServiceTemplateFields
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanBackupResources ¶
CleanBackupResources is responsible for cleaning up Kubernetes resources from a previous pgBackRest backup. Specifically, this function deletes the pgptask and job associate with a previous pgBackRest backup for the cluster.
func CleanStanzaCreateResources ¶
CleanStanzaCreateResources deletes any existing stanza-create pgtask and job. Useful during a restore when an existing stanza-create pgtask or Job might still be present from initial creation of the cluster.
func CreateBackup ¶
func CreateBackup(clientset pgo.Interface, namespace, clusterName, podName string, params map[string]string, backupOpts string) (*crv1.Pgtask, error)
CreateBackup creates a Pgtask in order to initiate a pgBackRest backup
func CreateInitialBackup ¶
func CreateInitialBackup(clientset pgo.Interface, namespace, clusterName, podName string) (*crv1.Pgtask, error)
CreateInitialBackup creates a Pgtask in order to initiate the initial pgBackRest backup for a cluster as needed to support replica creation
func CreatePostFailoverBackup ¶
func CreatePostFailoverBackup(clientset pgo.Interface, namespace, clusterName, podName string) (*crv1.Pgtask, error)
CreatePostFailoverBackup creates a Pgtask in order to initiate the a pgBackRest backup following a failure event to ensure proper replica creation and/or reinitialization
func CreateRepoDeployment ¶
func CreateRepoDeployment(clientset kubernetes.Interface, cluster *crv1.Pgcluster, createPVC, bootstrapRepo bool, replicas int, namespace string) error
CreateRepoDeployment creates a pgBackRest repository deployment for a PostgreSQL cluster, while also creating the associated Service and PersistentVolumeClaim. Namespace is provided as a parameter since is could vary depending on why the repo is being deployed (e.g. for a new cluster, or to bootstrap a new cluster using the backups from a former PG cluster, which could be in a different namespace).
func CreateRepoSecret ¶
func CreateRepoSecret(clientset kubernetes.Interface, cluster *crv1.Pgcluster) error
CreateRepoSecret allows for the creation of the Secret used to populate some (mostly) sensitive fields for managing the pgBackRest repository.
If the Secret already exists, then missing fields will be overwritten.
func GCSRepoTypeCLIOptionExists ¶ added in v0.2.0
GCSRepoTypeCLIOptionExists detects if a GCS restore was requested via the '--repo-type' command line option
func PrepareClusterForRestore ¶
func PrepareClusterForRestore(clientset kubeapi.Interface, cluster *crv1.Pgcluster, task *crv1.Pgtask) (*crv1.Pgcluster, error)
PrepareClusterForRestore prepares a PostgreSQL cluster for a restore. This includes deleting variousresources (Deployments, Jobs, PVCs & pgtasks) while also patching various custome resources (pgreplicas) as needed to perform a restore.
func PublishRestore ¶
func PublishRestore(clusterName, username, namespace string)
PublishRestore is responsible for publishing the 'RestoreCluster' event for a restore
func ResizePVC ¶ added in v0.2.0
ResizePVC resizes the pgBackRest PVC. To do this, the pgBackRest Deployment is scaled down to ensure the PVC unmounted, and then scaled back up. This will ensure that the new PVC size is applied to the pgBackRest repository.
func S3RepoTypeCLIOptionExists ¶
S3RepoTypeCLIOptionExists detects if a S3 restore was requested via the '--repo-type' command line option
func StanzaCreate ¶
func UpdateAnnotations ¶
func UpdateAnnotations(clientset kubernetes.Interface, cluster *crv1.Pgcluster, annotations map[string]string) error
UpdateAnnotations updates the annotations in the "template" portion of a pgBackRest deployment
func UpdateBackrestRepoImage ¶
func UpdateBackrestRepoImage(clientset kubernetes.Interface, cluster *crv1.Pgcluster) error
func UpdatePGClusterSpecForRestore ¶
func UpdatePGClusterSpecForRestore(clientset kubeapi.Interface, cluster *crv1.Pgcluster, task *crv1.Pgtask)
UpdatePGClusterSpecForRestore updates the spec for pgcluster resource provided as need to perform a restore
func UpdateResources ¶
func UpdateResources(clientset kubernetes.Interface, cluster *crv1.Pgcluster) error
UpdateResources updates the pgBackRest repository Deployment to reflect any resource updates
Types ¶
type RepoDeploymentTemplateFields ¶
type RepoDeploymentTemplateFields struct { SecurityContext string Image string ContainerResources string BackrestRepoClaimName string SshdSecretsName string PGbackrestDBHost string PgbackrestRepo1Path string PgbackrestDBPath string PgbackrestPGPort string SshdPort int PgbackrestStanza string PgbackrestRepo1Type crv1.BackrestStorageType PgbackrestGCSEnvVars string PgbackrestS3EnvVars string Name string ClusterName string PodAnnotations string PodAntiAffinity string PodAntiAffinityLabelName string PodAntiAffinityLabelValue string Replicas int BootstrapCluster string BootstrapNamespace string CustomLabels string Tolerations string }