From 45b6338602bbc4c1cd98b2d071d4756817c77f04 Mon Sep 17 00:00:00 2001 From: Veronika Fisarova Date: Wed, 13 Nov 2024 12:03:14 +0100 Subject: [PATCH] [wip] Test custom number of processes Signed-off-by: Veronika Fisarova --- api/bases/keystone.openstack.org_keystoneapis.yaml | 8 ++++++++ api/v1beta1/keystoneapi_types.go | 7 +++++++ api/v1beta1/zz_generated.deepcopy.go | 5 +++++ config/crd/bases/keystone.openstack.org_keystoneapis.yaml | 8 ++++++++ controllers/keystoneapi_controller.go | 2 ++ templates/keystoneapi/config/httpd.conf | 2 +- 6 files changed, 31 insertions(+), 1 deletion(-) diff --git a/api/bases/keystone.openstack.org_keystoneapis.yaml b/api/bases/keystone.openstack.org_keystoneapis.yaml index f460b115..ba79289c 100644 --- a/api/bases/keystone.openstack.org_keystoneapis.yaml +++ b/api/bases/keystone.openstack.org_keystoneapis.yaml @@ -310,6 +310,14 @@ spec: description: PreserveJobs - do not delete jobs after they finished e.g. to check logs type: boolean + processNumber: + default: 3 + description: Processumber - Number of processes running in keystone + API + format: int32 + maximum: 10 + minimum: 1 + type: integer rabbitMqClusterName: default: rabbitmq description: RabbitMQ instance name Needed to request a transportURL diff --git a/api/v1beta1/keystoneapi_types.go b/api/v1beta1/keystoneapi_types.go index a4c9b3cc..c193e011 100644 --- a/api/v1beta1/keystoneapi_types.go +++ b/api/v1beta1/keystoneapi_types.go @@ -95,6 +95,13 @@ type KeystoneAPISpecCore struct { // Replicas of keystone API to run Replicas *int32 `json:"replicas"` + // +kubebuilder:validation:Optional + // +kubebuilder:default=3 + // +kubebuilder:validation:Maximum=10 + // +kubebuilder:validation:Minimum=1 + // Processumber - Number of processes running in keystone API + ProcessNumber *int32 `json:"processNumber"` + // +kubebuilder:validation:Required // Secret containing OpenStack password information for keystone AdminPassword Secret string `json:"secret"` diff --git a/api/v1beta1/zz_generated.deepcopy.go b/api/v1beta1/zz_generated.deepcopy.go index 7ee47492..f8e9e68e 100644 --- a/api/v1beta1/zz_generated.deepcopy.go +++ b/api/v1beta1/zz_generated.deepcopy.go @@ -147,6 +147,11 @@ func (in *KeystoneAPISpecCore) DeepCopyInto(out *KeystoneAPISpecCore) { *out = new(int32) **out = **in } + if in.ProcessNumber != nil { + in, out := &in.ProcessNumber, &out.ProcessNumber + *out = new(int32) + **out = **in + } if in.FernetRotationDays != nil { in, out := &in.FernetRotationDays, &out.FernetRotationDays *out = new(int32) diff --git a/config/crd/bases/keystone.openstack.org_keystoneapis.yaml b/config/crd/bases/keystone.openstack.org_keystoneapis.yaml index f460b115..ba79289c 100644 --- a/config/crd/bases/keystone.openstack.org_keystoneapis.yaml +++ b/config/crd/bases/keystone.openstack.org_keystoneapis.yaml @@ -310,6 +310,14 @@ spec: description: PreserveJobs - do not delete jobs after they finished e.g. to check logs type: boolean + processNumber: + default: 3 + description: Processumber - Number of processes running in keystone + API + format: int32 + maximum: 10 + minimum: 1 + type: integer rabbitMqClusterName: default: rabbitmq description: RabbitMQ instance name Needed to request a transportURL diff --git a/controllers/keystoneapi_controller.go b/controllers/keystoneapi_controller.go index 1ce29856..88a3fbe6 100644 --- a/controllers/keystoneapi_controller.go +++ b/controllers/keystoneapi_controller.go @@ -1178,6 +1178,7 @@ func (r *KeystoneAPIReconciler) generateServiceConfigMaps( databaseAccount := db.GetAccount() dbSecret := db.GetSecret() + processNumber := instance.Spec.ProcessNumber templateParameters := map[string]interface{}{ "memcachedServers": mc.GetMemcachedServerListString(), @@ -1190,6 +1191,7 @@ func (r *KeystoneAPIReconciler) generateServiceConfigMaps( keystone.DatabaseName, ), "enableSecureRBAC": instance.Spec.EnableSecureRBAC, + "ProcessNumber": processNumber, } // create httpd vhost template parameters diff --git a/templates/keystoneapi/config/httpd.conf b/templates/keystoneapi/config/httpd.conf index 2046181e..641b6ddf 100644 --- a/templates/keystoneapi/config/httpd.conf +++ b/templates/keystoneapi/config/httpd.conf @@ -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