Use more standard configs for DBs.
This propose to changes some Barbican and Manila settings. To use more standard configs for Barbican DB connection and for DB drop job in Both Barbican and Manila wich you can reference same setting from cinder/templates/job-db-drop.yaml . Change-Id: I1be6fc2676363b1348b5bcf4c9433cdcd7ec8a63
This commit is contained in:
parent
79d4b68951
commit
b6f5515ea6
@ -33,7 +33,7 @@ class KekRewrap(object):
|
|||||||
|
|
||||||
def __init__(self, conf, old_kek):
|
def __init__(self, conf, old_kek):
|
||||||
self.dry_run = False
|
self.dry_run = False
|
||||||
self.db_engine = session.create_engine(conf.sql_connection)
|
self.db_engine = session.create_engine(conf.database.connection or conf.sql_connection)
|
||||||
self._session_creator = scoping.scoped_session(
|
self._session_creator = scoping.scoped_session(
|
||||||
orm.sessionmaker(
|
orm.sessionmaker(
|
||||||
bind=self.db_engine,
|
bind=self.db_engine,
|
||||||
|
@ -49,12 +49,12 @@ limitations under the License.
|
|||||||
{{- $_ := set .Values.conf.barbican.keystone_authtoken "memcache_secret_key" ( default ( randAlphaNum 64 ) .Values.endpoints.oslo_cache.auth.memcache_secret_key ) -}}
|
{{- $_ := set .Values.conf.barbican.keystone_authtoken "memcache_secret_key" ( default ( randAlphaNum 64 ) .Values.endpoints.oslo_cache.auth.memcache_secret_key ) -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- if empty .Values.conf.barbican.DEFAULT.sql_connection -}}
|
{{- if empty .Values.conf.barbican.database.connection -}}
|
||||||
{{- $connection := tuple "oslo_db" "internal" "barbican" "mysql" . | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup" -}}
|
{{- $connection := tuple "oslo_db" "internal" "barbican" "mysql" . | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup" -}}
|
||||||
{{- if .Values.manifests.certificates -}}
|
{{- if .Values.manifests.certificates -}}
|
||||||
{{- $_ := (printf "%s?charset=utf8&ssl_ca=/etc/mysql/certs/ca.crt&ssl_key=/etc/mysql/certs/tls.key&ssl_cert=/etc/mysql/certs/tls.crt&ssl_verify_cert" $connection ) | set .Values.conf.barbican.DEFAULT "sql_connection" -}}
|
{{- $_ := (printf "%s?charset=utf8&ssl_ca=/etc/mysql/certs/ca.crt&ssl_key=/etc/mysql/certs/tls.key&ssl_cert=/etc/mysql/certs/tls.crt&ssl_verify_cert" $connection ) | set .Values.conf.barbican.database "connection" -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- $_ := set .Values.conf.barbican.DEFAULT "sql_connection" $connection -}}
|
{{- $_ := set .Values.conf.barbican.database "connection" $connection -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
@ -13,11 +13,9 @@ limitations under the License.
|
|||||||
*/}}
|
*/}}
|
||||||
|
|
||||||
{{- if .Values.manifests.job_db_drop }}
|
{{- if .Values.manifests.job_db_drop }}
|
||||||
{{- $serviceName := "barbican" -}}
|
{{- $dbDropJob := dict "envAll" . "serviceName" "barbican" -}}
|
||||||
{{- $dbToDrop := dict "adminSecret" .Values.secrets.oslo_db.admin "configFile" (printf "/etc/%s/%s.conf" $serviceName $serviceName ) "logConfigFile" (printf "/etc/%s/logging.conf" $serviceName ) "configDbSection" "DEFAULT" "configDbKey" "sql_connection" -}}
|
|
||||||
{{- $dbDropJob := dict "envAll" . "serviceName" $serviceName "dbToDrop" $dbToDrop -}}
|
|
||||||
{{- if .Values.manifests.certificates -}}
|
{{- if .Values.manifests.certificates -}}
|
||||||
{{- $_ := set $dbToDrop "dbAdminTlsSecret" .Values.endpoints.oslo_db.auth.admin.secret.tls.internal -}}
|
{{- $_ := set $dbDropJob "dbAdminTlsSecret" .Values.endpoints.oslo_db.auth.admin.secret.tls.internal -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- if .Values.pod.tolerations.barbican.enabled -}}
|
{{- if .Values.pod.tolerations.barbican.enabled -}}
|
||||||
{{- $_ := set $dbDropJob "tolerationsEnabled" true -}}
|
{{- $_ := set $dbDropJob "tolerationsEnabled" true -}}
|
||||||
|
@ -13,19 +13,18 @@ limitations under the License.
|
|||||||
*/}}
|
*/}}
|
||||||
|
|
||||||
{{- define "metadata.annotations.job.db_init" }}
|
{{- define "metadata.annotations.job.db_init" }}
|
||||||
{{- if .Values.helm3_hook }}
|
|
||||||
helm.sh/hook: post-install,post-upgrade
|
helm.sh/hook: post-install,post-upgrade
|
||||||
helm.sh/hook-weight: "-5"
|
helm.sh/hook-weight: "-5"
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
{{- if .Values.manifests.job_db_init }}
|
{{- if .Values.manifests.job_db_init }}
|
||||||
{{- $serviceName := "barbican" -}}
|
{{- $dbInitJob := dict "envAll" . "serviceName" "barbican" -}}
|
||||||
{{- $dbToInit := dict "adminSecret" .Values.secrets.oslo_db.admin "configFile" (printf "/etc/%s/%s.conf" $serviceName $serviceName ) "logConfigFile" (printf "/etc/%s/logging.conf" $serviceName ) "configDbSection" "DEFAULT" "configDbKey" "sql_connection" -}}
|
|
||||||
{{- $dbInitJob := dict "envAll" . "serviceName" $serviceName "dbToInit" $dbToInit "jobAnnotations" (include "metadata.annotations.job.db_init" . | fromYaml) -}}
|
|
||||||
{{- if .Values.manifests.certificates -}}
|
{{- if .Values.manifests.certificates -}}
|
||||||
{{- $_ := set $dbInitJob "dbAdminTlsSecret" .Values.endpoints.oslo_db.auth.admin.secret.tls.internal -}}
|
{{- $_ := set $dbInitJob "dbAdminTlsSecret" .Values.endpoints.oslo_db.auth.admin.secret.tls.internal -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
{{- if .Values.helm3_hook }}
|
||||||
|
{{- $_ := set $dbInitJob "jobAnnotations" (include "metadata.annotations.job.db_init" . | fromYaml) }}
|
||||||
|
{{- end }}
|
||||||
{{- if .Values.pod.tolerations.barbican.enabled -}}
|
{{- if .Values.pod.tolerations.barbican.enabled -}}
|
||||||
{{- $_ := set $dbInitJob "tolerationsEnabled" true -}}
|
{{- $_ := set $dbInitJob "tolerationsEnabled" true -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
@ -13,11 +13,9 @@ limitations under the License.
|
|||||||
*/}}
|
*/}}
|
||||||
|
|
||||||
{{- if .Values.manifests.job_db_drop }}
|
{{- if .Values.manifests.job_db_drop }}
|
||||||
{{- $serviceName := "manila" -}}
|
{{- $dbDropJob := dict "envAll" . "serviceName" "manila" -}}
|
||||||
{{- $dbToDrop := dict "adminSecret" .Values.secrets.oslo_db.admin "configFile" (printf "/etc/%s/%s.conf" $serviceName $serviceName ) "logConfigFile" (printf "/etc/%s/logging.conf" $serviceName ) "configDbSection" "DEFAULT" "configDbKey" "sql_connection" -}}
|
|
||||||
{{- $dbDropJob := dict "envAll" . "serviceName" $serviceName "dbToDrop" $dbToDrop -}}
|
|
||||||
{{- if .Values.manifests.certificates -}}
|
{{- if .Values.manifests.certificates -}}
|
||||||
{{- $_ := set $dbToDrop "dbAdminTlsSecret" .Values.endpoints.oslo_db.auth.admin.secret.tls.internal -}}
|
{{- $_ := set $dbDropJob "dbAdminTlsSecret" .Values.endpoints.oslo_db.auth.admin.secret.tls.internal -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- if .Values.pod.tolerations.manila.enabled -}}
|
{{- if .Values.pod.tolerations.manila.enabled -}}
|
||||||
{{- $_ := set $dbDropJob "tolerationsEnabled" true -}}
|
{{- $_ := set $dbDropJob "tolerationsEnabled" true -}}
|
||||||
|
4
releasenotes/notes/barbican-ead8061b2a6b1b1b.yaml
Normal file
4
releasenotes/notes/barbican-ead8061b2a6b1b1b.yaml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
barbican:
|
||||||
|
- Use more standard DB config setting
|
||||||
|
...
|
4
releasenotes/notes/manila-7bf5ad7472dbf691.yaml
Normal file
4
releasenotes/notes/manila-7bf5ad7472dbf691.yaml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
manila:
|
||||||
|
- Use more standard DB config setting
|
||||||
|
...
|
Loading…
x
Reference in New Issue
Block a user