Skip to content

Commit 867879f

Browse files
committed
[TLS] add wild card hostnames for headless galera/rabbitmq svc
For tls cluster interconnect add wild card for the services headless service names.
1 parent c2019c1 commit 867879f

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

pkg/openstack/galera.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ func ReconcileGaleras(
4343

4444
for name, spec := range instance.Spec.Galera.Templates {
4545
hostname := fmt.Sprintf("%s.%s.svc", name, instance.Namespace)
46+
hostnameHeadless := fmt.Sprintf("%s-galera.%s.svc", name, instance.Namespace)
4647

4748
// Galera gets always configured to support TLS connections.
4849
// If TLS can/must be used is a per user configuration.
@@ -52,6 +53,10 @@ func ReconcileGaleras(
5253
Hostnames: []string{
5354
hostname,
5455
fmt.Sprintf("%s.%s", hostname, ClusterInternalDomain),
56+
hostnameHeadless,
57+
fmt.Sprintf("%s.%s", hostnameHeadless, ClusterInternalDomain),
58+
fmt.Sprintf("*.%s", hostnameHeadless),
59+
fmt.Sprintf("*.%s.%s", hostnameHeadless, ClusterInternalDomain),
5560
},
5661
// Note (dciabrin) from https://github.com/openstack-k8s-operators/openstack-operator/pull/678#issuecomment-1952459166
5762
// the certificate created for galera should populate the 'organization' field,

pkg/openstack/rabbitmq.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,8 @@ func reconcileRabbitMQ(
195195
}
196196

197197
hostname := fmt.Sprintf("%s.%s.svc", name, instance.Namespace)
198+
hostnameHeadless := fmt.Sprintf("%s-nodes.%s.svc", name, instance.Namespace)
199+
198200
tlsCert := ""
199201
commonName := fmt.Sprintf("%s.%s", hostname, ClusterInternalDomain)
200202

@@ -206,6 +208,10 @@ func reconcileRabbitMQ(
206208
Hostnames: []string{
207209
hostname,
208210
fmt.Sprintf("%s.%s", hostname, ClusterInternalDomain),
211+
hostnameHeadless,
212+
fmt.Sprintf("%s.%s", hostnameHeadless, ClusterInternalDomain),
213+
fmt.Sprintf("*.%s", hostnameHeadless),
214+
fmt.Sprintf("*.%s.%s", hostnameHeadless, ClusterInternalDomain),
209215
},
210216
Subject: &certmgrv1.X509Subject{
211217
Organizations: []string{fmt.Sprintf("%s.%s", rabbitmq.Namespace, ClusterInternalDomain)},

0 commit comments

Comments
 (0)