@@ -100,6 +100,10 @@ func (b *DatabaseStatefulSetBuilder) buildEnv() []corev1.EnvVar {
100100}
101101
102102func (b * DatabaseStatefulSetBuilder ) buildPodTemplateSpec () corev1.PodTemplateSpec {
103+ domain := api .DefaultDomainName
104+ if dnsAnnotation , ok := b .GetAnnotations ()[api .DNSDomainAnnotation ]; ok {
105+ domain = dnsAnnotation
106+ }
103107 podTemplate := corev1.PodTemplateSpec {
104108 ObjectMeta : metav1.ObjectMeta {
105109 Labels : b .Labels ,
@@ -118,7 +122,7 @@ func (b *DatabaseStatefulSetBuilder) buildPodTemplateSpec() corev1.PodTemplateSp
118122
119123 DNSConfig : & corev1.PodDNSConfig {
120124 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 ),
122126 },
123127 },
124128 },
@@ -541,6 +545,10 @@ func (b *DatabaseStatefulSetBuilder) buildVolumeMounts() []corev1.VolumeMount {
541545}
542546
543547func (b * DatabaseStatefulSetBuilder ) buildContainerArgs () ([]string , []string ) {
548+ domain := api .DefaultDomainName
549+ if dnsAnnotation , ok := b .GetAnnotations ()[api .DNSDomainAnnotation ]; ok {
550+ domain = dnsAnnotation
551+ }
544552 command := []string {fmt .Sprintf ("%s/%s" , api .BinariesDir , api .DaemonBinaryName )}
545553
546554 args := []string {
@@ -633,7 +641,7 @@ func (b *DatabaseStatefulSetBuilder) buildContainerArgs() ([]string, []string) {
633641 }
634642
635643 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
637645
638646 if b .Spec .Service .GRPC .ExternalHost != "" {
639647 publicHost = b .Spec .Service .GRPC .ExternalHost
0 commit comments