[bitnami/ghost] Use MySQL as database management system for Ghost (#10566)

* Use MySQL as database management system for Ghost

Signed-off-by: David Gomez <dgomezleon@vmware.com>

* Update dependencies

Signed-off-by: David Gomez <dgomezleon@vmware.com>

* Update cypress tests for ghost

Signed-off-by: David Gomez <dgomezleon@vmware.com>

* Update README.md with readme-generator-for-helm

Signed-off-by: Bitnami Containers <containers@bitnami.com>

* Apply feedback

Signed-off-by: David Gomez <dgomezleon@vmware.com>

Co-authored-by: Bitnami Containers <containers@bitnami.com>
This commit is contained in:
David Gomez
2022-06-06 20:48:16 +02:00
committed by GitHub
parent edda8868ef
commit d33bf470f4
11 changed files with 134 additions and 125 deletions

View File

@@ -26,14 +26,14 @@ it('allows to create and publish a new post', () => {
// Step 1: Open drop-down menu
cy.contains('Publish').click();
// Step 2: Select the option from the menu
cy.get('footer[class*=publishmenu]').within(() => {
cy.contains('Publish').click();
cy.get('div[class=gh-publish-cta]').within(() => {
cy.contains('Continue').click();
});
// Step 3: Confirmation pop-up
cy.get('div[class*=modal-content]').within(() => {
cy.get('div[class=gh-publish-cta]').within(() => {
cy.contains('Publish').click();
});
cy.contains('Published').should('be.visible');
cy.contains('Its out there').should('be.visible');
cy.visit('/');
cy.fixture('posts').then(($posts) => {
cy.contains(`${$posts.newPost.title}-${random}`);
@@ -51,14 +51,18 @@ it('allows to create a new page', () => {
);
cy.get('article').type(`${$pages.newPage.content}-${random}`);
});
// Publishing a page needs 2 steps
// Publishing a page needs 3 steps
// Step 1: Open drop down-menu
cy.contains('Publish').click();
// Step 2: Select the option from the menu
cy.get('footer[class*=publishmenu]').within(() => {
cy.get('div[class=gh-publish-cta]').within(() => {
cy.contains('Continue').click();
});
// Step 3: Confirmation pop-up
cy.get('div[class=gh-publish-cta]').within(() => {
cy.contains('Publish').click();
});
cy.contains('Published').should('be.visible');
cy.contains('Its out there').should('be.visible');
cy.fixture('pages').then(($pages) => {
cy.visit(getPageUrlFromTitle(`${$pages.newPage.title}-${random}`));
cy.contains(`${$pages.newPage.title}-${random}`);

View File

@@ -1,9 +1,9 @@
dependencies:
- name: mariadb
- name: mysql
repository: https://charts.bitnami.com/bitnami
version: 11.0.10
version: 9.1.4
- name: common
repository: https://charts.bitnami.com/bitnami
version: 1.16.0
digest: sha256:40a6c3fb5276d9662edf72c064a7fe44e6ad071637a7a3dd929b6b45864a49b6
generated: "2022-06-04T00:48:35.601358647Z"
digest: sha256:2c754208ee86c0b20776576f8b91dc49953b6f235d63f754cfc567ad7ec6ea38
generated: "2022-06-06T14:32:48.236656+02:00"

View File

@@ -3,12 +3,12 @@ annotations:
apiVersion: v2
appVersion: 5.2.2
dependencies:
- condition: mariadb.enabled
name: mariadb
- condition: mysql.enabled
name: mysql
repository: https://charts.bitnami.com/bitnami
tags:
- ghost-database
version: 11.x.x
version: 9.x.x
- name: common
repository: https://charts.bitnami.com/bitnami
tags:
@@ -33,4 +33,4 @@ name: ghost
sources:
- https://github.com/bitnami/bitnami-docker-ghost
- https://www.ghost.org/
version: 18.0.1
version: 19.0.0

View File

@@ -19,7 +19,7 @@ $ helm install my-release bitnami/ghost
This chart bootstraps a [Ghost](https://github.com/bitnami/bitnami-docker-ghost) deployment on a [Kubernetes](https://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
It also packages the [Bitnami MariaDB chart](https://github.com/bitnami/charts/tree/master/bitnami/mariadb) which is required for bootstrapping a MariaDB deployment for the database requirements of the Ghost application.
It also packages the [Bitnami MySQL chart](https://github.com/bitnami/charts/tree/master/bitnami/mysql) which is required for bootstrapping a MySQL deployment for the database requirements of the Ghost application.
Bitnami charts can be used with [Kubeapps](https://kubeapps.com/) for deployment and management of Helm Charts in clusters. This chart has been tested to work with NGINX Ingress, cert-manager, fluentd and Prometheus on top of the [BKPR](https://kubeprod.io/).
@@ -78,14 +78,14 @@ The command removes all the Kubernetes components associated with the chart and
### Ghost Image parameters
| Name | Description | Value |
| ------------------- | ------------------------------------------------ | --------------------- |
| `image.registry` | Ghost image registry | `docker.io` |
| `image.repository` | Ghost image repository | `bitnami/ghost` |
| `image.tag` | Ghost image tag (immutable tags are recommended) | `4.48.0-debian-10-r1` |
| `image.pullPolicy` | Ghost image pull policy | `IfNotPresent` |
| `image.pullSecrets` | Ghost image pull secrets | `[]` |
| `image.debug` | Enable image debug mode | `false` |
| Name | Description | Value |
| ------------------- | ------------------------------------------------ | -------------------- |
| `image.registry` | Ghost image registry | `docker.io` |
| `image.repository` | Ghost image repository | `bitnami/ghost` |
| `image.tag` | Ghost image tag (immutable tags are recommended) | `5.2.2-debian-10-r0` |
| `image.pullPolicy` | Ghost image pull policy | `IfNotPresent` |
| `image.pullSecrets` | Ghost image pull secrets | `[]` |
| `image.debug` | Enable image debug mode | `false` |
### Ghost Configuration parameters
@@ -219,7 +219,7 @@ The command removes all the Kubernetes components associated with the chart and
| `volumePermissions.enabled` | Enable init container that changes the owner/group of the PV mount point to `runAsUser:fsGroup` | `false` |
| `volumePermissions.image.registry` | Bitnami Shell image registry | `docker.io` |
| `volumePermissions.image.repository` | Bitnami Shell image repository | `bitnami/bitnami-shell` |
| `volumePermissions.image.tag` | Bitnami Shell image tag (immutable tags are recommended) | `10-debian-10-r432` |
| `volumePermissions.image.tag` | Bitnami Shell image tag (immutable tags are recommended) | `10-debian-10-r444` |
| `volumePermissions.image.pullPolicy` | Bitnami Shell image pull policy | `IfNotPresent` |
| `volumePermissions.image.pullSecrets` | Bitnami Shell image pull secrets | `[]` |
| `volumePermissions.resources.limits` | The resources limits for the init container | `{}` |
@@ -229,27 +229,27 @@ The command removes all the Kubernetes components associated with the chart and
### Database Parameters
| Name | Description | Value |
| ------------------------------------------ | ------------------------------------------------------------------------- | --------------- |
| `mariadb.enabled` | Deploy a MariaDB server to satisfy the applications database requirements | `true` |
| `mariadb.architecture` | MariaDB architecture. Allowed values: `standalone` or `replication` | `standalone` |
| `mariadb.auth.rootPassword` | MariaDB root password | `""` |
| `mariadb.auth.database` | MariaDB custom database | `bitnami_ghost` |
| `mariadb.auth.username` | MariaDB custom user name | `bn_ghost` |
| `mariadb.auth.password` | MariaDB custom user password | `""` |
| `mariadb.auth.existingSecret` | Existing secret with MariaDB credentials | `""` |
| `mariadb.primary.persistence.enabled` | Enable persistence on MariaDB using PVC(s) | `true` |
| `mariadb.primary.persistence.storageClass` | Persistent Volume storage class | `""` |
| `mariadb.primary.persistence.accessModes` | Persistent Volume access modes | `[]` |
| `mariadb.primary.persistence.size` | Persistent Volume size | `8Gi` |
| `externalDatabase.host` | External Database server host | `localhost` |
| `externalDatabase.port` | External Database server port | `3306` |
| `externalDatabase.user` | External Database username | `bn_ghost` |
| `externalDatabase.password` | External Database user password | `""` |
| `externalDatabase.database` | External Database database name | `bitnami_ghost` |
| `externalDatabase.existingSecret` | The name of an existing secret with database credentials | `""` |
| `externalDatabase.ssl` | External Database ssl | `false` |
| `externalDatabase.sslCaFile` | External Database ssl CA filepath | `""` |
| Name | Description | Value |
| ---------------------------------------- | ----------------------------------------------------------------------- | --------------- |
| `mysql.enabled` | Deploy a MySQL server to satisfy the applications database requirements | `true` |
| `mysql.architecture` | MySQL architecture. Allowed values: `standalone` or `replication` | `standalone` |
| `mysql.auth.rootPassword` | MySQL root password | `""` |
| `mysql.auth.database` | MySQL custom database | `bitnami_ghost` |
| `mysql.auth.username` | MySQL custom user name | `bn_ghost` |
| `mysql.auth.password` | MySQL custom user password | `""` |
| `mysql.auth.existingSecret` | Existing secret with MySQL credentials | `""` |
| `mysql.primary.persistence.enabled` | Enable persistence on MySQL using PVC(s) | `true` |
| `mysql.primary.persistence.storageClass` | Persistent Volume storage class | `""` |
| `mysql.primary.persistence.accessModes` | Persistent Volume access modes | `[]` |
| `mysql.primary.persistence.size` | Persistent Volume size | `8Gi` |
| `externalDatabase.host` | External Database server host | `localhost` |
| `externalDatabase.port` | External Database server port | `3306` |
| `externalDatabase.user` | External Database username | `bn_ghost` |
| `externalDatabase.password` | External Database user password | `""` |
| `externalDatabase.database` | External Database database name | `bitnami_ghost` |
| `externalDatabase.existingSecret` | The name of an existing secret with database credentials | `""` |
| `externalDatabase.ssl` | External Database ssl | `false` |
| `externalDatabase.sslCaFile` | External Database ssl CA filepath | `""` |
### NetworkPolicy parameters
@@ -260,7 +260,7 @@ The command removes all the Kubernetes components associated with the chart and
| `networkPolicy.ingress.enabled` | Enable network policy for Ingress Proxies | `false` |
| `networkPolicy.ingress.namespaceSelector` | Ingress Proxy namespace selector labels. These labels will be used to identify the Ingress Proxy's namespace. | `{}` |
| `networkPolicy.ingress.podSelector` | Ingress Proxy pods selector labels. These labels will be used to identify the Ingress Proxy pods. | `{}` |
| `networkPolicy.ingressRules.backendOnlyAccessibleByFrontend` | Enable ingress rule that makes the backend (mariadb) only accessible by Ghost's pods. | `false` |
| `networkPolicy.ingressRules.backendOnlyAccessibleByFrontend` | Enable ingress rule that makes the backend (mysql) only accessible by Ghost's pods. | `false` |
| `networkPolicy.ingressRules.customBackendSelector` | Backend selector labels. These labels will be used to identify the backend pods. | `{}` |
| `networkPolicy.ingressRules.accessOnlyFrom.enabled` | Enable ingress rule that makes Ghost only accessible from a particular origin | `false` |
| `networkPolicy.ingressRules.accessOnlyFrom.namespaceSelector` | Namespace selector label that is allowed to access Ghost. This label will be used to identified the allowed namespace(s). | `{}` |
@@ -294,11 +294,11 @@ Specify each parameter using the `--set key=value[,key=value]` argument to `helm
```console
$ helm install my-release \
--set ghostUsername=admin,ghostPassword=password,mariadb.auth.rootPassword=secretpassword \
--set ghostUsername=admin,ghostPassword=password,mysql.auth.rootPassword=secretpassword \
bitnami/ghost
```
The above command sets the Ghost administrator account username and password to `admin` and `password` respectively. Additionally, it sets the MariaDB `root` user password to `secretpassword`.
The above command sets the Ghost administrator account username and password to `admin` and `password` respectively. Additionally, it sets the MySQL `root` user password to `secretpassword`.
> NOTE: Once this chart is deployed, it is not possible to change the application's access credentials, such as usernames or passwords, using Helm. To change these application credentials after deployment, delete any persistent volumes (PVs) used by the chart and re-deploy it, or use the application's built-in administrative tools if available.
@@ -320,10 +320,10 @@ Bitnami will release a new chart updating its containers if a new version of the
### External database support
You may want to have Ghost connect to an external database rather than installing one inside your cluster. Typical reasons for this are to use a managed database service, or to share a common database server for all your applications. To achieve this, the chart allows you to specify credentials for an external database with the [`externalDatabase` parameter](#database-parameters). You should also disable the MariaDB installation with the `mariadb.enabled` option. Here is an example:
You may want to have Ghost connect to an external database rather than installing one inside your cluster. Typical reasons for this are to use a managed database service, or to share a common database server for all your applications. To achieve this, the chart allows you to specify credentials for an external database with the [`externalDatabase` parameter](#database-parameters). You should also disable the MySQL installation with the `mysql.enabled` option. Here is an example:
```console
mariadb.enabled=false
mysql.enabled=false
externalDatabase.host=myexternalhost
externalDatabase.user=myuser
externalDatabase.password=mypassword
@@ -384,6 +384,11 @@ Find more information about how to deal with common errors related to Bitnami's
## Upgrading
### To 19.0.0
This major release changes database management system from MariaDB to MySQL. Since a new DB will be used, you need to create a back up beforehand and restore it in order to keep your data. See [the official migration docs](https://ghost.org/docs/migration/ghost/).
### To 17.0.0
This major release bumps the MariaDB version to 10.6. Follow the [upstream instructions](https://mariadb.com/kb/en/upgrading-from-mariadb-105-to-mariadb-106/) for upgrading from MariaDB 10.5 to 10.6. No major issues are expected during the upgrade.

View File

@@ -8,7 +8,7 @@ APP VERSION: {{ .Chart.AppVersion }}
{{- $ghostSecretName := (include "common.names.fullname" .) -}}
{{- $databaseSecretName := include "ghost.databaseSecretName" . -}}
{{- if or .Values.mariadb.enabled .Values.externalDatabase.host -}}
{{- if or .Values.mysql.enabled .Values.externalDatabase.host -}}
{{- if empty (include "ghost.host" .) -}}
###############################################################################
@@ -34,22 +34,22 @@ host. To configure Ghost with the URL of your service:
{{- end }}
{{ include "common.utils.secret.getvalue" (dict "secret" $ghostSecretName "field" $ghostPasswordKey "context" $) }}
{{ include "common.utils.secret.getvalue" (dict "secret" $databaseSecretName "field" "mariadb-root-password" "context" $) }}
{{ include "common.utils.secret.getvalue" (dict "secret" $databaseSecretName "field" "mariadb-password" "context" $) }}
{{ include "common.utils.secret.getvalue" (dict "secret" $databaseSecretName "field" "mysql-root-password" "context" $) }}
{{ include "common.utils.secret.getvalue" (dict "secret" $databaseSecretName "field" "mysql-password" "context" $) }}
2. Complete your Ghost deployment by running:
{{- if .Values.mariadb.enabled }}
{{- if .Values.mysql.enabled }}
helm upgrade --namespace {{ .Release.Namespace }} {{ .Release.Name }} bitnami/{{ .Chart.Name }} \
--set service.type={{ .Values.service.type }},ghostHost=$APP_HOST,ghostPassword=$GHOST_PASSWORD,mariadb.auth.rootPassword=$MARIADB_ROOT_PASSWORD,mariadb.auth.password=$MARIADB_PASSWORD{{- if .Values.global }}{{- if .Values.global.imagePullSecrets }},global.imagePullSecrets={{ .Values.global.imagePullSecrets }}{{- end }}{{- end }}
--set service.type={{ .Values.service.type }},ghostHost=$APP_HOST,ghostPassword=$GHOST_PASSWORD,mysql.auth.rootPassword=$MYSQL_ROOT_PASSWORD,mysql.auth.password=$MYSQL_PASSWORD{{- if .Values.global }}{{- if .Values.global.imagePullSecrets }},global.imagePullSecrets={{ .Values.global.imagePullSecrets }}{{- end }}{{- end }}
{{- else }}
## PLEASE UPDATE THE EXTERNAL DATABASE CONNECTION PARAMETERS IN THE FOLLOWING COMMAND AS NEEDED ##
helm upgrade --namespace {{ .Release.Namespace }} {{ .Release.Name }} bitnami/{{ .Chart.Name }} \
--set service.type={{ .Values.service.type }},ghostHost=$APP_HOST,ghostPassword=$APP_PASSWORD,{{- if contains "NodePort" .Values.service.type }}service.nodePort=$APP_PORT,{{- end }}mariadb.enabled=false{{- if not (empty .Values.externalDatabase.host) }},externalDatabase.host={{ .Values.externalDatabase.host }}{{- end }}{{- if not (empty .Values.externalDatabase.user) }},externalDatabase.user={{ .Values.externalDatabase.user }}{{- end }}{{- if not (empty .Values.externalDatabase.password) }},externalDatabase.password={{ .Values.externalDatabase.password }}{{- end }}{{- if not (empty .Values.externalDatabase.database) }},externalDatabase.database={{ .Values.externalDatabase.database }}{{- end }}
--set service.type={{ .Values.service.type }},ghostHost=$APP_HOST,ghostPassword=$APP_PASSWORD,{{- if contains "NodePort" .Values.service.type }}service.nodePort=$APP_PORT,{{- end }}mysql.enabled=false{{- if not (empty .Values.externalDatabase.host) }},externalDatabase.host={{ .Values.externalDatabase.host }}{{- end }}{{- if not (empty .Values.externalDatabase.user) }},externalDatabase.user={{ .Values.externalDatabase.user }}{{- end }}{{- if not (empty .Values.externalDatabase.password) }},externalDatabase.password={{ .Values.externalDatabase.password }}{{- end }}{{- if not (empty .Values.externalDatabase.database) }},externalDatabase.database={{ .Values.externalDatabase.database }}{{- end }}
{{- end }}
@@ -129,7 +129,7 @@ host. To configure Ghost to use and external database host:
## PLEASE UPDATE THE EXTERNAL DATABASE CONNECTION PARAMETERS IN THE FOLLOWING COMMAND AS NEEDED ##
helm upgrade --namespace {{ .Release.Namespace }} {{ .Release.Name }} bitnami/{{ .Chart.Name }} \
--set ghostPassword=$APP_PASSWORD,ghostHost=$APP_HOST,service.type={{ .Values.service.type }},mariadb.enabled=false{{- if not (empty .Values.externalDatabase.user) }},externalDatabase.user={{ .Values.externalDatabase.user }}{{- end }}{{- if not (empty .Values.externalDatabase.password) }},externalDatabase.password={{ .Values.externalDatabase.password }}{{- end }}{{- if not (empty .Values.externalDatabase.database) }},externalDatabase.database={{ .Values.externalDatabase.database }}{{- end }},externalDatabase.host=YOUR_EXTERNAL_DATABASE_HOST
--set ghostPassword=$APP_PASSWORD,ghostHost=$APP_HOST,service.type={{ .Values.service.type }},mysql.enabled=false{{- if not (empty .Values.externalDatabase.user) }},externalDatabase.user={{ .Values.externalDatabase.user }}{{- end }}{{- if not (empty .Values.externalDatabase.password) }},externalDatabase.password={{ .Values.externalDatabase.password }}{{- end }}{{- if not (empty .Values.externalDatabase.database) }},externalDatabase.database={{ .Values.externalDatabase.database }}{{- end }},externalDatabase.host=YOUR_EXTERNAL_DATABASE_HOST
{{- end }}
{{ include "common.warnings.rollingTag" .Values.image }}
@@ -142,8 +142,8 @@ host. To configure Ghost to use and external database host:
{{- $requiredGhostPasswordError := include "common.validations.values.single.empty" $requiredGhostPassword -}}
{{- $passwordValidationErrors = append $passwordValidationErrors $requiredGhostPasswordError -}}
{{- end -}}
{{- if .Values.mariadb.enabled }}
{{- $mariadbPasswordValidationErrors := include "common.validations.values.mariadb.passwords" (dict "secret" $databaseSecretName "subchart" true "context" $) -}}
{{- $passwordValidationErrors = append $passwordValidationErrors $mariadbPasswordValidationErrors -}}
{{- if .Values.mysql.enabled }}
{{- $mysqlPasswordValidationErrors := include "common.validations.values.mysql.passwords" (dict "secret" $databaseSecretName "subchart" true "context" $) -}}
{{- $passwordValidationErrors = append $passwordValidationErrors $mysqlPasswordValidationErrors -}}
{{- end }}
{{- include "common.errors.upgrade.passwords.empty" (dict "validationErrors" $passwordValidationErrors "context" $) -}}

View File

@@ -4,8 +4,8 @@
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "ghost.mariadb.fullname" -}}
{{- printf "%s-%s" .Release.Name "mariadb" | trunc 63 | trimSuffix "-" -}}
{{- define "ghost.mysql.fullname" -}}
{{- printf "%s-%s" .Release.Name "mysql" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
@@ -67,14 +67,14 @@ If not using ClusterIP, or if a host or LoadBalancerIP is not defined, the value
{{- end -}}
{{/*
Return the MariaDB Hostname
Return the MySQL Hostname
*/}}
{{- define "ghost.databaseHost" -}}
{{- if .Values.mariadb.enabled }}
{{- if eq .Values.mariadb.architecture "replication" }}
{{- printf "%s-%s" (include "ghost.mariadb.fullname" .) "primary" | trunc 63 | trimSuffix "-" -}}
{{- if .Values.mysql.enabled }}
{{- if eq .Values.mysql.architecture "replication" }}
{{- printf "%s-%s" (include "ghost.mysql.fullname" .) "primary" | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s" (include "ghost.mariadb.fullname" .) -}}
{{- printf "%s" (include "ghost.mysql.fullname" .) -}}
{{- end -}}
{{- else -}}
{{- printf "%s" .Values.externalDatabase.host -}}
@@ -82,10 +82,10 @@ Return the MariaDB Hostname
{{- end -}}
{{/*
Return the MariaDB Port
Return the MySQL Port
*/}}
{{- define "ghost.databasePort" -}}
{{- if .Values.mariadb.enabled }}
{{- if .Values.mysql.enabled }}
{{- printf "3306" -}}
{{- else -}}
{{- printf "%d" (.Values.externalDatabase.port | int ) -}}
@@ -93,36 +93,36 @@ Return the MariaDB Port
{{- end -}}
{{/*
Return the MariaDB Database Name
Return the MySQL Database Name
*/}}
{{- define "ghost.databaseName" -}}
{{- if .Values.mariadb.enabled }}
{{- printf "%s" .Values.mariadb.auth.database -}}
{{- if .Values.mysql.enabled }}
{{- printf "%s" .Values.mysql.auth.database -}}
{{- else -}}
{{- printf "%s" .Values.externalDatabase.database -}}
{{- end -}}
{{- end -}}
{{/*
Return the MariaDB User
Return the MySQL User
*/}}
{{- define "ghost.databaseUser" -}}
{{- if .Values.mariadb.enabled }}
{{- printf "%s" .Values.mariadb.auth.username -}}
{{- if .Values.mysql.enabled }}
{{- printf "%s" .Values.mysql.auth.username -}}
{{- else -}}
{{- printf "%s" .Values.externalDatabase.user -}}
{{- end -}}
{{- end -}}
{{/*
Return the MariaDB Secret Name
Return the MySQL Secret Name
*/}}
{{- define "ghost.databaseSecretName" -}}
{{- if .Values.mariadb.enabled }}
{{- if .Values.mariadb.auth.existingSecret -}}
{{- printf "%s" .Values.mariadb.auth.existingSecret -}}
{{- if .Values.mysql.enabled }}
{{- if .Values.mysql.auth.existingSecret -}}
{{- printf "%s" .Values.mysql.auth.existingSecret -}}
{{- else -}}
{{- printf "%s" (include "ghost.mariadb.fullname" .) -}}
{{- printf "%s" (include "ghost.mysql.fullname" .) -}}
{{- end -}}
{{- else if .Values.externalDatabase.existingSecret -}}
{{- printf "%s" .Values.externalDatabase.existingSecret -}}
@@ -146,9 +146,9 @@ Compile all warnings into a single message.
{{/* Validate values of Ghost - Database */}}
{{- define "ghost.validateValues.database" -}}
{{- if and (not .Values.mariadb.enabled) (or (empty .Values.externalDatabase.host) (empty .Values.externalDatabase.port) (empty .Values.externalDatabase.database)) -}}
{{- if and (not .Values.mysql.enabled) (or (empty .Values.externalDatabase.host) (empty .Values.externalDatabase.port) (empty .Values.externalDatabase.database)) -}}
ghost: database
You disable the MariaDB installation but you did not provide the required parameters
You disable the MySQL installation but you did not provide the required parameters
to use an external database. To use an external database, please ensure you provide
(at least) the following values:

View File

@@ -128,8 +128,8 @@ spec:
valueFrom:
secretKeyRef:
name: {{ include "ghost.databaseSecretName" . }}
key: mariadb-password
{{- if (and (not .Values.mariadb.enabled) .Values.externalDatabase.ssl) }}
key: mysql-password
{{- if (and (not .Values.mysql.enabled) .Values.externalDatabase.ssl) }}
- name: GHOST_DATABASE_ENABLE_SSL
value: {{ .Values.externalDatabase.ssl | quote }}
- name: MYSQL_CLIENT_ENABLE_SSL

View File

@@ -1,4 +1,4 @@
{{- if (not (or .Values.mariadb.enabled .Values.externalDatabase.existingSecret)) }}
{{- if (not (or .Values.mysql.enabled .Values.externalDatabase.existingSecret)) }}
apiVersion: v1
kind: Secret
metadata:
@@ -14,6 +14,6 @@ metadata:
{{- end }}
type: Opaque
data:
mariadb-password: {{ .Values.externalDatabase.password | b64enc | quote }}
mysql-password: {{ .Values.externalDatabase.password | b64enc | quote }}
{{- end }}

View File

@@ -17,7 +17,7 @@ spec:
{{- if .Values.networkPolicy.ingressRules.customBackendSelector }}
{{- include "common.tplvalues.render" (dict "value" .Values.networkPolicy.ingressRules.customBackendSelector "context" $) | nindent 6 }}
{{- else }}
app.kubernetes.io/name: mariadb
app.kubernetes.io/name: mysql
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
ingress:

View File

@@ -43,16 +43,16 @@
}
}
},
"mariadb": {
"mysql": {
"type": "object",
"form": true,
"title": "MariaDB Details",
"title": "MySQL Details",
"properties": {
"enabled": {
"type": "boolean",
"title": "Use a new MariaDB database hosted in the cluster",
"title": "Use a new MySQL database hosted in the cluster",
"form": true,
"description": "Whether to deploy a mariadb server to satisfy the applications database requirements. To use an external database switch this off and configure the external database parameters"
"description": "Whether to deploy a mysql server to satisfy the applications database requirements. To use an external database switch this off and configure the external database parameters"
},
"primary": {
"type": "object",
@@ -66,7 +66,7 @@
"form": true,
"hidden": {
"value": false,
"path": "mariadb/enabled"
"path": "mysql/enabled"
},
"render": "slider",
"sliderMin": 1,
@@ -82,50 +82,50 @@
"externalDatabase": {
"type": "object",
"title": "External Database Details",
"description": "If MariaDB is disabled. Use this section to specify the external database details",
"description": "If MySQL is disabled. Use this section to specify the external database details",
"form": true,
"properties": {
"host": {
"type": "string",
"form": true,
"title": "Database Host",
"hidden": "mariadb/enabled"
"hidden": "mysql/enabled"
},
"user": {
"type": "string",
"form": true,
"title": "Database Username",
"hidden": "mariadb/enabled"
"hidden": "mysql/enabled"
},
"password": {
"type": "string",
"form": true,
"title": "Database Password",
"hidden": "mariadb/enabled"
"hidden": "mysql/enabled"
},
"database": {
"type": "string",
"form": true,
"title": "Database Name",
"hidden": "mariadb/enabled"
"hidden": "mysql/enabled"
},
"port": {
"type": "integer",
"form": true,
"title": "Database Port",
"hidden": "mariadb/enabled"
"hidden": "mysql/enabled"
},
"ssl": {
"type": "boolean",
"form": true,
"title": "Database SSL",
"hidden": "mariadb/enabled"
"hidden": "mysql/enabled"
},
"sslCaFile": {
"type": "string",
"form": true,
"title": "Database SSL CA filepath",
"hidden": "mariadb/enabled"
"hidden": "mysql/enabled"
}
}
},

View File

@@ -594,41 +594,41 @@ volumePermissions:
## @section Database Parameters
## MariaDB chart configuration
## ref: https://github.com/bitnami/charts/blob/master/bitnami/mariadb/values.yaml
## MySQL chart configuration
## ref: https://github.com/bitnami/charts/blob/master/bitnami/mysql/values.yaml
##
mariadb:
## @param mariadb.enabled Deploy a MariaDB server to satisfy the applications database requirements
mysql:
## @param mysql.enabled Deploy a MySQL server to satisfy the applications database requirements
## To use an external database set this to false and configure the `externalDatabase.*` parameters
##
enabled: true
## @param mariadb.architecture MariaDB architecture. Allowed values: `standalone` or `replication`
## @param mysql.architecture MySQL architecture. Allowed values: `standalone` or `replication`
##
architecture: standalone
## MariaDB Authentication parameters
## @param mariadb.auth.rootPassword MariaDB root password
## @param mariadb.auth.database MariaDB custom database
## @param mariadb.auth.username MariaDB custom user name
## @param mariadb.auth.password MariaDB custom user password
## @param mariadb.auth.existingSecret Existing secret with MariaDB credentials
## ref: https://github.com/bitnami/bitnami-docker-mariadb#setting-the-root-password-on-first-run
## https://github.com/bitnami/bitnami-docker-mariadb/blob/master/README.md#creating-a-database-on-first-run
## https://github.com/bitnami/bitnami-docker-mariadb/blob/master/README.md#creating-a-database-user-on-first-run
## MySQL Authentication parameters
## @param mysql.auth.rootPassword MySQL root password
## @param mysql.auth.database MySQL custom database
## @param mysql.auth.username MySQL custom user name
## @param mysql.auth.password MySQL custom user password
## @param mysql.auth.existingSecret Existing secret with MySQL credentials
## ref: https://github.com/bitnami/bitnami-docker-mysql#setting-the-root-password-on-first-run
## https://github.com/bitnami/bitnami-docker-mysql/blob/master/README.md#creating-a-database-on-first-run
## https://github.com/bitnami/bitnami-docker-mysql/blob/master/README.md#creating-a-database-user-on-first-run
auth:
rootPassword: ""
database: bitnami_ghost
username: bn_ghost
password: ""
existingSecret: ""
## MariaDB Primary configuration
## MySQL Primary configuration
##
primary:
## MariaDB Primary Persistence parameters
## MySQL Primary Persistence parameters
## ref: https://kubernetes.io/docs/user-guide/persistent-volumes/
## @param mariadb.primary.persistence.enabled Enable persistence on MariaDB using PVC(s)
## @param mariadb.primary.persistence.storageClass Persistent Volume storage class
## @param mariadb.primary.persistence.accessModes [array] Persistent Volume access modes
## @param mariadb.primary.persistence.size Persistent Volume size
## @param mysql.primary.persistence.enabled Enable persistence on MySQL using PVC(s)
## @param mysql.primary.persistence.storageClass Persistent Volume storage class
## @param mysql.primary.persistence.accessModes [array] Persistent Volume access modes
## @param mysql.primary.persistence.size Persistent Volume size
##
persistence:
enabled: true
@@ -637,7 +637,7 @@ mariadb:
- ReadWriteOnce
size: 8Gi
## External Database Configuration
## All of these values are only used if `mariadb.enabled=false`
## All of these values are only used if `mysql.enabled=false`
##
externalDatabase:
## @param externalDatabase.host External Database server host
@@ -656,7 +656,7 @@ externalDatabase:
##
database: bitnami_ghost
## @param externalDatabase.existingSecret The name of an existing secret with database credentials
## NOTE: Must contain key `mariadb-password`
## NOTE: Must contain key `mysql-password`
## NOTE: When it's set, the `externalDatabase.password` parameter is ignored
##
existingSecret: ""
@@ -692,7 +692,7 @@ networkPolicy:
## label: ingress
##
namespaceSelector: {}
## @param networkPolicy.ingressRules.backendOnlyAccessibleByFrontend Enable ingress rule that makes the backend (mariadb) only accessible by Ghost's pods.
## @param networkPolicy.ingressRules.backendOnlyAccessibleByFrontend Enable ingress rule that makes the backend (mysql) only accessible by Ghost's pods.
## @param networkPolicy.ingressRules.customBackendSelector Backend selector labels. These labels will be used to identify the backend pods.
## @param networkPolicy.ingressRules.accessOnlyFrom.enabled Enable ingress rule that makes Ghost only accessible from a particular origin
## @param networkPolicy.ingressRules.accessOnlyFrom.namespaceSelector Namespace selector label that is allowed to access Ghost. This label will be used to identified the allowed namespace(s).
@@ -700,7 +700,7 @@ networkPolicy:
## @param networkPolicy.ingressRules.customRules Custom network policy ingress rule
##
ingressRules:
## mariadb backend only can be accessed from Ghost
## mysql backend only can be accessed from Ghost
##
backendOnlyAccessibleByFrontend: false
customBackendSelector: {}