Add mariadb database config override to support ipv6
Add "config_override" in conficonfigmap-etc.yaml for ipv6. It could not be dynamically override in helm/mariadb.py. Upstream patch: https://review.opendev.org/735277 Story: 2007474 Task: 39879 Depends-on: https://review.opendev.org/#/c/720135/ Change-Id: I9342e16fd98d0099e7e7043b46f00b2374203a51 Signed-off-by: Zhipeng Liu <zhipengs.liu@intel.com>
This commit is contained in:
parent
52a25e6eb4
commit
d3164c63dc
|
@ -25,6 +25,7 @@ Patch07: 0007-Fix-ipv6-address-issue-causing-mariadb-ingress-not-ready.patch
|
|||
Patch08: 0008-Fix-rabbitmq-could-not-bind-port-to-ipv6-address-iss.patch
|
||||
Patch09: 0009-Enable-override-of-mariadb-server-probe-parameters.patch
|
||||
Patch10: 0010-Mariadb-use-utf8_general_ci-collation-as-default.patch
|
||||
Patch11: 0011-Add-mariadb-database-config-override-to-support-ipv6.patch
|
||||
|
||||
BuildRequires: helm
|
||||
BuildRequires: chartmuseum
|
||||
|
@ -44,6 +45,7 @@ Openstack Helm Infra charts
|
|||
%patch08 -p1
|
||||
%patch09 -p1
|
||||
%patch10 -p1
|
||||
%patch11 -p1
|
||||
|
||||
%build
|
||||
# Host a server for the charts
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
From 64815b6eef92a949e607c7382ac3c93f568497c1 Mon Sep 17 00:00:00 2001
|
||||
From: "Liu, ZhipengS" <zhipengs.liu@intel.com>
|
||||
Date: Thu, 28 May 2020 08:03:42 +0000
|
||||
Subject: [PATCH] Add mariadb database config override to support ipv6
|
||||
|
||||
Signed-off-by: Liu, ZhipengS <zhipengs.liu@intel.com>
|
||||
---
|
||||
mariadb/templates/configmap-etc.yaml | 6 ++++++
|
||||
mariadb/templates/statefulset.yaml | 2 +-
|
||||
mariadb/values.yaml | 1 +
|
||||
3 files changed, 8 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/mariadb/templates/configmap-etc.yaml b/mariadb/templates/configmap-etc.yaml
|
||||
index feb1714..866028d 100644
|
||||
--- a/mariadb/templates/configmap-etc.yaml
|
||||
+++ b/mariadb/templates/configmap-etc.yaml
|
||||
@@ -26,6 +26,12 @@ data:
|
||||
{{- include "helm-toolkit.snippets.values_template_renderer" (dict "envAll" $envAll "template" ( index $envAll.Values.conf.database "00_base" ) "key" "00-base.cnf" ) | indent 2 }}
|
||||
{{- if $envAll.Values.conf.database.config_override }}
|
||||
{{- include "helm-toolkit.snippets.values_template_renderer" (dict "envAll" $envAll "template" ( index $envAll.Values.conf.database "config_override" ) "key" "20-override.cnf" ) | indent 2 }}
|
||||
+{{- else }}
|
||||
+{{- if $envAll.Values.manifests.config_ipv6 }}
|
||||
+ 20-override.cnf: |
|
||||
+ [mysqld]
|
||||
+ bind_address=::
|
||||
+{{- end }}
|
||||
{{- end }}
|
||||
{{- include "helm-toolkit.snippets.values_template_renderer" (dict "envAll" $envAll "template" ( index $envAll.Values.conf.database "99_force" ) "key" "99-force.cnf" ) | indent 2 }}
|
||||
{{- end }}
|
||||
diff --git a/mariadb/templates/statefulset.yaml b/mariadb/templates/statefulset.yaml
|
||||
index 83e135f..3ef7383 100644
|
||||
--- a/mariadb/templates/statefulset.yaml
|
||||
+++ b/mariadb/templates/statefulset.yaml
|
||||
@@ -216,7 +216,7 @@ spec:
|
||||
mountPath: /etc/mysql/conf.d/00-base.cnf
|
||||
subPath: 00-base.cnf
|
||||
readOnly: true
|
||||
- {{- if .Values.conf.database.config_override }}
|
||||
+ {{- if or (.Values.conf.database.config_override) (.Values.manifests.config_ipv6) }}
|
||||
- name: mariadb-etc
|
||||
mountPath: /etc/mysql/conf.d/20-override.cnf
|
||||
subPath: 20-override.cnf
|
||||
diff --git a/mariadb/values.yaml b/mariadb/values.yaml
|
||||
index 444bba3..880b31e 100644
|
||||
--- a/mariadb/values.yaml
|
||||
+++ b/mariadb/values.yaml
|
||||
@@ -550,3 +550,4 @@ manifests:
|
||||
service_error: true
|
||||
service: true
|
||||
statefulset: true
|
||||
+ config_ipv6: false
|
||||
--
|
||||
1.8.3.1
|
||||
|
|
@ -29,10 +29,8 @@ class MariadbHelm(openstack.OpenstackBaseHelm):
|
|||
}
|
||||
},
|
||||
'endpoints': self._get_endpoints_overrides(),
|
||||
'conf': {
|
||||
'database': {
|
||||
'config_override': self._get_database_config_override()
|
||||
}
|
||||
'manifests': {
|
||||
'config_ipv6': self._is_ipv6_cluster_service()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -45,18 +43,6 @@ class MariadbHelm(openstack.OpenstackBaseHelm):
|
|||
else:
|
||||
return overrides
|
||||
|
||||
def _get_database_config_override(self):
|
||||
listen_host = "0.0.0.0"
|
||||
if self._is_ipv6_cluster_service():
|
||||
listen_host = "::"
|
||||
return "[mysqld]\n" \
|
||||
"bind_address=::\n" \
|
||||
"wsrep_provider_options=\"evs.suspect_timeout=PT30S; " \
|
||||
"gmcast.peer_timeout=PT15S; " \
|
||||
"gmcast.listen_addr=tcp://%s:{{ tuple \"oslo_db\" " \
|
||||
"\"direct\" \"wsrep\" . | " \
|
||||
"include \"helm-toolkit.endpoints.endpoint_port_lookup\" }}\"" % listen_host
|
||||
|
||||
def _get_endpoints_overrides(self):
|
||||
return {
|
||||
'oslo_db': {
|
||||
|
|
Loading…
Reference in New Issue