Skip to content

Commit

Permalink
Add parameter to customize the number of manilaAPI 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 2a2058e commit fa0b750
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 1 deletion.
5 changes: 5 additions & 0 deletions api/bases/manila.openstack.org_manilaapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,11 @@ spec:
type: object
transportURLSecret:
type: string
workers:
default: 3
format: int32
minimum: 1
type: integer
required:
- containerImage
- serviceAccount
Expand Down
5 changes: 5 additions & 0 deletions api/bases/manila.openstack.org_manilas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,11 @@ spec:
caBundleSecretName:
type: string
type: object
workers:
default: 3
format: int32
minimum: 1
type: integer
required:
- containerImage
type: object
Expand Down
6 changes: 6 additions & 0 deletions api/v1beta1/manilaapi_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ type ManilaAPITemplate struct {
// +kubebuilder:validation:Required
// ContainerImage - Manila API Container Image URL
ContainerImage string `json:"containerImage"`

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

// ManilaAPITemplateCore -
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/manila.openstack.org_manilaapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,11 @@ spec:
type: object
transportURLSecret:
type: string
workers:
default: 3
format: int32
minimum: 1
type: integer
required:
- containerImage
- serviceAccount
Expand Down
5 changes: 5 additions & 0 deletions config/crd/bases/manila.openstack.org_manilas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,11 @@ spec:
caBundleSecretName:
type: string
type: object
workers:
default: 3
format: int32
minimum: 1
type: integer
required:
- containerImage
type: object
Expand Down
1 change: 1 addition & 0 deletions controllers/manila_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,7 @@ func (r *ManilaReconciler) generateServiceConfig(
manila.DatabaseCRName),
"MemcachedServersWithInet": memcached.GetMemcachedServerListWithInetString(),
"TimeOut": instance.Spec.APITimeout,
"Workers": instance.Spec.ManilaAPI.Workers,
}

// create httpd vhost template parameters
Expand Down
2 changes: 1 addition & 1 deletion templates/manila/config/10-manila_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=manila processes=4 threads=1 user=manila
WSGIDaemonProcess {{ $endpt }} display-name={{ $endpt }} group=manila processes={{ $.Workers }} threads=1 user=manila
WSGIProcessGroup {{ $endpt }}
WSGIScriptAlias / "/var/www/cgi-bin/manila/manila-wsgi"
WSGIPassAuthorization On
Expand Down

0 comments on commit fa0b750

Please sign in to comment.