Merge "Ironic: Move to use sqllite rather than mariadb"

This commit is contained in:
Zuul 2020-05-12 00:52:13 +00:00 committed by Gerrit Code Review
commit a6addc3873
9 changed files with 2 additions and 65 deletions

View File

@ -1,7 +0,0 @@
DELETE FROM mysql.user ;
CREATE USER 'ironic'@'localhost' identified by '$(MARIADB_PASSWORD)' ;
GRANT ALL on *.* TO 'ironic'@'localhost' WITH GRANT OPTION ;
DROP DATABASE IF EXISTS test ;
CREATE DATABASE IF NOT EXISTS ironic ;
FLUSH PRIVILEGES ;

View File

@ -5,7 +5,7 @@ transport_url = fake://
use_stderr = true use_stderr = true
listen_address = :: listen_address = ::
[database] [database]
connection = sqlite:///var/lib/ironic-inspector/ironic-inspector.db connection = sqlite:///shared/ironic-inspector.db
[discovery] [discovery]
enroll_node_driver = ipmi enroll_node_driver = ipmi
[ironic] [ironic]

View File

@ -29,7 +29,7 @@ send_sensor_data_interval = 160
api_url = http://$(PROVISIONING_IP):6385 api_url = http://$(PROVISIONING_IP):6385
bootloader = http://$(PROVISIONING_IP):80/uefi_esp.img bootloader = http://$(PROVISIONING_IP):80/uefi_esp.img
[database] [database]
connection = mysql+pymysql://ironic:$(MARIADB_PASSWORD)@localhost/ironic?charset=utf8 connection = sqlite:///shared/ironic.db
[deploy] [deploy]
default_boot_option = local default_boot_option = local
erase_devices_metadata_priority = 10 erase_devices_metadata_priority = 10

View File

@ -10,5 +10,3 @@ configMapGenerator:
- inspector.conf - inspector.conf
- inspector.ipxe - inspector.ipxe
- ironic.conf - ironic.conf
- my.cnf
- configure-mysql.sql

View File

@ -1,19 +0,0 @@
[server]
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
log-error=/var/log/mariadb/mariadb.log
pid-file=/run/mariadb/mariadb.pid
max_connections = 64
max_heap_table_size = 1M
innodb_buffer_pool_size = 5M
innodb_log_buffer_size = 512K
[galera]
[embedded]
[mariadb]
[mariadb-10.3]

View File

@ -9,4 +9,3 @@ configMapGenerator:
- init-bootstrap - init-bootstrap
- inspector-entrypoint - inspector-entrypoint
- ironic-entrypoint - ironic-entrypoint
- mariadb-entrypoint

View File

@ -1,18 +0,0 @@
#!/usr/bin/bash
PATH=$PATH:/usr/sbin/
DATADIR="/var/lib/mysql"
MARIADB_CONF_FILE="/etc/my.cnf.d/mariadb-server.cnf"
ln -sf /proc/self/fd/1 /var/log/mariadb/mariadb.log
if [ ! -d "${DATADIR}/mysql" ]; then
cp -f /shared/my.cnf $MARIADB_CONF_FILE
mysql_install_db --datadir="$DATADIR"
chown -R mysql "$DATADIR"
# mysqld_safe closes stdout/stderr if no bash options are set ($- == '')
# turn on tracing to prevent this
exec bash -x /usr/bin/mysqld_safe --init-file /shared/configure-mysql.sql
else
exec bash -x /usr/bin/mysqld_safe
fi

View File

@ -5,7 +5,6 @@ metadata:
labels: labels:
name: ironic-vars name: ironic-vars
data: data:
MARIADB_PASSWORD: "e8ca990d79d351eacda0"
PROVISIONING_IP: "192.168.10.100" PROVISIONING_IP: "192.168.10.100"
DHCP_RANGE: "192.168.10.200,192.168.10.250" DHCP_RANGE: "192.168.10.200,192.168.10.250"
PROVISIONING_INTERFACE: "pxe0" PROVISIONING_INTERFACE: "pxe0"

View File

@ -72,21 +72,6 @@ spec:
- name: ironic-entrypoints - name: ironic-entrypoints
mountPath: /bin/runhttpd mountPath: /bin/runhttpd
subPath: httpd-entrypoint subPath: httpd-entrypoint
- name: mariadb
image: "quay.io/metal3-io/ironic:latest"
imagePullPolicy: Always
command: ["/bin/runmariadb"]
securityContext:
privileged: true
volumeMounts:
- mountPath: "/shared"
name: ironic-storage
- mountPath: "/var/lib/mysql"
name: ironic-storage
subPath: mysql
- name: ironic-entrypoints
mountPath: /bin/runmariadb
subPath: mariadb-entrypoint
- name: ironic - name: ironic
image: "quay.io/metal3-io/ironic:latest" image: "quay.io/metal3-io/ironic:latest"
imagePullPolicy: Always imagePullPolicy: Always