Skip to content

Commit b2c718c

Browse files
committed
Make process number configurable
Signed-off-by: Veronika Fisarova <[email protected]>
1 parent 2e94eb1 commit b2c718c

File tree

7 files changed

+197
-1
lines changed

7 files changed

+197
-1
lines changed
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
diff --git a/api/bases/keystone.openstack.org_keystoneapis.yaml b/api/bases/keystone.openstack.org_keystoneapis.yaml
2+
index f460b11..a82074b 100644
3+
--- a/api/bases/keystone.openstack.org_keystoneapis.yaml
4+
+++ b/api/bases/keystone.openstack.org_keystoneapis.yaml
5+
@@ -103,6 +103,17 @@ spec:
6+
format: int32
7+
minimum: 1
8+
type: integer
9+
+ httpdCustomization:
10+
+ description: HttpdCustomization - customize the httpd service
11+
+ properties:
12+
+ processNumber:
13+
+ default: 3
14+
+ description: ProcessNumber - Number of processes running in keystone
15+
+ API
16+
+ format: int32
17+
+ minimum: 1
18+
+ type: integer
19+
+ type: object
20+
memcachedInstance:
21+
default: memcached
22+
description: Memcached instance name.
23+
diff --git a/api/v1beta1/keystoneapi_types.go b/api/v1beta1/keystoneapi_types.go
24+
index a4c9b3c..29dd60d 100644
25+
--- a/api/v1beta1/keystoneapi_types.go
26+
+++ b/api/v1beta1/keystoneapi_types.go
27+
@@ -157,6 +157,10 @@ type KeystoneAPISpecCore struct {
28+
// TODO: -> implement
29+
DefaultConfigOverwrite map[string]string `json:"defaultConfigOverwrite,omitempty"`
30+

31+
+ // +kubebuilder:validation:Optional
32+
+ // HttpdCustomization - customize the httpd service
33+
+ HttpdCustomization HttpdCustomization `json:"httpdCustomization,omitempty"`
34+
+
35+
// +kubebuilder:validation:Optional
36+
// Resources - Compute Resources required by this service (Limits/Requests).
37+
// https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
38+
@@ -197,6 +201,15 @@ type PasswordSelector struct {
39+
Admin string `json:"admin"`
40+
}
41+

42+
+// HttpdCustomization - customize the httpd service
43+
+type HttpdCustomization struct {
44+
+ // +kubebuilder:validation:Optional
45+
+ // +kubebuilder:default=3
46+
+ // +kubebuilder:validation:Minimum=1
47+
+ // ProcessNumber - Number of processes running in keystone API
48+
+ ProcessNumber *int32 `json:"processNumber"`
49+
+}
50+
+
51+
// KeystoneAPIStatus defines the observed state of KeystoneAPI
52+
type KeystoneAPIStatus struct {
53+
// ReadyCount of keystone API instances
54+
diff --git a/api/v1beta1/zz_generated.deepcopy.go b/api/v1beta1/zz_generated.deepcopy.go
55+
index 7ee4749..da70b75 100644
56+
--- a/api/v1beta1/zz_generated.deepcopy.go
57+
+++ b/api/v1beta1/zz_generated.deepcopy.go
58+
@@ -49,6 +49,26 @@ func (in *APIOverrideSpec) DeepCopy() *APIOverrideSpec {
59+
return out
60+
}
61+

62+
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
63+
+func (in *HttpdCustomization) DeepCopyInto(out *HttpdCustomization) {
64+
+ *out = *in
65+
+ if in.ProcessNumber != nil {
66+
+ in, out := &in.ProcessNumber, &out.ProcessNumber
67+
+ *out = new(int32)
68+
+ **out = **in
69+
+ }
70+
+}
71+
+
72+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HttpdCustomization.
73+
+func (in *HttpdCustomization) DeepCopy() *HttpdCustomization {
74+
+ if in == nil {
75+
+ return nil
76+
+ }
77+
+ out := new(HttpdCustomization)
78+
+ in.DeepCopyInto(out)
79+
+ return out
80+
+}
81+
+
82+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
83+
func (in *KeystoneAPI) DeepCopyInto(out *KeystoneAPI) {
84+
*out = *in
85+
@@ -172,6 +192,7 @@ func (in *KeystoneAPISpecCore) DeepCopyInto(out *KeystoneAPISpecCore) {
86+
(*out)[key] = val
87+
}
88+
}
89+
+ in.HttpdCustomization.DeepCopyInto(&out.HttpdCustomization)
90+
in.Resources.DeepCopyInto(&out.Resources)
91+
if in.NetworkAttachments != nil {
92+
in, out := &in.NetworkAttachments, &out.NetworkAttachments
93+
diff --git a/config/crd/bases/keystone.openstack.org_keystoneapis.yaml b/config/crd/bases/keystone.openstack.org_keystoneapis.yaml
94+
index f460b11..a82074b 100644
95+
--- a/config/crd/bases/keystone.openstack.org_keystoneapis.yaml
96+
+++ b/config/crd/bases/keystone.openstack.org_keystoneapis.yaml
97+
@@ -103,6 +103,17 @@ spec:
98+
format: int32
99+
minimum: 1
100+
type: integer
101+
+ httpdCustomization:
102+
+ description: HttpdCustomization - customize the httpd service
103+
+ properties:
104+
+ processNumber:
105+
+ default: 3
106+
+ description: ProcessNumber - Number of processes running in keystone
107+
+ API
108+
+ format: int32
109+
+ minimum: 1
110+
+ type: integer
111+
+ type: object
112+
memcachedInstance:
113+
default: memcached
114+
description: Memcached instance name.
115+
diff --git a/controllers/keystoneapi_controller.go b/controllers/keystoneapi_controller.go
116+
index 1ce2985..0df5e1a 100644
117+
--- a/controllers/keystoneapi_controller.go
118+
+++ b/controllers/keystoneapi_controller.go
119+
@@ -1190,6 +1190,7 @@ func (r *KeystoneAPIReconciler) generateServiceConfigMaps(
120+
keystone.DatabaseName,
121+
),
122+
"enableSecureRBAC": instance.Spec.EnableSecureRBAC,
123+
+ "ProcessNumber": instance.Spec.HttpdCustomization.ProcessNumber,
124+
}
125+

126+
// create httpd vhost template parameters
127+
diff --git a/templates/keystoneapi/config/httpd.conf b/templates/keystoneapi/config/httpd.conf
128+
index 2046181..641b6dd 100644
129+
--- a/templates/keystoneapi/config/httpd.conf
130+
+++ b/templates/keystoneapi/config/httpd.conf
131+
@@ -53,7 +53,7 @@ CustomLog /dev/stdout proxy env=forwarded
132+

133+
## WSGI configuration
134+
WSGIApplicationGroup %{GLOBAL}
135+
- WSGIDaemonProcess {{ $endpt }} display-name={{ $endpt }} group=keystone processes=3 threads=1 user=keystone
136+
+ WSGIDaemonProcess {{ $endpt }} display-name={{ $endpt }} group=keystone processes={{ $.ProcessNumber }} threads=1 user=keystone
137+
WSGIProcessGroup {{ $endpt }}
138+
WSGIScriptAlias / "/usr/bin/keystone-wsgi-public"
139+
WSGIPassAuthorization On

api/bases/keystone.openstack.org_keystoneapis.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,17 @@ spec:
103103
format: int32
104104
minimum: 1
105105
type: integer
106+
httpdCustomization:
107+
description: HttpdCustomization - customize the httpd service
108+
properties:
109+
processNumber:
110+
default: 3
111+
description: ProcessNumber - Number of processes running in keystone
112+
API
113+
format: int32
114+
minimum: 1
115+
type: integer
116+
type: object
106117
memcachedInstance:
107118
default: memcached
108119
description: Memcached instance name.

api/v1beta1/keystoneapi_types.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,10 @@ type KeystoneAPISpecCore struct {
157157
// TODO: -> implement
158158
DefaultConfigOverwrite map[string]string `json:"defaultConfigOverwrite,omitempty"`
159159

160+
// +kubebuilder:validation:Optional
161+
// HttpdCustomization - customize the httpd service
162+
HttpdCustomization HttpdCustomization `json:"httpdCustomization,omitempty"`
163+
160164
// +kubebuilder:validation:Optional
161165
// Resources - Compute Resources required by this service (Limits/Requests).
162166
// https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
@@ -197,6 +201,15 @@ type PasswordSelector struct {
197201
Admin string `json:"admin"`
198202
}
199203

204+
// HttpdCustomization - customize the httpd service
205+
type HttpdCustomization struct {
206+
// +kubebuilder:validation:Optional
207+
// +kubebuilder:default=3
208+
// +kubebuilder:validation:Minimum=1
209+
// ProcessNumber - Number of processes running in keystone API
210+
ProcessNumber *int32 `json:"processNumber"`
211+
}
212+
200213
// KeystoneAPIStatus defines the observed state of KeystoneAPI
201214
type KeystoneAPIStatus struct {
202215
// ReadyCount of keystone API instances

api/v1beta1/zz_generated.deepcopy.go

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/keystone.openstack.org_keystoneapis.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,17 @@ spec:
103103
format: int32
104104
minimum: 1
105105
type: integer
106+
httpdCustomization:
107+
description: HttpdCustomization - customize the httpd service
108+
properties:
109+
processNumber:
110+
default: 3
111+
description: ProcessNumber - Number of processes running in keystone
112+
API
113+
format: int32
114+
minimum: 1
115+
type: integer
116+
type: object
106117
memcachedInstance:
107118
default: memcached
108119
description: Memcached instance name.

controllers/keystoneapi_controller.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,6 +1190,7 @@ func (r *KeystoneAPIReconciler) generateServiceConfigMaps(
11901190
keystone.DatabaseName,
11911191
),
11921192
"enableSecureRBAC": instance.Spec.EnableSecureRBAC,
1193+
"ProcessNumber": instance.Spec.HttpdCustomization.ProcessNumber,
11931194
}
11941195

11951196
// create httpd vhost template parameters

templates/keystoneapi/config/httpd.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ CustomLog /dev/stdout proxy env=forwarded
5353

5454
## WSGI configuration
5555
WSGIApplicationGroup %{GLOBAL}
56-
WSGIDaemonProcess {{ $endpt }} display-name={{ $endpt }} group=keystone processes=3 threads=1 user=keystone
56+
WSGIDaemonProcess {{ $endpt }} display-name={{ $endpt }} group=keystone processes={{ $.ProcessNumber }} threads=1 user=keystone
5757
WSGIProcessGroup {{ $endpt }}
5858
WSGIScriptAlias / "/usr/bin/keystone-wsgi-public"
5959
WSGIPassAuthorization On

0 commit comments

Comments
 (0)