diff --git a/templates/pxc/0/README.md b/templates/pxc/0/README.md new file mode 100644 index 0000000..520efe6 --- /dev/null +++ b/templates/pxc/0/README.md @@ -0,0 +1,13 @@ +# Percona XtraDB Cluster + +### Info: + +This template creates a Percona XtraDB Cluster on top of Rancher. + +When deployed from the catalog, a three node cluster is created with a database, root password, database user and password. The cluster is set up for replication between all of the nodes. Health check monitors port 8000 for clustercheck status updates. + +### Usage: + +Once deployed, use a mysql client to connect: + +`mysql -u -p -h` \ No newline at end of file diff --git a/templates/pxc/0/docker-compose.yml b/templates/pxc/0/docker-compose.yml new file mode 100644 index 0000000..80ed6fc --- /dev/null +++ b/templates/pxc/0/docker-compose.yml @@ -0,0 +1,41 @@ +pxc-clustercheck: + image: flowman/percona-xtradb-cluster-clustercheck:v2.0 + net: "container:pxc" + labels: + io.rancher.container.hostname_override: container_name + volumes_from: + - 'pxc-data' +pxc-server: + image: flowman/percona-xtradb-cluster:5.6.28-1 + net: "container:pxc" + environment: + MYSQL_ROOT_PASSWORD: "${mysql_root_password}" + PXC_SST_PASSWORD: "${pxc_sst_password}" + MYSQL_DATABASE: "${mysql_database}" + MYSQL_USER: "${mysql_user}" + MYSQL_PASSWORD: "${mysql_password}" + labels: + io.rancher.container.hostname_override: container_name + volumes_from: + - 'pxc-data' + entrypoint: bash -x /opt/rancher/start_pxc +pxc-data: + image: flowman/percona-xtradb-cluster:5.6.28-1 + net: none + environment: + MYSQL_ALLOW_EMPTY_PASSWORD: "yes" + volumes: + - /var/lib/mysql + - /etc/mysql/conf.d + - /docker-entrypoint-initdb.d + command: /bin/true + labels: + io.rancher.container.start_once: true +pxc: + image: flowman/percona-xtradb-cluster-confd:v0.2.0 + labels: + io.rancher.sidekicks: pxc-clustercheck,pxc-server,pxc-data + io.rancher.container.hostname_override: container_name + io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name} + volumes_from: + - 'pxc-data' diff --git a/templates/pxc/0/rancher-compose.yml b/templates/pxc/0/rancher-compose.yml new file mode 100644 index 0000000..693d638 --- /dev/null +++ b/templates/pxc/0/rancher-compose.yml @@ -0,0 +1,57 @@ +.catalog: + name: "Percona XtraDB Cluster" + version: 5.6.28-rancher1 + description: | + Percona XtraDB Cluster 5.6.28 + questions: + - variable: "mysql_root_password" + type: string + required: true + label: "MySQL Root Password" + description: "Password given to the root mysql user" + default: "password" + - variable: "pxc_sst_password" + type: string + required: true + label: "PXC SST Password" + description: "Password given to the sst mysql user" + default: "password" + - variable: "mysql_database" + type: string + required: false + label: "MySQL Database Name" + description: "MySQL database to create" + - variable: "mysql_user" + type: string + required: false + description: "MySQL user for the created database" + label: "MySQL DB User" + - variable: "mysql_password" + type: string + required: false + label: "MySQL DB Password" + description: "Password for the MySQL user of the created database" +pxc: + scale: 3 + health_check: + port: 8000 + interval: 2000 + unhealthy_threshold: 3 + strategy: none + request_line: GET / HTTP/1.1 + healthy_threshold: 2 + response_timeout: 2000 + metadata: + mysqld: | + innodb_buffer_pool_size=512M + innodb_doublewrite=0 + innodb_flush_log_at_trx_commit=0 + innodb_file_per_table=1 + innodb_log_file_size=128M + innodb_log_buffer_size=64M + innodb_support_xa=0 + query_cache_size=0 + query_cache_type=0 + sync_binlog=0 + max_connections=1000 + wsrep_sst_auth=sstuser:${pxc_sst_password} diff --git a/templates/pxc/catalogIcon-pxc.png b/templates/pxc/catalogIcon-pxc.png new file mode 100644 index 0000000..c67d371 Binary files /dev/null and b/templates/pxc/catalogIcon-pxc.png differ diff --git a/templates/pxc/config.yml b/templates/pxc/config.yml new file mode 100644 index 0000000..f472b8c --- /dev/null +++ b/templates/pxc/config.yml @@ -0,0 +1,5 @@ +name: "Percona XtraDB Cluster" +description: | + Percona XtraDB Cluster +version: 5.6.28-rancher1 +category: Databases