@@ -100,6 +100,10 @@ func (b *DatabaseStatefulSetBuilder) buildEnv() []corev1.EnvVar {
100
100
}
101
101
102
102
func (b * DatabaseStatefulSetBuilder ) buildPodTemplateSpec () corev1.PodTemplateSpec {
103
+ domain := api .DefaultDomainName
104
+ if dnsAnnotation , ok := b .GetAnnotations ()[api .DNSDomainAnnotation ]; ok {
105
+ domain = dnsAnnotation
106
+ }
103
107
podTemplate := corev1.PodTemplateSpec {
104
108
ObjectMeta : metav1.ObjectMeta {
105
109
Labels : b .Labels ,
@@ -118,7 +122,7 @@ func (b *DatabaseStatefulSetBuilder) buildPodTemplateSpec() corev1.PodTemplateSp
118
122
119
123
DNSConfig : & corev1.PodDNSConfig {
120
124
Searches : []string {
121
- fmt .Sprintf (api .InterconnectServiceFQDNFormat , b .Spec .StorageClusterRef .Name , b .Spec .StorageClusterRef .Namespace ),
125
+ fmt .Sprintf (api .InterconnectServiceFQDNFormat , b .Spec .StorageClusterRef .Name , b .Spec .StorageClusterRef .Namespace , domain ),
122
126
},
123
127
},
124
128
},
@@ -541,6 +545,10 @@ func (b *DatabaseStatefulSetBuilder) buildVolumeMounts() []corev1.VolumeMount {
541
545
}
542
546
543
547
func (b * DatabaseStatefulSetBuilder ) buildContainerArgs () ([]string , []string ) {
548
+ domain := api .DefaultDomainName
549
+ if dnsAnnotation , ok := b .GetAnnotations ()[api .DNSDomainAnnotation ]; ok {
550
+ domain = dnsAnnotation
551
+ }
544
552
command := []string {fmt .Sprintf ("%s/%s" , api .BinariesDir , api .DaemonBinaryName )}
545
553
546
554
args := []string {
@@ -633,7 +641,7 @@ func (b *DatabaseStatefulSetBuilder) buildContainerArgs() ([]string, []string) {
633
641
}
634
642
635
643
publicHostOption := "--grpc-public-host"
636
- publicHost := fmt .Sprintf (api .InterconnectServiceFQDNFormat , b .Database .Name , b .GetNamespace ()) // FIXME .svc.cluster.local
644
+ publicHost := fmt .Sprintf (api .InterconnectServiceFQDNFormat , b .Database .Name , b .GetNamespace (), domain ) // FIXME .svc.cluster.local
637
645
638
646
if b .Spec .Service .GRPC .ExternalHost != "" {
639
647
publicHost = b .Spec .Service .GRPC .ExternalHost
0 commit comments