openstack-armada-app/openstack-helm-infra/files/0011-Add-mariadb-database-config-override-to-support-ipv6.patch
Zhipeng Liu 2496a170fe Fix the second mariadb node could not join cluster issue.
This bug was introduced by below commit
d3164c63dc
The update after PATCH SET 10 will cause the second mariadb could not
join cluster. In this case, could not set bind_address=:: for ipv4. It
only works for ipv6.

As for conf.database.config_override, we can override it through
system helm-override-update command, but could not use python
plugin to dynamically override it as it will introduce a "-|" line
in first line of config file.
A user override for conf.database.config_override might break the IPv6
system overrides, it need including ipv6 config for ipv6 case as well.

Test pass on duplex setup. Openstack application applied successfully.

Closes-Bug: 1886003

Change-Id: I23c2fb6a7c8b5a38af1e046894d5fae247df2d6f
Signed-off-by: Zhipeng Liu <zhipengs.liu@intel.com>
2020-07-07 17:23:41 +08:00

57 lines
2.5 KiB
Diff

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 | 8 ++++++++
mariadb/templates/statefulset.yaml | 2 +-
mariadb/values.yaml | 1 +
3 files changed, 10 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,14 @@ 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 }}
+# A user override for conf.database.config_override might break the IPv6 system overrides, need including below ipv6
+# config for ipv6 case in user override as well.
+{{- 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