Skip to content

Commit

Permalink
Merge pull request openstack-k8s-operators#500 from Deydra71/customiz…
Browse files Browse the repository at this point in the history
…e-process-number

Make process number configurable in KeystoneAPI
  • Loading branch information
openshift-merge-bot[bot] authored Nov 22, 2024
2 parents 18b7410 + b52ef01 commit 322aab6
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 1 deletion.
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
// 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

0 comments on commit 322aab6

Please sign in to comment.