diff --git a/api/bases/glance.openstack.org_glanceapis.yaml b/api/bases/glance.openstack.org_glanceapis.yaml index 4720440c8..a261f0fbe 100644 --- a/api/bases/glance.openstack.org_glanceapis.yaml +++ b/api/bases/glance.openstack.org_glanceapis.yaml @@ -712,6 +712,11 @@ spec: - single - edge type: string + workers: + default: 3 + format: int32 + minimum: 1 + type: integer required: - containerImage - databaseHostname diff --git a/api/bases/glance.openstack.org_glances.yaml b/api/bases/glance.openstack.org_glances.yaml index bf0e72718..6f19c1749 100644 --- a/api/bases/glance.openstack.org_glances.yaml +++ b/api/bases/glance.openstack.org_glances.yaml @@ -704,6 +704,11 @@ spec: - single - edge type: string + workers: + default: 3 + format: int32 + minimum: 1 + type: integer required: - containerImage type: object diff --git a/api/v1beta1/common_types.go b/api/v1beta1/common_types.go index d9b986639..5272024f5 100644 --- a/api/v1beta1/common_types.go +++ b/api/v1beta1/common_types.go @@ -106,6 +106,12 @@ type GlanceAPITemplate struct { // +kubebuilder:validation:Minimum=1 // APITimeout for HAProxy and Apache defaults to GlanceSpecCore APITimeout APITimeout int `json:"apiTimeout,omitempty"` + + // +kubebuilder:validation:Optional + // +kubebuilder:default=3 + // +kubebuilder:validation:Minimum=1 + // Workers - Number of processes running GlanceAPI(s) + Workers *int32 `json:"workers"` } // Storage - diff --git a/api/v1beta1/zz_generated.deepcopy.go b/api/v1beta1/zz_generated.deepcopy.go index e0f6c7d51..5f66f8f1b 100644 --- a/api/v1beta1/zz_generated.deepcopy.go +++ b/api/v1beta1/zz_generated.deepcopy.go @@ -275,6 +275,11 @@ func (in *GlanceAPITemplate) DeepCopyInto(out *GlanceAPITemplate) { out.Storage = in.Storage in.TLS.DeepCopyInto(&out.TLS) out.ImageCache = in.ImageCache + if in.Workers != nil { + in, out := &in.Workers, &out.Workers + *out = new(int32) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlanceAPITemplate. diff --git a/config/crd/bases/glance.openstack.org_glanceapis.yaml b/config/crd/bases/glance.openstack.org_glanceapis.yaml index 4720440c8..a261f0fbe 100644 --- a/config/crd/bases/glance.openstack.org_glanceapis.yaml +++ b/config/crd/bases/glance.openstack.org_glanceapis.yaml @@ -712,6 +712,11 @@ spec: - single - edge type: string + workers: + default: 3 + format: int32 + minimum: 1 + type: integer required: - containerImage - databaseHostname diff --git a/config/crd/bases/glance.openstack.org_glances.yaml b/config/crd/bases/glance.openstack.org_glances.yaml index bf0e72718..6f19c1749 100644 --- a/config/crd/bases/glance.openstack.org_glances.yaml +++ b/config/crd/bases/glance.openstack.org_glances.yaml @@ -704,6 +704,11 @@ spec: - single - edge type: string + workers: + default: 3 + format: int32 + minimum: 1 + type: integer required: - containerImage type: object diff --git a/controllers/glanceapi_controller.go b/controllers/glanceapi_controller.go index 4fe153ab0..cde17c851 100644 --- a/controllers/glanceapi_controller.go +++ b/controllers/glanceapi_controller.go @@ -1057,6 +1057,7 @@ func (r *GlanceAPIReconciler) generateServiceConfig( "QuotaEnabled": instance.Spec.Quota, "LogFile": fmt.Sprintf("%s%s.log", glance.GlanceLogPath, instance.Name), "VHosts": httpdVhostConfig, + "Workers": instance.Spec.Workers, } // Only set EndpointID parameter when the Endpoint has been created and the diff --git a/templates/common/config/00-config.conf b/templates/common/config/00-config.conf index 062c960e8..7854ae033 100644 --- a/templates/common/config/00-config.conf +++ b/templates/common/config/00-config.conf @@ -12,7 +12,7 @@ show_multiple_locations={{ .ShowMultipleLocations }} enabled_import_methods=[web-download,glance-direct] bind_host=localhost bind_port=9293 -workers=3 +workers={{ .Workers }} # enable log rotation in oslo config by default max_logfile_count=1 max_logfile_size_mb=20