From de128b8054957060d3ba742e196b7b696c599777 Mon Sep 17 00:00:00 2001 From: Chris Fordham Date: Fri, 21 Jul 2017 11:56:12 +1000 Subject: [PATCH] Initial version of mysql catalog entry. --- templates/mysql/0/README.md | 18 ++++ templates/mysql/0/docker-compose.yml.tpl | 42 ++++++++ templates/mysql/0/rancher-compose.yml | 124 +++++++++++++++++++++++ templates/mysql/README.md | 3 + templates/mysql/catalogIcon-mysql.svg | 27 +++++ templates/mysql/config.yml | 5 + 6 files changed, 219 insertions(+) create mode 100644 templates/mysql/0/README.md create mode 100644 templates/mysql/0/docker-compose.yml.tpl create mode 100644 templates/mysql/0/rancher-compose.yml create mode 100644 templates/mysql/README.md create mode 100644 templates/mysql/catalogIcon-mysql.svg create mode 100644 templates/mysql/config.yml diff --git a/templates/mysql/0/README.md b/templates/mysql/0/README.md new file mode 100644 index 0000000..11e8931 --- /dev/null +++ b/templates/mysql/0/README.md @@ -0,0 +1,18 @@ +# MySQL + +## What is MySQL? + +MySQL is the world's most popular open source database. With its proven performance, reliability and ease-of-use, MySQL has become the leading database choice for web-based applications, covering the entire range from personal projects and websites, via e-commerce and information services, all the way to high profile web properties including Facebook, Twitter, YouTube, Yahoo! and many more. + +For more information and related downloads for MySQL Server and other MySQL products, please visit [www.mysql.com](http://www.mysql.com). + +## Services + +Includes the following services: +- Load Balancer +- MySQL Server +- MySQL Data (sidekick to the server) + +## Usage + +The minimum configuration option(s) required to launch the stack is the MySQL Public LB Port and MySQL Root Password. See the description of each option for more information. diff --git a/templates/mysql/0/docker-compose.yml.tpl b/templates/mysql/0/docker-compose.yml.tpl new file mode 100644 index 0000000..cbc2426 --- /dev/null +++ b/templates/mysql/0/docker-compose.yml.tpl @@ -0,0 +1,42 @@ +version: '2' +services: + mysql-lb: + image: rancher/lb-service-haproxy + links: + - mysql + ports: + - ${mysql_lb_port}:3306 + mysql-data: + image: busybox + labels: + io.rancher.container.start_once: true + volumes: + - /var/lib/mysql + mysql: + image: ${mysql_image} + environment: +{{- if eq .Values.mysql_allow_empty_password "yes"}} + MYSQL_ALLOW_EMPTY_PASSWORD: ${mysql_allow_empty_password} +{{- end}} +{{- if (.Values.mysql_database)}} + MYSQL_DATABASE: ${mysql_database} +{{- end}} +{{- if eq .Values.mysql_onetime_password "yes"}} + MYSQL_ONETIME_PASSWORD: ${mysql_onetime_password} +{{- end}} +{{- if (.Values.mysql_password)}} + MYSQL_PASSWORD: ${mysql_password} +{{- end}} +{{- if eq .Values.mysql_random_root_password "yes"}} + MYSQL_RANDOM_ROOT_PASSWORD: ${mysql_random_root_password} +{{- end}} + MYSQL_ROOT_PASSWORD: ${mysql_root_password} +{{- if (.Values.mysql_user)}} + MYSQL_USER: ${mysql_user} +{{- end}} + tty: true + stdin_open: true + labels: + io.rancher.sidekicks: mysql-data + volumes_from: + - mysql-data diff --git a/templates/mysql/0/rancher-compose.yml b/templates/mysql/0/rancher-compose.yml new file mode 100644 index 0000000..f41e4c1 --- /dev/null +++ b/templates/mysql/0/rancher-compose.yml @@ -0,0 +1,124 @@ +.catalog: + name: "mysql" + version: "v0.0.1" + description: "A recommended stack for the MySQL RDBMS." + uuid: mysql-0 + minimum_rancher_version: v1.0.0 + questions: + - variable: mysql_lb_port + description: "Public port for access to MySQL through the load balancer" + label: "MySQL Public LB Port" + required: true + default: 3306 + type: "int" + - variable: mysql_root_password + description: "The password that will be set for the MySQL root superuser account." + label: "MySQL Root Password" + required: true + type: password + - variable: mysql_image + description: "The docker image to use for the MySQL server." + label: "MySQL Docker Image" + type: "enum" + options: + - "mysql:latest" + - "mysql:8.0.1" + - "mysql:8.0" + - "mysql:8" + - "mysql:5.7.18" + - "mysql:5.7" + - "mysql:5" + - "mysql:5.6.36" + - "mysql:5.6" + - "mysql:5.5.56" + - "mysql:5.5" + - "mariadb:latest" + - "mariadb:10.3.0" + - "mariadb:10.3" + - "mariadb:10.2.6" + - "mariadb:10.2" + - "mariadb:10.1.24" + - "mariadb:10.1" + - "mariadb:10" + - "mariadb:10.0.31" + - "mariadb:10.0" + - "mariadb:5.5.56" + - "mariadb:5.5" + - "mariadb:5" + default: "mysql:latest" + required: true + - variable: mysql_database + description: "Optional, allows you to specify the name of a database to be created on image startup." + label: "MySQL Database" + required: false + type: "string" + - variable: mysql_user + description: "Creates an additional MySQL (super)user. MySQL Password must also be set." + label: "MySQL User" + required: false + type: "string" + - variable: mysql_password + description: "A password for the additional MySQL (super)user. MySQL User must also be set." + label: "MySQL Password" + required: false + type: password + - variable: mysql_allow_empty_password + description: "Set to 'yes' to allow the container to be started with a blank password for the root user." + label: MySQL Allow Empty Password + type: "enum" + options: + - "yes" + - "no" + default: "no" + required: false + - variable: mysql_random_root_password + description: "Set to 'yes' to generate a random initial password for the root user (using pwgen)." + label: MySQL Random Root Password + type: "enum" + options: + - "yes" + - "no" + default: "no" + required: false + - variable: mysql_onetime_password + description: "Set to 'yes' and the root user's password will be set as expired once init is complete." + label: MySQL One-time Password + type: "enum" + options: + - "yes" + - "no" + default: "no" + required: false + +version: '2' +services: + mysql-lb: + scale: 1 + start_on_create: true + lb_config: + certs: [] + port_rules: + - protocol: tcp + service: mysql + source_port: ${mysql_lb_port} + target_port: 3306 + health_check: + healthy_threshold: 2 + response_timeout: 2000 + port: 42 + unhealthy_threshold: 3 + interval: 2000 + strategy: recreate + mysql: + scale: 1 + start_on_create: true + health_check: + healthy_threshold: 2 + response_timeout: 2000 + port: 3306 + unhealthy_threshold: 3 + interval: 2000 + strategy: recreate + mysql-data: + scale: 1 + start_on_create: true diff --git a/templates/mysql/README.md b/templates/mysql/README.md new file mode 100644 index 0000000..bc36af5 --- /dev/null +++ b/templates/mysql/README.md @@ -0,0 +1,3 @@ +## What is inside the MySQL Stack? +* MySQL database server + sidekick with volume data +* Load Balancer diff --git a/templates/mysql/catalogIcon-mysql.svg b/templates/mysql/catalogIcon-mysql.svg new file mode 100644 index 0000000..6d1d5c8 --- /dev/null +++ b/templates/mysql/catalogIcon-mysql.svg @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/templates/mysql/config.yml b/templates/mysql/config.yml new file mode 100644 index 0000000..6d2838d --- /dev/null +++ b/templates/mysql/config.yml @@ -0,0 +1,5 @@ +name: MySQL +description: | + MySQL — an open-source relational database management system (RDBMS) +version: v0.0.1 +category: Database