物理機掛載路徑
/data/mysql/data
DeploymentapiVersion: extensions/v1beta1kind: Deploymentmetadata: name: my-mysqlspec: replicas: 1# selector:# app: my-mysql template: metadata: labels: app: my-mysql spec: containers: - name: my-mysql image: bitnami/mysql:8.0.18-debian-9-r26 imagePullPolicy: IfNotPresent env: - name: MYSQL_ROOT_PASSWORD value: "admin" ports: - containerPort: 8123 volumeMounts: - mountPath: /bitnami/mysql/data/ name: mysql-data - mountPath: "/opt/bitnami/mysql/conf" name: cm-mysql-configfiles volumes: - name: cm-mysql-configfiles configMap: name: cm-mysql-configfiles items: - key: key-mysql-conf2 path: my.cnf - name: mysql-data hostPath: path: /data/mysql/data type: "" name: mysql-data
ServiceapiVersion: v1kind: Servicemetadata: name: my-mysqlspec: type: NodePort ports: - name: http protocol: TCP port: 3306 nodePort: 43306# - name: device# protocol: tcp# port: 9000# nodePort: 49000 selector: app: my-mysql
ConfigMap
apiVersion: v1kind: ConfigMapmetadata: name: cm-mysql-configfilesdata: key-mysql-conf: | external_domain_name xxxxxx external_domain_name xxxxxx key-mysql-conf2: |- [mysqld] default_authentication_plugin=mysql_native_password skip-name-resolve explicit_defaults_for_timestamp basedir=/opt/bitnami/mysql plugin_dir=/opt/bitnami/mysql/plugin port=3306 socket=/opt/bitnami/mysql/tmp/mysql.sock tmpdir=/opt/bitnami/mysql/tmp max_allowed_packet=16M bind-address=0.0.0.0 pid-file=/opt/bitnami/mysql/tmp/mysqld.pid log-error=/opt/bitnami/mysql/logs/mysqld.log character-set-server=UTF8 collation-server=utf8_general_ci max_connections=2000 max_user_connections=850 max_connect_errors=1000 max_allowed_packet=100M [client] port=3306 socket=/opt/bitnami/mysql/tmp/mysql.sock default-character-set=UTF8 plugin_dir=/opt/bitnami/mysql/plugin [manager] port=3306 socket=/opt/bitnami/mysql/tmp/mysql.sock pid-file=/opt/bitnami/mysql/tmp/mysqld.pid
最新評論