minore changes

This commit is contained in:
Sergey Dudoladov 2019-04-08 15:03:56 +02:00
parent 76c00f3fa6
commit 6f855d5190
2 changed files with 5 additions and 4 deletions

View File

@ -346,7 +346,7 @@ The operator logs reasons for a rolling update with the `info` level and a diff
The operator can manage k8s cron jobs to do periodic logical backups of all PG clusters under its control. The cron job spawns a separate pod with a single container that connects to one of the Postgres replicas for a backup. The operator updates cron jobs during Sync if a schedule or a docker image of a job changes. Notes:
1. The provided `registry.opensource.zalan.do/acid/logical-backup` image implements the backup via `pg_dumpall` and upload of (compressed) results to an S3 bucket; `pg_dumpall` requires a `superuser` access to a DB.
1. The provided `registry.opensource.zalan.do/acid/logical-backup` image implements the backup via `pg_dumpall` and upload of (compressed) results to an S3 bucket; `pg_dumpall` requires a `superuser` access to a DB. Any such image must ensure the logical backup is able to finish [in presence of pod restarts](https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#handling-pod-and-container-failures) and [simultaneous invocations](https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#cron-job-limitations) of the backup cron job.
2. Due to the [limitation of Kubernetes cron jobs](https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#cron-job-limitations) it is highly advisable to set up additional monitoring for this feature; such monitoring is outside of the scope of operator responsibilities.

View File

@ -1316,11 +1316,12 @@ func (c *Cluster) generateLogicalBackupJob() (*batchv1beta1.CronJob, error) {
return nil, fmt.Errorf("could not generate pod template for logical backup cron job: %v", err)
}
// pods of k8s jobs support only "OnFailure" or "Never"
// but the default is "Always"
podTemplate.Spec.RestartPolicy = "OnFailure"
podTemplate.Spec.Affinity = &podAffinity
// affects containers within a pod on the same node
// pods of k8s jobs support only "OnFailure" or "Never"
podTemplate.Spec.RestartPolicy = "Never"
jobSpec := batchv1.JobSpec{Template: *podTemplate}
jobTemplateSpec := batchv1beta1.JobTemplateSpec{