Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update MariaDB image to latest Alpine & remove Galera-based images #1866

Merged
merged 8 commits into from
May 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 3 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ images := oc \
kubectl \
mariadb \
mariadb-drupal \
mariadb-galera \
mariadb-galera-drupal \
postgres \
postgres-ckan \
postgres-drupal \
Expand Down Expand Up @@ -180,8 +178,6 @@ $(build-images):
# changed on the Dockerfiles
build/mariadb: build/commons images/mariadb/Dockerfile
build/mariadb-drupal: build/mariadb images/mariadb-drupal/Dockerfile
build/mariadb-galera: build/commons images/mariadb-galera/Dockerfile
build/mariadb-galera-drupal: build/mariadb-galera images/mariadb-galera-drupal/Dockerfile
build/postgres: build/commons images/postgres/Dockerfile
build/postgres-ckan: build/postgres images/postgres-ckan/Dockerfile
build/postgres-drupal: build/postgres images/postgres-drupal/Dockerfile
Expand Down Expand Up @@ -454,10 +450,7 @@ services := api \
harborregistry \
harborregistryctl

services-galera := api-db-galera \
keycloak-db-galera

service-images += $(services) $(services-galera)
service-images += $(services)

build-services = $(foreach image,$(services),build/$(image))

Expand All @@ -467,14 +460,6 @@ $(build-services):
$(call docker_build,$(image),services/$(image)/Dockerfile,services/$(image))
touch $@

build-services-galera = $(foreach image,$(services-galera),build/$(image))

$(build-services-galera):
$(eval image = $(subst build/,,$@))
$(eval service = $(subst -galera,,$(image)))
$(call docker_build,$(image),services/$(service)/Dockerfile-galera,services/$(service))
touch $@

# Dependencies of Service Images
build/auth-server build/logs2email build/logs2slack build/logs2rocketchat build/logs2microsoftteams build/openshiftbuilddeploy build/openshiftbuilddeploymonitor build/openshiftjobs build/openshiftjobsmonitor build/openshiftmisc build/openshiftremove build/backup-handler build/kubernetesbuilddeploy build/kubernetesdeployqueue build/kubernetesbuilddeploymonitor build/kubernetesjobs build/kubernetesjobsmonitor build/kubernetesmisc build/kubernetesremove build/webhook-handler build/webhooks2tasks build/api build/ui: build/yarn-workspace-builder
build/logs2logs-db: build/logstash__7
Expand All @@ -484,7 +469,6 @@ build/logs-db-curator: build/curator
build/auto-idler: build/oc
build/storage-calculator: build/oc
build/api-db build/keycloak-db: build/mariadb
build/api-db-galera build/keycloak-db-galera: build/mariadb-galera
build/broker: build/rabbitmq-cluster build/broker-single
build/broker-single: build/rabbitmq
build/drush-alias: build/nginx
Expand All @@ -496,6 +480,7 @@ build/harborregistryctl: build/harborregistry
build/harbor-nginx: build/harborregistryctl services/harbor-core/Dockerfile services/harbor-portal/Dockerfile
build/tests-kubernetes: build/tests
build/tests-openshift: build/tests
build/toolbox: build/mariadb

# Auth SSH needs the context of the root folder, so we have it individually
build/ssh: build/commons
Expand Down Expand Up @@ -587,7 +572,6 @@ all-openshift-tests-list:= features-openshift \
node \
drupal \
drupal-postgres \
drupal-galera \
github \
gitlab \
bitbucket \
Expand Down Expand Up @@ -631,7 +615,7 @@ webhook-tests = github gitlab bitbucket
api-tests = node features-openshift features-kubernetes nginx elasticsearch active-standby

# All drupal tests
drupal-tests = drupal drupal-postgres drupal-galera
drupal-tests = drupal drupal-postgres
drupal-dependencies = build/varnish-drupal build/solr__5.5-drupal build/nginx-drupal build/redis build/php__7.2-cli-drupal build/php__7.3-cli-drupal build/php__7.4-cli-drupal build/postgres-drupal build/mariadb-drupal

# These targets are used as dependencies to bring up containers in the right order.
Expand Down
31 changes: 0 additions & 31 deletions docs/using_lagoon/drupal/services/mariadb.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,5 @@
# MariaDB
MariaDB is the open source successor to MySQL.
## Galera

[MariaDB Galera Cluster](https://mariadb.com/kb/en/galera-cluster/) is a synchronous multi-master cluster for MariaDB.

For improved reliability, MariaDB can be used in a cluster for production sites. This example, when placed in `.lagoon.yml` will enable Galera on the `production` branch.


```
environments:
production:
types:
mariadb: mariadb-galera
```


Also, you will need to change your service definition in your `docker-compose.yml`


```
mariadb:
image: amazeeio/mariadb-galera-drupal
labels:
lagoon.type: mariadb
ports:
- "3306" # Exposes the port 3306 with a random local port, find it with `docker-compose port mariadb 3306`.
environment:
<< : *default-environment
```


It is recommended that you configure the environment _before_ the initial deploy of the production site, otherwise manual intervention may be needed from your Lagoon administrator.

## Additional MariaDB Logging

Expand Down
8 changes: 4 additions & 4 deletions docs/using_lagoon/lagoon_yml.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ environments:
insecure: Redirect
hsts: max-age=31536000
types:
mariadb: mariadb-galera
mariadb: mariadb
templates:
mariadb: mariadb.master.deployment.yml
rollouts:
Expand Down Expand Up @@ -173,7 +173,7 @@ In the `"www.example.com"` example repeated below, we see two more options \(als

The Lagoon build process checks the `lagoon.type` label from the `docker-compose.yml` file in order to learn what type of service should be deployed \(read more about them in the [documentation of `docker-compose.yml`](docker-compose_yml.md)\).

Sometimes you might want to override the **type** just for a single environment, and not for all of them. For example, if you want a MariaDB-Galera high availability database for your production environment called `master`:
Sometimes you might want to override the **type** just for a single environment, and not for all of them. For example, if you want a standalone MariaDB database (instead of letting the Service Broker/operator provision a shared one) for your non-production environment called `develop`:

`service-name: service-type`

Expand All @@ -184,9 +184,9 @@ Example:

```
environments:
master:
develop:
types:
mariadb: mariadb-galera
mariadb: mariadb-single
```


Expand Down
1 change: 0 additions & 1 deletion docs/using_lagoon/service_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ This table lists all service types that can be defined via `lagoon.type` within
| `kibana` | Kibana container. | TCP connection on `5601` | `5601` | yes | - |
| `logstash` | Logstash container. | TCP connection on `9600` | `9600` | - | - |
| `mariadb` | A meta-service which will tell Lagoon to automatically decide between `mariadb-single` and `mariadb-shared`. | - | - | - | - |
| `mariadb-galera` | MariaDB Galera Cluster with 3 nodes, uses `Statefulset`. Generates persistent storage for each cluster node. Creates cron job for backups running every 24h executing `/lagoon/mysql-backup.sh 127.0.0.1`. Starts additional `maxscale` container where the service points to \(no direct connection to Galera nodes\). | TCP connection on `3306` | `3306` | - | `lagoon.persistent.size` |
| `mariadb-shared` | Uses a shared MariaDB server via a MariaDB service broker. | Not Needed | `3306` | - | - |
| `mariadb-single` | MariaDB container. Creates cron job for backups running every 24h executing `/lagoon/mysql-backup.sh 127.0.0.1`. | TCP connection on `3306` | `3306` | - | `lagoon.persistent.size` |
| `mongo` | MongoDB container, will generate persistent storage of min 1GB mounted at `/data/db`. | TCP connection on `27017` | `27017` | - | - |
Expand Down
11 changes: 1 addition & 10 deletions images/kubectl-build-deploy-dind/build-deploy-docker-compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -935,16 +935,7 @@ do
SERVICE_ROLLOUT_TYPE=$ENVIRONMENT_SERVICE_ROLLOUT_TYPE
fi

# if mariadb-galera is a statefulset check also for maxscale
if [ $SERVICE_TYPE == "mariadb-galera" ]; then

STATEFULSET="${SERVICE_NAME}-galera"
. /kubectl-build-deploy/scripts/exec-monitor-statefulset.sh

SERVICE_NAME="${SERVICE_NAME}-maxscale"
. /kubectl-build-deploy/scripts/exec-monitor-deploy.sh

elif [ $SERVICE_TYPE == "elasticsearch-cluster" ]; then
if [ $SERVICE_TYPE == "elasticsearch-cluster" ]; then

STATEFULSET="${SERVICE_NAME}"
. /kubectl-build-deploy/scripts/exec-monitor-statefulset.sh
Expand Down
6 changes: 0 additions & 6 deletions images/mariadb-galera-drupal/Dockerfile

This file was deleted.

136 changes: 0 additions & 136 deletions images/mariadb-galera/Dockerfile

This file was deleted.

16 changes: 0 additions & 16 deletions images/mariadb-galera/entrypoints/100-fix-data-subpath.sh

This file was deleted.

24 changes: 0 additions & 24 deletions images/mariadb-galera/entrypoints/100-mariadb-logging.bash

This file was deleted.

13 changes: 0 additions & 13 deletions images/mariadb-galera/entrypoints/150-mariadb-performance.bash

This file was deleted.

5 changes: 0 additions & 5 deletions images/mariadb-galera/entrypoints/200-mariadb-envplate.bash

This file was deleted.

3 changes: 0 additions & 3 deletions images/mariadb-galera/entrypoints/201-maxscale-envplate.bash

This file was deleted.