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

Make process number configurable in KeystoneAPI #500

Merged
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
11 changes: 11 additions & 0 deletions api/bases/keystone.openstack.org_keystoneapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,17 @@ spec:
format: int32
minimum: 1
type: integer
httpdCustomization:
description: HttpdCustomization - customize the httpd service
properties:
processNumber:
default: 3
description: ProcessNumber - Number of processes running in keystone
API
format: int32
minimum: 1
type: integer
type: object
memcachedInstance:
default: memcached
description: Memcached instance name.
Expand Down
13 changes: 13 additions & 0 deletions api/v1beta1/keystoneapi_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ type KeystoneAPISpecCore struct {
// TODO: -> implement
DefaultConfigOverwrite map[string]string `json:"defaultConfigOverwrite,omitempty"`

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

// +kubebuilder:validation:Optional
// Resources - Compute Resources required by this service (Limits/Requests).
// https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
Expand Down Expand Up @@ -197,6 +201,15 @@ type PasswordSelector struct {
Admin string `json:"admin"`
}

// HttpdCustomization - customize the httpd service
type HttpdCustomization struct {
// +kubebuilder:validation:Optional
// +kubebuilder:default=3
// +kubebuilder:validation:Minimum=1
Copy link
Contributor

Choose a reason for hiding this comment

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

as discussed on slack, this needs to be tested for updating the controller/CRD on an already deployed env

// ProcessNumber - Number of processes running in keystone API
ProcessNumber *int32 `json:"processNumber"`
}

// KeystoneAPIStatus defines the observed state of KeystoneAPI
type KeystoneAPIStatus struct {
// ReadyCount of keystone API instances
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.

11 changes: 11 additions & 0 deletions config/crd/bases/keystone.openstack.org_keystoneapis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,17 @@ spec:
format: int32
minimum: 1
type: integer
httpdCustomization:
description: HttpdCustomization - customize the httpd service
properties:
processNumber:
default: 3
description: ProcessNumber - Number of processes running in keystone
API
format: int32
minimum: 1
type: integer
type: object
memcachedInstance:
default: memcached
description: Memcached instance name.
Expand Down
1 change: 1 addition & 0 deletions controllers/keystoneapi_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1196,6 +1196,7 @@ func (r *KeystoneAPIReconciler) generateServiceConfigMaps(
keystone.DatabaseName,
),
"enableSecureRBAC": instance.Spec.EnableSecureRBAC,
"ProcessNumber": instance.Spec.HttpdCustomization.ProcessNumber,
}

// create httpd vhost template parameters
Expand Down
2 changes: 1 addition & 1 deletion templates/keystoneapi/config/httpd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ CustomLog /dev/stdout proxy env=forwarded

## WSGI configuration
WSGIApplicationGroup %{GLOBAL}
WSGIDaemonProcess {{ $endpt }} display-name={{ $endpt }} group=keystone processes=3 threads=1 user=keystone
WSGIDaemonProcess {{ $endpt }} display-name={{ $endpt }} group=keystone processes={{ $.ProcessNumber }} threads=1 user=keystone
WSGIProcessGroup {{ $endpt }}
WSGIScriptAlias / "/usr/bin/keystone-wsgi-public"
WSGIPassAuthorization On
Expand Down
Loading