Skip to content

Commit 075dc08

Browse files
committed
Add region_name support to Ceilometer and Aodh configurations
- Add region_name to [service_credentials] section in all Ceilometer config templates (central, compute, ipmi) - Add region_name to [keystone_authtoken] and [service_credentials] sections in Aodh config template - Update ceilometer_controller.go to pass Region to templateParameters - Update autoscaling_controller.go to pass Region to templateParameters This ensures proper region selection in multi-region deployments for both incoming request authentication (keystone_authtoken) and outbound service calls (service_credentials).
1 parent 86c3070 commit 075dc08

File tree

6 files changed

+17
-0
lines changed

6 files changed

+17
-0
lines changed

internal/controller/autoscaling_controller.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,7 @@ func (r *AutoscalingReconciler) generateServiceConfig(
721721
instance.Status.DatabaseHostname,
722722
autoscaling.DatabaseName),
723723
"Timeout": instance.Spec.Aodh.APITimeout,
724+
"Region": keystoneAPI.GetRegion(),
724725
}
725726

726727
prometheusParams := map[string]any{

internal/controller/ceilometer_controller.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,6 +1261,7 @@ func (r *CeilometerReconciler) generateServiceConfig(
12611261
"TLS": false, // Default to false. Change to true later if TLS enabled
12621262
"SwiftRole": false, //
12631263
"Timeout": instance.Spec.APITimeout,
1264+
"Region": keystoneAPI.GetRegion(),
12641265
}
12651266

12661267
// create httpd vhost template parameters

templates/autoscaling/config/aodh.conf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ user_domain_name = Default
5353
project_name = service
5454
project_domain_name = Default
5555
service_token_roles_required = True
56+
{{ if (index . "Region") -}}
57+
region_name = {{ .Region }}
58+
{{ end -}}
5659

5760
[service_credentials]
5861
auth_type=password
@@ -63,6 +66,9 @@ username={{ .AodhUser }}
6366
user_domain_name=Default
6467
password={{ .AodhPassword }}
6568
interface = internalURL
69+
{{ if (index . "Region") -}}
70+
region_name = {{ .Region }}
71+
{{ end -}}
6672

6773
[healthcheck]
6874
[service_types]

templates/ceilometercentral/config/ceilometer.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ username=ceilometer
1616
user_domain_name=Default
1717
password={{ .CeilometerPassword }}
1818
interface = internalURL
19+
{{ if (index . "Region") -}}
20+
region_name = {{ .Region }}
21+
{{ end -}}
1922
{{- if .TLS }}
2023
cafile = {{ .CAFile }}
2124
{{- end }}

templates/ceilometercompute/config/ceilometer.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ username=ceilometer
1414
user_domain_name=Default
1515
password={{ .CeilometerPassword }}
1616
interface = internalURL
17+
{{ if (index . "Region") -}}
18+
region_name = {{ .Region }}
19+
{{ end -}}
1720

1821
[compute]
1922
instance_discovery_method=libvirt_metadata

templates/ceilometeripmi/config/ceilometer.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ username=ceilometer
1515
user_domain_name=Default
1616
password={{ .CeilometerPassword }}
1717
interface = internalURL
18+
{{ if (index . "Region") -}}
19+
region_name = {{ .Region }}
20+
{{ end -}}
1821

1922
[coordination]
2023
backend_url=

0 commit comments

Comments
 (0)