Skip to content

Commit 26a31c9

Browse files
committed
[northd][ovncontroller] Make certificate honor pod services names
As part of Metrics TLS support in the Related-Issue, exporter will be enabled per pod, so need to update certificates honor those service names. Related-Issue: OSPRH-12568
1 parent 50fbf47 commit 26a31c9

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

pkg/openstack/ovn.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,10 @@ func ReconcileOVNNorthd(ctx context.Context, instance *corev1beta1.OpenStackCont
234234
certRequest := certmanager.CertificateRequest{
235235
IssuerName: instance.GetOvnIssuer(),
236236
CertName: fmt.Sprintf("%s-ovndbs", "ovnnorthd"),
237+
// Cert needs to be valid for the individual pod services in the deployment so make this a wildcard cert
237238
Hostnames: []string{
238-
fmt.Sprintf("%s.%s.svc", serviceName, instance.Namespace),
239-
fmt.Sprintf("%s.%s.svc.%s", serviceName, instance.Namespace, dnsSuffix),
239+
fmt.Sprintf("%s*.%s.svc", serviceName, instance.Namespace),
240+
fmt.Sprintf("%s*.%s.svc.%s", serviceName, instance.Namespace, dnsSuffix),
240241
},
241242
Ips: nil,
242243
Usages: []certmgrv1.KeyUsage{
@@ -365,9 +366,10 @@ func ReconcileOVNController(ctx context.Context, instance *corev1beta1.OpenStack
365366
certRequest := certmanager.CertificateRequest{
366367
IssuerName: instance.GetOvnIssuer(),
367368
CertName: fmt.Sprintf("%s-ovndbs", "ovncontroller"),
369+
// Cert needs to be valid for the individual pod services in the daemonset so make this a wildcard cert
368370
Hostnames: []string{
369-
fmt.Sprintf("%s.%s.svc", serviceName, instance.Namespace),
370-
fmt.Sprintf("%s.%s.svc.%s", serviceName, instance.Namespace, dnsSuffix),
371+
fmt.Sprintf("%s*.%s.svc", serviceName, instance.Namespace),
372+
fmt.Sprintf("%s*.%s.svc.%s", serviceName, instance.Namespace, dnsSuffix),
371373
},
372374
Ips: nil,
373375
Usages: []certmgrv1.KeyUsage{

0 commit comments

Comments
 (0)