From 8bbfedb2cf1a7ae15c4ac46d5a19aa76e4ff6ce4 Mon Sep 17 00:00:00 2001 From: Jukka Keski-Luopa Date: Tue, 18 Sep 2018 16:28:40 +0300 Subject: [PATCH] docs(helm): added some documentation --- docker-compose.yaml | 61 ++++++++++++++------------- scripts/helm/README.md | 11 +++++ scripts/helm/charts/wordpress/LICENSE | 13 ++++++ 3 files changed, 55 insertions(+), 30 deletions(-) create mode 100644 scripts/helm/charts/wordpress/LICENSE diff --git a/docker-compose.yaml b/docker-compose.yaml index cadb932..1d714d9 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -17,48 +17,49 @@ services: WORDPRESS_PASSWORD: initial-password-change-it-on-wp-admin-immediately # SHOW ON INFO MARIADB_HOST: wordpress-template-database MARIADB_PORT_NUMBER: 3306 - # NOTE: For staging database (staging should not contain confidential data) - # WORDPRESS_DATABASE_NAME: wptemplatestag - # WORDPRESS_DATABASE_USER: wptemplatestag - # WORDPRESS_DATABASE_PASSWORD: ueqosGeIZMprSMglgnjq7xCImJ47qg + # NOTE: For staging database + WORDPRESS_DATABASE_NAME: wptemplatestag + WORDPRESS_DATABASE_USER: wptemplatestag + # TODO: fetch password from kubernetes! + WORDPRESS_DATABASE_PASSWORD: ueqosGeIZMprSMglgnjq7xCImJ47qg # NOTE: For local database - WORDPRESS_DATABASE_NAME: wptemplatelocal - WORDPRESS_DATABASE_USER: wptemplatelocal - WORDPRESS_DATABASE_PASSWORD: secret + # WORDPRESS_DATABASE_NAME: wptemplatelocal + # WORDPRESS_DATABASE_USER: wptemplatelocal + # WORDPRESS_DATABASE_PASSWORD: secret # NOTE: For staging database - # wordpress-template-database: - # container_name: wordpress-template-database - # image: taitounited/taito-cli:latest - # restart: unless-stopped - # entrypoint: /bin/sh -c "cd /project && taito db-proxy:stag 3306" - # networks: - # - default - # ports: - # - "7587:3306" - # volumes: - # - ".:/project" - # - "${HOME}/.taito:/root/.taito" - # - "${HOME}/.ssh:/root/.ssh" - # environment: - # taito_docker: 'true' - - # NOTE: For local database wordpress-template-database: container_name: wordpress-template-database - image: mysql:5.7 + image: taitounited/taito-cli:latest restart: unless-stopped + entrypoint: /bin/sh -c "cd /project && taito db-proxy:stag 3306" networks: - default ports: - "7587:3306" volumes: - - "./database/init:/docker-entrypoint-initdb.d" + - ".:/project" + - "${HOME}/.taito:/root/.taito" + - "${HOME}/.ssh:/root/.ssh" environment: - MYSQL_ROOT_PASSWORD: secret - MYSQL_DATABASE: wptemplatelocal - MYSQL_USER: wptemplatelocal - MYSQL_PASSWORD: secret + taito_docker: 'true' + + # NOTE: For local database + # wordpress-template-database: + # container_name: wordpress-template-database + # image: mysql:5.7 + # restart: unless-stopped + # networks: + # - default + # ports: + # - "7587:3306" + # volumes: + # - "./database/init:/docker-entrypoint-initdb.d" + # environment: + # MYSQL_ROOT_PASSWORD: secret + # MYSQL_DATABASE: wptemplatelocal + # MYSQL_USER: wptemplatelocal + # MYSQL_PASSWORD: secret networks: default: diff --git a/scripts/helm/README.md b/scripts/helm/README.md index 94c9555..48cfd0a 100644 --- a/scripts/helm/README.md +++ b/scripts/helm/README.md @@ -1,3 +1,14 @@ # helm This folder contains a reusable helm chart for wordpress sites. [Helm](https://helm.sh/) is a package manager for Kubernetes. + +The subchart located in charts/wordpress was forked from https://github.com/bitnami/bitnami-docker-wordpress, but has been modified since: + +- Added support for `externalDatabase.passwordSecretName` and `externalDatabase.passwordSecretKey` variables. +- Added support for reading db settings from environment variables: `wordpress/app-entrypoint.sh` and `wordpress/template-env.sh` +- Added support for copying data from container image to pvc on container start: + * Use `/bitnami-pvc` as mount path instead of `/bitnami`. + * Mount volumes only if `persistence.enabled` is true so that we can determine if PVC is enabled during container bootstrap. + * Copy data from container to pvc on container start: `wordpress/app-entrypoint.sh` -> `template-env.sh` + +TODO: Either try to merge changes back to original chart or make a simplified custom chart. diff --git a/scripts/helm/charts/wordpress/LICENSE b/scripts/helm/charts/wordpress/LICENSE new file mode 100644 index 0000000..5277333 --- /dev/null +++ b/scripts/helm/charts/wordpress/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2015-2018 Bitnami + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License.