Skip to content

Commit ff4e2c5

Browse files
MOS CIGerrit Code Review
authored andcommitted
Merge "[horizon] Store auth session in database"
2 parents 2e7e725 + b39f7f7 commit ff4e2c5

10 files changed

Lines changed: 169 additions & 24 deletions

File tree

charts/openstack/horizon/values.yaml

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,20 @@ conf:
278278
enabled: False
279279
version: "5.1"
280280
dashboard_name: "tf_dashboard.overrides"
281+
installed_apps:
282+
- openstack_dashboard
283+
- django.contrib.contenttypes
284+
- django.contrib.auth
285+
- django.contrib.sessions
286+
- django.contrib.messages
287+
- django.contrib.staticfiles
288+
- django.contrib.humanize
289+
- debreach
290+
- compressor
291+
- horizon
292+
- openstack_auth
293+
session:
294+
engine: "django.contrib.sessions.backends.db"
281295
cache:
282296
backend: "django.core.cache.backends.memcached.MemcachedCache"
283297
# Pass any settings to the end of local_settings.py
@@ -427,29 +441,21 @@ conf:
427441
'KEY_PREFIX': '{{ (split ":" .Values.images.tags.horizon)._1 }}'
428442
}
429443
}
444+
INSTALLED_APPS = {{ toJson .Values.conf.horizon.local_settings.config.installed_apps }}
430445
# DATABASES section is commented because we don't use mysql as horizon backend
431-
#DATABASES = {
432-
# 'default': {
433-
# # Database configuration here
434-
# 'ENGINE': 'django.db.backends.mysql',
435-
# 'NAME': '{{ .Values.endpoints.oslo_db.path | base }}',
436-
# 'USER': '{{ .Values.endpoints.oslo_db.auth.horizon.username }}',
437-
# 'PASSWORD': '{{ .Values.endpoints.oslo_db.auth.horizon.password }}',
438-
# 'HOST': '{{ tuple "oslo_db" "internal" . | include "helm-toolkit.endpoints.hostname_fqdn_endpoint_lookup" }}',
439-
# 'default-character-set': 'utf8',
440-
# {{- if .Values.manifests.certificates }}
441-
# 'OPTIONS':{
442-
# 'ssl': {
443-
# 'ca': '/etc/mysql/certs/ca.crt',
444-
# 'cert': '/etc/mysql/certs/tls.crt',
445-
# 'key': '/etc/mysql/certs/tls.key'
446-
# }
447-
# },
448-
# {{- end }}
449-
# 'PORT': '{{ tuple "oslo_db" "internal" "mysql" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}'
450-
# }
451-
#}
452-
SESSION_ENGINE = 'django.contrib.sessions.backends.cache'
446+
DATABASES = {
447+
'default': {
448+
# Database configuration here
449+
'ENGINE': 'django.db.backends.mysql',
450+
'NAME': '{{ .Values.endpoints.oslo_db.path | base }}',
451+
'USER': '{{ .Values.endpoints.oslo_db.auth.horizon.username }}',
452+
'PASSWORD': '{{ .Values.endpoints.oslo_db.auth.horizon.password }}',
453+
'HOST': '{{ tuple "oslo_db" "internal" . | include "helm-toolkit.endpoints.hostname_fqdn_endpoint_lookup" }}',
454+
'default-character-set': 'utf8',
455+
'PORT': '{{ tuple "oslo_db" "internal" "mysql" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}'
456+
}
457+
}
458+
SESSION_ENGINE = '{{ .Values.conf.horizon.local_settings.config.session.engine }}'
453459
454460
# Send email to the console by default
455461
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
@@ -1405,8 +1411,8 @@ manifests:
14051411
configmap_oslo_policy: true
14061412
deployment: true
14071413
ingress_api: true
1408-
job_db_init: false
1409-
job_db_sync: false
1414+
job_db_init: true
1415+
job_db_sync: true
14101416
job_db_drop: false
14111417
job_image_repo_sync: true
14121418
pdb: true

rockoon/templates/child_objects/dashboard.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ horizon:
88
horizon:
99
connections:
1010
egress:
11+
- {{ to_child_object("database", "mariadb", "StatefulSet", "mariadb-server", ["mysql"]) | indent(12)}}
1112
- {{ to_child_object("orchestration", "heat", "Deployment", "heat-api", ["h-api"]) | indent(12)}}
1213
- {{ to_child_object("orchestration", "heat", "Deployment", "heat-cfn", ["h-cfn"]) | indent(12)}}
1314
- {{ to_child_object("identity", "keystone", "Deployment", "keystone-api", ["ks-pub"]) | indent(12)}}
@@ -32,3 +33,29 @@ horizon:
3233
- name: web
3334
port: 4999
3435
protocol: TCP
36+
Job:
37+
horizon-db-init:
38+
hash_fields:
39+
- endpoints.oslo_db.*
40+
images:
41+
- db_init
42+
manifest: job_db_init
43+
pod_labels:
44+
application: horizon
45+
component: db-init
46+
connections:
47+
egress:
48+
- {{ to_child_object("database", "mariadb", "StatefulSet", "mariadb-server", ["mysql"]) | indent(12)}}
49+
horizon-db-sync:
50+
hash_fields:
51+
- endpoints.oslo_db.*
52+
- endpoints.oslo_messaging.*
53+
images:
54+
- horizon_db_sync
55+
manifest: job_db_sync
56+
pod_labels:
57+
application: horizon
58+
component: db-sync
59+
connections:
60+
egress:
61+
- {{ to_child_object("database", "mariadb", "StatefulSet", "mariadb-server", ["mysql"]) | indent(12)}}

rockoon/templates/services/dashboard.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,4 +382,20 @@ spec:
382382
{%- if OSVer[spec.openstack_version] >= OSVer.caracal %}
383383
cache:
384384
backend: "django.core.cache.backends.memcached.PyMemcacheCache"
385+
{%- endif %}
386+
installed_apps:
387+
- openstack_dashboard
388+
- django.contrib.contenttypes
389+
- django.contrib.auth
390+
- django.contrib.sessions
391+
- django.contrib.messages
392+
- django.contrib.staticfiles
393+
- django.contrib.humanize
394+
- debreach
395+
- compressor
396+
- horizon
397+
- openstack_auth
398+
{%- if OSVer[spec.openstack_version] <= OSVer.antelope %}
399+
- openstack_dashboard.django_pyscss_fix
400+
- django_pyscss
385401
{%- endif %}

tests/fixtures/network_policies/output/database.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,18 @@ database:mariadb:StatefulSet:mariadb-server:
156156
matchLabels:
157157
application: nova
158158
component: scheduler
159+
- podSelector:
160+
matchLabels:
161+
application: horizon
162+
component: server
163+
- podSelector:
164+
matchLabels:
165+
application: horizon
166+
component: db-init
167+
- podSelector:
168+
matchLabels:
169+
application: horizon
170+
component: db-sync
159171
- podSelector:
160172
matchLabels:
161173
application: mariadb

tests/fixtures/render_service_template/output/dashboard/antelope_ceph_local_non_dvr_keystone_federation.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,20 @@ spec:
206206
secure_proxy_ssl_header: true
207207
tungstenfabric:
208208
enabled: false
209+
installed_apps:
210+
- openstack_dashboard
211+
- django.contrib.contenttypes
212+
- django.contrib.auth
213+
- django.contrib.sessions
214+
- django.contrib.messages
215+
- django.contrib.staticfiles
216+
- django.contrib.humanize
217+
- debreach
218+
- compressor
219+
- horizon
220+
- openstack_auth
221+
- openstack_dashboard.django_pyscss_fix
222+
- django_pyscss
209223
auth:
210224
idp_mapping:
211225
- idp: keycloak

tests/fixtures/render_service_template/output/dashboard/ussuri_ceph_local_non_dvr.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,20 @@ spec:
5858
secure_proxy_ssl_header: true
5959
tungstenfabric:
6060
enabled: false
61+
installed_apps:
62+
- openstack_dashboard
63+
- django.contrib.contenttypes
64+
- django.contrib.auth
65+
- django.contrib.sessions
66+
- django.contrib.messages
67+
- django.contrib.staticfiles
68+
- django.contrib.humanize
69+
- debreach
70+
- compressor
71+
- horizon
72+
- openstack_auth
73+
- openstack_dashboard.django_pyscss_fix
74+
- django_pyscss
6175
custom_themes:
6276
mirantis:
6377
description: Mirantis

tests/fixtures/render_service_template/output/dashboard/ussuri_ceph_local_non_dvr_keycloak.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,20 @@ spec:
187187
secure_proxy_ssl_header: true
188188
tungstenfabric:
189189
enabled: false
190+
installed_apps:
191+
- openstack_dashboard
192+
- django.contrib.contenttypes
193+
- django.contrib.auth
194+
- django.contrib.sessions
195+
- django.contrib.messages
196+
- django.contrib.staticfiles
197+
- django.contrib.humanize
198+
- debreach
199+
- compressor
200+
- horizon
201+
- openstack_auth
202+
- openstack_dashboard.django_pyscss_fix
203+
- django_pyscss
190204
auth:
191205
idp_mapping:
192206
- idp: keycloak

tests/fixtures/render_service_template/output/dashboard/ussuri_ceph_local_non_dvr_local_proxy.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,20 @@ spec:
5858
secure_proxy_ssl_header: true
5959
tungstenfabric:
6060
enabled: false
61+
installed_apps:
62+
- openstack_dashboard
63+
- django.contrib.contenttypes
64+
- django.contrib.auth
65+
- django.contrib.sessions
66+
- django.contrib.messages
67+
- django.contrib.staticfiles
68+
- django.contrib.humanize
69+
- debreach
70+
- compressor
71+
- horizon
72+
- openstack_auth
73+
- openstack_dashboard.django_pyscss_fix
74+
- django_pyscss
6175
custom_themes:
6276
mirantis:
6377
description: Mirantis

tests/fixtures/render_service_template/output/dashboard/ussuri_ceph_local_non_dvr_policies.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,20 @@ spec:
8686
secure_proxy_ssl_header: true
8787
tungstenfabric:
8888
enabled: false
89+
installed_apps:
90+
- openstack_dashboard
91+
- django.contrib.contenttypes
92+
- django.contrib.auth
93+
- django.contrib.sessions
94+
- django.contrib.messages
95+
- django.contrib.staticfiles
96+
- django.contrib.humanize
97+
- debreach
98+
- compressor
99+
- horizon
100+
- openstack_auth
101+
- openstack_dashboard.django_pyscss_fix
102+
- django_pyscss
89103
custom_themes:
90104
mirantis:
91105
description: Mirantis

tests/fixtures/render_service_template/output/dashboard/ussuri_ceph_local_non_dvr_telemetry.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,20 @@ spec:
5858
secure_proxy_ssl_header: true
5959
tungstenfabric:
6060
enabled: false
61+
installed_apps:
62+
- openstack_dashboard
63+
- django.contrib.contenttypes
64+
- django.contrib.auth
65+
- django.contrib.sessions
66+
- django.contrib.messages
67+
- django.contrib.staticfiles
68+
- django.contrib.humanize
69+
- debreach
70+
- compressor
71+
- horizon
72+
- openstack_auth
73+
- openstack_dashboard.django_pyscss_fix
74+
- django_pyscss
6175
custom_themes:
6276
mirantis:
6377
description: Mirantis

0 commit comments

Comments
 (0)