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 6a4a70a
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 1 deletion.
8 changes: 8 additions & 0 deletions api/bases/cinder.openstack.org_cinderapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,14 @@ spec:
- extraVol
type: object
type: array
httpdCustomization:
properties:
processNumber:
default: 4
format: int32
minimum: 1
type: integer
type: object
networkAttachments:
items:
type: string
Expand Down
8 changes: 8 additions & 0 deletions api/bases/cinder.openstack.org_cinders.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ spec:
items:
type: string
type: array
httpdCustomization:
properties:
processNumber:
default: 4
format: int32
minimum: 1
type: integer
type: object
networkAttachments:
items:
type: string
Expand Down
13 changes: 13 additions & 0 deletions api/v1beta1/cinderapi_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,19 @@ type CinderAPITemplate struct {
ContainerImage string `json:"containerImage"`

CinderAPITemplateCore `json:",inline"`

// +kubebuilder:validation:Optional
// HttpdCustomization - customize the httpd service
HttpdCustomization HttpdCustomization `json:"httpdCustomization,omitempty"`
}

// HttpdCustomization -
type HttpdCustomization struct {
// +kubebuilder:validation:Optional
// +kubebuilder:default=4
// +kubebuilder:validation:Minimum=1
// ProcessNumber - Number of processes running in Cinder API
ProcessNumber *int32 `json:"processNumber"`
}

// APIOverrideSpec to override the generated manifest of several child resources.
Expand Down
21 changes: 21 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.

8 changes: 8 additions & 0 deletions config/crd/bases/cinder.openstack.org_cinderapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,14 @@ spec:
- extraVol
type: object
type: array
httpdCustomization:
properties:
processNumber:
default: 4
format: int32
minimum: 1
type: integer
type: object
networkAttachments:
items:
type: string
Expand Down
8 changes: 8 additions & 0 deletions config/crd/bases/cinder.openstack.org_cinders.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ spec:
items:
type: string
type: array
httpdCustomization:
properties:
processNumber:
default: 4
format: int32
minimum: 1
type: integer
type: object
networkAttachments:
items:
type: string
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.HttpdCustomization.ProcessNumber

// 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 6a4a70a

Please sign in to comment.