@@ -577,13 +577,17 @@ func (r *Reconciler) setDesiredCoreEnv(c *corev1.Container) {
577577 c .Env [j ].Value = ""
578578 c .Env [j ].ValueFrom = nil
579579 case "POSTGRES_SSL_REQUIRED" :
580- if r .NooBaa .Spec .ExternalPgSSLRequired {
580+ if r .NooBaa .Spec .ExternalPgSSLRequired || r . shouldReconcileCNPGCluster () {
581581 c .Env [j ].Value = "true"
582582 }
583583 case "POSTGRES_SSL_UNAUTHORIZED" :
584- if r .NooBaa .Spec .ExternalPgSSLUnauthorized {
584+ if r .NooBaa .Spec .ExternalPgSSLUnauthorized || r . shouldReconcileCNPGCluster () {
585585 c .Env [j ].Value = "true"
586586 }
587+ case "PGSSLROOTCERT" :
588+ if r .shouldReconcileCNPGCluster () {
589+ c .Env [j ].Value = cnpgCAMountPath + "/ca.crt"
590+ }
587591
588592 case "POSTGRES_DBNAME_PATH" :
589593 c .Env [j ].Value = postgresSecretMountPath + "/dbname"
@@ -702,11 +706,18 @@ func (r *Reconciler) SetDesiredCoreApp() error {
702706 }
703707
704708 if r .shouldReconcileCNPGCluster () {
705- dbSecretVolumeMounts := []corev1.VolumeMount {{
706- Name : r .CNPGCluster .Name ,
707- MountPath : postgresSecretMountPath ,
708- ReadOnly : true ,
709- }}
709+ dbSecretVolumeMounts := []corev1.VolumeMount {
710+ {
711+ Name : r .CNPGCluster .Name ,
712+ MountPath : postgresSecretMountPath ,
713+ ReadOnly : true ,
714+ },
715+ {
716+ Name : r .CNPGCluster .Name + "-ca" ,
717+ MountPath : cnpgCAMountPath ,
718+ ReadOnly : true ,
719+ },
720+ }
710721 util .MergeVolumeMountList (& c .VolumeMounts , & dbSecretVolumeMounts )
711722 } else if r .NooBaa .Spec .ExternalPgSecret != nil {
712723 dbSecretVolumeMounts := []corev1.VolumeMount {{
@@ -889,14 +900,28 @@ func (r *Reconciler) SetDesiredCoreApp() error {
889900 }
890901
891902 if r .shouldReconcileCNPGCluster () {
892- dbSecretVolumes := []corev1.Volume {{
893- Name : r .CNPGCluster .Name ,
894- VolumeSource : corev1.VolumeSource {
895- Secret : & corev1.SecretVolumeSource {
896- SecretName : r .getClusterSecretName (),
903+ dbSecretVolumes := []corev1.Volume {
904+ {
905+ Name : r .CNPGCluster .Name ,
906+ VolumeSource : corev1.VolumeSource {
907+ Secret : & corev1.SecretVolumeSource {
908+ SecretName : r .getClusterSecretName (),
909+ },
897910 },
898911 },
899- }}
912+ {
913+ Name : r .CNPGCluster .Name + "-ca" ,
914+ VolumeSource : corev1.VolumeSource {
915+ Secret : & corev1.SecretVolumeSource {
916+ SecretName : r .getClusterCASecretName (),
917+ Items : []corev1.KeyToPath {{
918+ Key : "ca.crt" ,
919+ Path : "ca.crt" ,
920+ }},
921+ },
922+ },
923+ },
924+ }
900925 util .MergeVolumeList (& podSpec .Volumes , & dbSecretVolumes )
901926 } else if r .NooBaa .Spec .ExternalPgSecret != nil {
902927 externalPgVolumes := []corev1.Volume {{
0 commit comments