<p>This is my configMap. I'm trying to specify [mysqld] config, but when I use this file alone with</p>
<pre><code>helm upgrade -i eramba bitnami/mariadb --set auth.rootPassword=eramba,auth.database=erambadb,initdbScriptsConfigMap=eramba,volumePermissions.enabled=true,primary.persistence.existingClaim=eramba-storage --namespace eramba-1 --set mariadb.volumePermissions.enabled=true
</code></pre>
<p>I don't see the specified configurations in my db pod; however, I do see the c2.8.1.sql file applied tho.</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
  name: eramba
  namespace: eramba-1
data:
  my.cnf: |-
    [mysqld] 
    max_connections = 2000
    sql_mode=&quot;&quot;
    max_allowed_packet=&quot;128000000&quot;
    innodb_lock_wait_timeout=&quot;200&quot;
  c2.8.1.sql: |
    CREATE DATABASE IF NOT EXISTS erambadb;
    #create user 'erambauser'@'eramba-mariadb' identified by 'erambapassword';
    #grant all on erambadb.* to 'erambauser'@'eramba-mariadb';
    #flush privileges;
    USE erambadb;
    #
    # SQL Export
    # Created by Querious (201067)
    # Created: 22 October 2019 at 17:39:48 CEST
    # Encoding: Unicode (UTF-8)
    #
    
    SET @PREVIOUS_FOREIGN_KEY_CHECKS = @@FOREIGN_KEY_CHECKS;
    SET FOREIGN_KEY_CHECKS = 0;
    .....
</code></pre>

<p>If you look at <a href="https://github.com/bitnami/charts/blob/master/bitnami/mariadb/values.yaml" rel="nofollow noreferrer">values.yaml</a> file for MariaDB helm chart, you can see 3 types of ConfigMap:</p>
<ul>
<li>initdbScriptsConfigMap - to supply Init scripts to be run at first boot of DB instance</li>
<li>primary.existingConfigmap - to control MariaDB Primary instance configuration</li>
<li>secondary.existingConfigmap - to control MariaDB Secondary instance configuration</li>
</ul>
<p>Thus, each of them is intended for the specific purpose and it is not a good idea to mix these settings in one ConfigMap.</p>
<p>I recommend you to create new ConfigMap eramba2 for custom <code>my.cnf</code> with all necessary values (not only new) as below.</p>
<pre><code>    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: eramba2
      namespace: eramba-1
    data:
      my.cnf: |-
        [mysqld]
        skip-name-resolve
        explicit_defaults_for_timestamp
        max_connections = 2000
        sql_mode=&quot;&quot;
        innodb_lock_wait_timeout=&quot;200&quot;
        basedir=/opt/bitnami/mariadb
        plugin_dir=/opt/bitnami/mariadb/plugin
        port=3306
        socket=/opt/bitnami/mariadb/tmp/mysql.sock
        tmpdir=/opt/bitnami/mariadb/tmp
        max_allowed_packet=128000000
        bind-address=::
        pid-file=/opt/bitnami/mariadb/tmp/mysqld.pid
        log-error=/opt/bitnami/mariadb/logs/mysqld.log
        character-set-server=UTF8
        collation-server=utf8_general_ci
    
        [client]
        port=3306
        socket=/opt/bitnami/mariadb/tmp/mysql.sock
        default-character-set=UTF8
        plugin_dir=/opt/bitnami/mariadb/plugin
    
        [manager]
        port=3306
        socket=/opt/bitnami/mariadb/tmp/mysql.sock
        pid-file=/opt/bitnami/mariadb/tmp/mysqld.pid
</code></pre>
<p>Create eramba2 ConfigMap:</p>
<pre><code>kubectl create -f eramba2.yaml
</code></pre>
<p>And then create MariaDB with helm using new ConfigMap eramba2:</p>
<pre><code>helm upgrade -i eramba bitnami/mariadb --set auth.rootPassword=eramba,auth.database=erambadb,initdbScriptsConfigMap=eramba,volumePermissions.enabled=true,primary.persistence.existingClaim=eramba-storage,mariadb.volumePermissions.enabled=true,primary.existingConfigmap=eramba2 --namespace eramba-1
</code></pre>
<p>Connect to pod:</p>
<pre><code>kubectl exec -it eramba-mariadb-0 -- /bin/bash
</code></pre>
<p>Check my.cnf file:</p>
<pre><code>cat /opt/bitnami/mariadb/conf/my.cnf
</code></pre>
