K8S configuration mysql configuration file does not deal with the entry into force

Rancher 2.x platform

The problem is, a test of the need to open the mysql binlog log, I'm thinking this is not a very simple thing -

Thus, the configuration of a config, mysql mount the corresponding profile, and re-deploy at ~
However a look into the container, is mounted on the profile, but failed to take effect configuration. .

details as follows:

1, because of the use Rancher platform, so the configuration and mount this step is carried out in a web end (curse.).

That added a configmap, overwrite the original configuration file:

# Enable the binlog log configuration file ~

[mysqld]
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
datadir = /var/lib/mysql
#log-error = /var/log/mysql/error.log
#By default we only accept connections from localhost
#bind-address = 127.0.0.1
#Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
log-bin=/var/lib/mysql/mysql-bin
server-id=1

Mount /etc/mysql/mysql.conf.d/ mysql under overwritten mysqld.cnf

2, then the goose did not take effect, the configuration file does mount, and a little cynicism ...
3, then modify other configuration, modify other configuration view is not binlog configuration problems (cynicism.)
That just changed the path datadir :

[mysqld]
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
datadir = /home/mysql
#log-error = /var/log/mysql/error.log
#By default we only accept connections from localhost
#bind-address = 127.0.0.1
#Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
log-bin=/var/lib/mysql/mysql-bin
server-id=1

4, and then find the configuration file is still mounted, this did not take effect! ! !
5, view yaml file as follows:

 - configMap:
          defaultMode: 292
          name: mysql-config
          optional: false
        name: vol1

查看configMap的defaultMode:
kubectl explain deployment.spec.template.spec.volumes.configmag

defaultMode <integer>
Optional: mode bits to use on created files by default. Must be a value
between 0 and 0777. Defaults to 0644. Directories within the path are not
affected by this setting. This might be in conflict with other options that
affect the file mode, like fsGroup, and the result can be other mode bits
set.

After 6, the control look and found Rancher default mode is 400, modified to 644, redeploy it ~!

Before nginx configuration uses the default mode 400 can take effect, mysql configuration file can not ~

Guess you like

Origin blog.51cto.com/bilibili/2447555