Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customize the number of glanceAPI workers #667

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions api/bases/glance.openstack.org_glanceapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,11 @@ spec:
- single
- edge
type: string
workers:
default: 3
format: int32
minimum: 1
type: integer
required:
- containerImage
- databaseHostname
Expand Down
5 changes: 5 additions & 0 deletions api/bases/glance.openstack.org_glances.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,11 @@ spec:
- single
- edge
type: string
workers:
default: 3
format: int32
minimum: 1
type: integer
required:
- containerImage
type: object
Expand Down
6 changes: 6 additions & 0 deletions api/v1beta1/common_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 -
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/glance.openstack.org_glanceapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,11 @@ spec:
- single
- edge
type: string
workers:
default: 3
format: int32
minimum: 1
type: integer
required:
- containerImage
- databaseHostname
Expand Down
5 changes: 5 additions & 0 deletions config/crd/bases/glance.openstack.org_glances.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,11 @@ spec:
- single
- edge
type: string
workers:
default: 3
format: int32
minimum: 1
type: integer
required:
- containerImage
type: object
Expand Down
1 change: 1 addition & 0 deletions controllers/glanceapi_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion templates/common/config/00-config.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we limit the max cap for workers same as the number of CPUs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can yes, but we might need more logic in case we don't expose the parameter and allow customers to override it via customServiceConfig

# enable log rotation in oslo config by default
max_logfile_count=1
max_logfile_size_mb=20
Expand Down
Loading