Skip to content

Commit e6d546a

Browse files
lmicciniclaude
andcommitted
Use wildcard SANs for RabbitMQ TLS certificates
Replace per-pod dnsNames with wildcard SANs in the cert-manager Certificate for RabbitMQ: - *.{name}-nodes.{ns} (Erlang node name format, no .svc suffix) - *.{name}-nodes.{ns}.svc - *.{name}-nodes.{ns}.svc.{clusterDomain} This enables verify_peer for inter-node TLS with OTP 26+, which enforces strict hostname verification. The wildcard covers all StatefulSet pods and ephemeral Erlang peers spawned during peer discovery. It also removes the need to reissue certificates when scaling replicas. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent bf22505 commit e6d546a

7 files changed

Lines changed: 16 additions & 11 deletions

File tree

api/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,4 +143,4 @@ replace k8s.io/component-base => k8s.io/component-base v0.31.14 //allow-merging
143143

144144
replace github.com/cert-manager/cmctl/v2 => github.com/cert-manager/cmctl/v2 v2.1.2-0.20241127223932-88edb96860cf //allow-merging
145145

146-
replace github.com/openstack-k8s-operators/infra-operator/apis => github.com/lmiccini/infra-operator/apis v0.0.0-20260323131947-8d359988b429
146+
replace github.com/openstack-k8s-operators/infra-operator/apis => github.com/lmiccini/infra-operator/apis v0.0.0-20260324141520-b374911765c8

api/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0
9090
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
9191
github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
9292
github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
93-
github.com/lmiccini/infra-operator/apis v0.0.0-20260323131947-8d359988b429 h1:QwkH9nTpHVmflD0ABJZCN0V2N3XvlCkfYgmQthkMg2k=
94-
github.com/lmiccini/infra-operator/apis v0.0.0-20260323131947-8d359988b429/go.mod h1:QXzR9220I2d7CcoHqL4HWtU1PogJSN3NLmnh+bK3mco=
93+
github.com/lmiccini/infra-operator/apis v0.0.0-20260324141520-b374911765c8 h1:op5Nh3YO3X4gJ2EMYD2yQXJTPaGzQe9jhagIbRTsKeo=
94+
github.com/lmiccini/infra-operator/apis v0.0.0-20260324141520-b374911765c8/go.mod h1:QXzR9220I2d7CcoHqL4HWtU1PogJSN3NLmnh+bK3mco=
9595
github.com/mailru/easyjson v0.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4=
9696
github.com/mailru/easyjson v0.9.0/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU=
9797
github.com/maruel/natural v1.1.1 h1:Hja7XhhmvEFhcByqDoHz9QZbkWey+COd9xWfCfn1ioo=

config/operator/manager_operator_images.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ spec:
2626
- name: RELATED_IMAGE_HORIZON_OPERATOR_MANAGER_IMAGE_URL
2727
value: quay.io/openstack-k8s-operators/horizon-operator@sha256:67c5689bf3ea12b55f2c76e8dbefad03a980a6545d46f16493004cdcff4bfee4
2828
- name: RELATED_IMAGE_INFRA_OPERATOR_MANAGER_IMAGE_URL
29-
value: quay.io/lmiccini/infra-operator@sha256:e05efe1bebd32134d2ad07a5bb3535d4a09e99f50e4365575d698a74d9a1d85b
29+
value: quay.io/lmiccini/infra-operator@sha256:08e8d9f7c756143f76cf8ec8b5fee6ccbace1e15c2fa06f4c2231ff2a8bac35b
3030
- name: RELATED_IMAGE_IRONIC_OPERATOR_MANAGER_IMAGE_URL
3131
value: quay.io/openstack-k8s-operators/ironic-operator@sha256:741c1bc38c0d9430995a0d0aae6adae5c1f490b23d620564595cdd40683df68b
3232
- name: RELATED_IMAGE_KEYSTONE_OPERATOR_MANAGER_IMAGE_URL

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,4 +182,4 @@ replace k8s.io/component-base => k8s.io/component-base v0.31.14 //allow-merging
182182

183183
replace github.com/cert-manager/cmctl/v2 => github.com/cert-manager/cmctl/v2 v2.1.2-0.20241127223932-88edb96860cf //allow-merging
184184

185-
replace github.com/openstack-k8s-operators/infra-operator/apis => github.com/lmiccini/infra-operator/apis v0.0.0-20260323131947-8d359988b429
185+
replace github.com/openstack-k8s-operators/infra-operator/apis => github.com/lmiccini/infra-operator/apis v0.0.0-20260324141520-b374911765c8

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0
114114
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
115115
github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
116116
github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
117-
github.com/lmiccini/infra-operator/apis v0.0.0-20260323131947-8d359988b429 h1:QwkH9nTpHVmflD0ABJZCN0V2N3XvlCkfYgmQthkMg2k=
118-
github.com/lmiccini/infra-operator/apis v0.0.0-20260323131947-8d359988b429/go.mod h1:QXzR9220I2d7CcoHqL4HWtU1PogJSN3NLmnh+bK3mco=
117+
github.com/lmiccini/infra-operator/apis v0.0.0-20260324141520-b374911765c8 h1:op5Nh3YO3X4gJ2EMYD2yQXJTPaGzQe9jhagIbRTsKeo=
118+
github.com/lmiccini/infra-operator/apis v0.0.0-20260324141520-b374911765c8/go.mod h1:QXzR9220I2d7CcoHqL4HWtU1PogJSN3NLmnh+bK3mco=
119119
github.com/mailru/easyjson v0.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4=
120120
github.com/mailru/easyjson v0.9.0/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU=
121121
github.com/maruel/natural v1.1.1 h1:Hja7XhhmvEFhcByqDoHz9QZbkWey+COd9xWfCfn1ioo=

hack/export_operator_related_images.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export RELATED_IMAGE_DESIGNATE_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-
66
export RELATED_IMAGE_GLANCE_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/glance-operator@sha256:f649f31aca138e78f72963c98bafaeb0da514133f1d731019552c76dad08394c
77
export RELATED_IMAGE_HEAT_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/heat-operator@sha256:875a5a57ca5820e2b8b01463d5efbe0644afc288fcbb78898795d34637c1b7e2
88
export RELATED_IMAGE_HORIZON_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/horizon-operator@sha256:67c5689bf3ea12b55f2c76e8dbefad03a980a6545d46f16493004cdcff4bfee4
9-
export RELATED_IMAGE_INFRA_OPERATOR_MANAGER_IMAGE_URL=quay.io/lmiccini/infra-operator@sha256:e05efe1bebd32134d2ad07a5bb3535d4a09e99f50e4365575d698a74d9a1d85b
9+
export RELATED_IMAGE_INFRA_OPERATOR_MANAGER_IMAGE_URL=quay.io/lmiccini/infra-operator@sha256:08e8d9f7c756143f76cf8ec8b5fee6ccbace1e15c2fa06f4c2231ff2a8bac35b
1010
export RELATED_IMAGE_IRONIC_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/ironic-operator@sha256:741c1bc38c0d9430995a0d0aae6adae5c1f490b23d620564595cdd40683df68b
1111
export RELATED_IMAGE_KEYSTONE_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/keystone-operator@sha256:9fd3681c6c8549a78b12dc5e83676bc0956558b01327b95598aa424d62acb189
1212
export RELATED_IMAGE_MANILA_OPERATOR_MANAGER_IMAGE_URL=quay.io/openstack-k8s-operators/manila-operator@sha256:e5f1303497321c083933cd8ab46e0c95c3f7f3f4101e0c2c3df79eb089abab9e

internal/openstack/rabbitmq.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,14 @@ func reconcileRabbitMQ(
201201
fmt.Sprintf("%s.%s", hostname, clusterDomain),
202202
hostnameHeadless,
203203
fmt.Sprintf("%s.%s", hostnameHeadless, clusterDomain),
204-
}
205-
for i := 0; i < int(*spec.Replicas); i++ {
206-
hostnames = append(hostnames, fmt.Sprintf("%s-server-%d.%s-nodes.%s", name, i, name, instance.Namespace))
204+
// Wildcard SANs cover all StatefulSet pods and ephemeral Erlang peers,
205+
// enabling verify_peer for inter-node TLS with OTP 26+ and removing
206+
// the need to reissue certificates when scaling replicas.
207+
// The short form (without .svc) is needed because RABBITMQ_NODENAME
208+
// uses $(POD_NAME).$(SERVICE_NAME).$(NAMESPACE) without .svc suffix.
209+
fmt.Sprintf("*.%s-nodes.%s", name, instance.Namespace),
210+
fmt.Sprintf("*.%s-nodes.%s.svc", name, instance.Namespace),
211+
fmt.Sprintf("*.%s-nodes.%s.svc.%s", name, instance.Namespace, clusterDomain),
207212
}
208213

209214
tlsCert := ""

0 commit comments

Comments
 (0)