Skip to content

Commit

Permalink
Add parameter to customize the number of cinderAPI processes
Browse files Browse the repository at this point in the history
Signed-off-by: Francesco Pantano <[email protected]>
  • Loading branch information
fmount committed Dec 5, 2024
1 parent b7c58e0 commit 7b737cf
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 1 deletion.
5 changes: 5 additions & 0 deletions api/bases/cinder.openstack.org_cinderapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,11 @@ spec:
type: object
transportURLSecret:
type: string
workers:
default: 4
format: int32
minimum: 1
type: integer
required:
- containerImage
- databaseHostname
Expand Down
5 changes: 5 additions & 0 deletions api/bases/cinder.openstack.org_cinders.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ spec:
caBundleSecretName:
type: string
type: object
workers:
default: 4
format: int32
minimum: 1
type: integer
required:
- containerImage
type: object
Expand Down
6 changes: 6 additions & 0 deletions api/v1beta1/cinderapi_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ type CinderAPITemplate struct {
ContainerImage string `json:"containerImage"`

CinderAPITemplateCore `json:",inline"`

// +kubebuilder:validation:Optional
// +kubebuilder:default=4
// +kubebuilder:validation:Minimum=1
// Workers - Number of processes running CinderAPI
Workers *int32 `json:"workers"`
}

// APIOverrideSpec to override the generated manifest of several child resources.
Expand Down
5 changes: 5 additions & 0 deletions api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions config/crd/bases/cinder.openstack.org_cinderapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,11 @@ spec:
type: object
transportURLSecret:
type: string
workers:
default: 4
format: int32
minimum: 1
type: integer
required:
- containerImage
- databaseHostname
Expand Down
5 changes: 5 additions & 0 deletions config/crd/bases/cinder.openstack.org_cinders.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ spec:
caBundleSecretName:
type: string
type: object
workers:
default: 4
format: int32
minimum: 1
type: integer
required:
- containerImage
type: object
Expand Down
1 change: 1 addition & 0 deletions controllers/cinder_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,7 @@ func (r *CinderReconciler) generateServiceConfigs(
cinder.DatabaseName)
templateParameters["MemcachedServersWithInet"] = memcached.GetMemcachedServerListWithInetString()
templateParameters["TimeOut"] = instance.Spec.APITimeout
templateParameters["Workers"] = instance.Spec.CinderAPI.Workers

// create httpd vhost template parameters
httpdVhostConfig := map[string]interface{}{}
Expand Down
2 changes: 1 addition & 1 deletion templates/cinder/config/10-cinder_wsgi.conf
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

## WSGI configuration
WSGIApplicationGroup %{GLOBAL}
WSGIDaemonProcess {{ $endpt }} display-name={{ $endpt }} group=cinder processes=4 threads=1 user=cinder
WSGIDaemonProcess {{ $endpt }} display-name={{ $endpt }} group=cinder processes={{ $.Workers }} threads=1 user=cinder
WSGIProcessGroup {{ $endpt }}
WSGIScriptAlias / "/var/www/cgi-bin/cinder/cinder-wsgi"
WSGIPassAuthorization On
Expand Down

0 comments on commit 7b737cf

Please sign in to comment.