AddServerToRepoPod adds the TLS server container and volume to pod for the dedicated repository host of cluster.
( ctx context.Context, cluster *v1beta1.PostgresCluster, pod *corev1.PodSpec, )
| 405 | // AddServerToRepoPod adds the TLS server container and volume to pod for |
| 406 | // the dedicated repository host of cluster. |
| 407 | func AddServerToRepoPod( |
| 408 | ctx context.Context, |
| 409 | cluster *v1beta1.PostgresCluster, pod *corev1.PodSpec, |
| 410 | ) { |
| 411 | certificates := []corev1.VolumeProjection{{ |
| 412 | Secret: &corev1.SecretProjection{ |
| 413 | LocalObjectReference: corev1.LocalObjectReference{ |
| 414 | Name: naming.PGBackRestSecret(cluster).Name, |
| 415 | }, |
| 416 | Items: repositoryServerCertificates(), |
| 417 | }, |
| 418 | }} |
| 419 | |
| 420 | var resources *corev1.ResourceRequirements |
| 421 | if cluster.Spec.Backups.PGBackRest.RepoHost != nil { |
| 422 | resources = &cluster.Spec.Backups.PGBackRest.RepoHost.Resources |
| 423 | } |
| 424 | |
| 425 | addServerContainerAndVolume(ctx, cluster, pod, certificates, resources) |
| 426 | } |
| 427 | |
| 428 | // InstanceCertificates populates the shared Secret with certificates needed to run pgBackRest. |
| 429 | func InstanceCertificates(ctx context.Context, |