diff --git a/CHANGELOG.md b/CHANGELOG.md index aa2fffd77eddb363d39fb791ef3c6685b7b6f023..c9e5316ca023815ed9172b155622f885a8bed915 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,22 @@ +## Unreleased + +* Update mariadb chart to 9.6.0 + NOTE: the mariadb chart does not provide backwards compatibility in this + case, so manual action is required if you want to upgrade an existing + wordpress-helm release to this new version: either by migrating database data + from the old release to the new one, or by using the `existingClaim` + parameter(s) to reuse the existing persistent volumes. For details, see + [mariadb chart upgrade notes]( + https://artifacthub.io/packages/helm/bitnami/mariadb/9.6.0#to-8-0-0) + +## [0.2.2] - 2021-09-22 + +* Remove duplicate key `checksum/config` from template + +## [0.2.1] - 2021-09-16 + +* Allow setting custom labels on pods and statefulset + ## [0.2.0] - 2021-05-25 * Update Chart to apiVersion 2, move requirements to Chart.yaml diff --git a/Chart.yaml b/Chart.yaml index e4c01a34827adb15ff3b758c66c8731f72166d96..418aaff423fcee679febde8ab062f21dba5e42b6 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -5,11 +5,11 @@ description: WordPress with a replicated MariaDB backend name: wordpress # Please only change the chart version as part of the release procedure: see # RELEASING.md -version: 0.2.0 +version: 0.2.2 icon: https://make.wordpress.org/design/files/2016/09/WordPress-logotype-wmark.png dependencies: - name: mariadb - version: 7.3.16 + version: 9.6.0 repository: "https://charts.bitnami.com/bitnami" tags: - mysql diff --git a/README.md b/README.md index dc48a67d2e8b3e3af1d7caa007a38e21cb9b90a8..e4324e519e77b746b7404a14ba5e9bdf58c2c3b8 100644 --- a/README.md +++ b/README.md @@ -38,10 +38,10 @@ For a simple WordPress installation, you only need to edit the following values: | `ansibleVars.WP_TITLE` | The title of the site | Demo WP | | `ansibleVars.WP_THEME_ACTIVE` | A *slug* for the theme you want to install on your site (can also be changed through interface) | twentytwenty | | `ansibleVars.WP_EMAIL` | The administrator's email adress | youremailhere@example.com | -| `database.db.user` | Database user | wordpress | -| `database.db.password` | `wordpress` db user password | You **really** need to set this | -| `database.db.rootUser.password ` | root user password | You **really** need to set this | -| `database.db.replicationUser.password`| replication user password | You **really** need to set this | +| `database.auth.username` | Database user | wordpress | +| `database.auth.password` | `wordpress` db user password | You **really** need to set this | +| `database.auth.rootPassword ` | root user password | You **really** need to set this | +| `database.auth.replicationPassword` | replication user password | You **really** need to set this | You can read the descriptions of the other variables in `values-local.yaml.example` and of even more variables in `values.yaml`. diff --git a/templates/statefulset.yaml b/templates/statefulset.yaml index ca2a9488e27a7080815f20b4ba6a10ba20582347..02207ec25d2a55a81141b2cedd7663852cc83740 100644 --- a/templates/statefulset.yaml +++ b/templates/statefulset.yaml @@ -6,6 +6,9 @@ metadata: labels: app: {{ include "wordpress.name" . }} release: {{ .Release.Name }} + {{- if .Values.statefulSetLabels }} + {{- toYaml .Values.statefulSetLabels | nindent 4 }} + {{- end }} spec: selector: matchLabels: @@ -18,11 +21,13 @@ spec: labels: app: {{ include "wordpress.name" . }} release: {{ .Release.Name }} + {{- if .Values.podLabels }} + {{- toYaml .Values.podLabels | nindent 8 }} + {{- end }} annotations: # Reload the pod when values-local.yaml changes, so the ansible playbook # gets re-run. - checksum/config: {{ include (print $.Template.BasePath "/ansible-vars.yaml") . | sha256sum }} - checksum/config: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }} + checksum/config: {{ printf "%s%s" (include (print $.Template.BasePath "/ansible-vars.yaml") .) (include (print $.Template.BasePath "/secrets.yaml") .) | sha256sum }} {{- if .Values.podAnnotations }} {{- toYaml .Values.podAnnotations | nindent 8 }} {{- end }} @@ -52,20 +57,6 @@ spec: subPath: main.yml - name: ansible-secrets mountPath: /var/local/ansible/secrets - env: - - name: WORDPRESS_DB_HOST - value: {{ .Release.Name }}-database - - name: WORDPRESS_DB_USER - value: {{ .Values.database.db.user }} - - name: WORDPRESS_DB_PASSWORD - valueFrom: - secretKeyRef: - name: {{ .Release.Name }}-database - key: mariadb-password - - name: WORDPRESS_DB_NAME - value: {{ .Values.database.db.name }} - - name: WORDPRESS_TABLE_PREFIX - value: {{ .Values.wordPressTablePrefix }} containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" @@ -97,21 +88,6 @@ spec: successThreshold: {{ .Values.readinessProbe.successThreshold }} failureThreshold: {{ .Values.readinessProbe.failureThreshold }} {{- end }} - - env: - - name: WORDPRESS_DB_HOST - value: {{ .Release.Name }}-database - - name: WORDPRESS_DB_USER - value: {{ .Values.database.db.user }} - - name: WORDPRESS_DB_PASSWORD - valueFrom: - secretKeyRef: - name: {{ .Release.Name }}-database - key: mariadb-password - - name: WORDPRESS_DB_NAME - value: {{ .Values.database.db.name }} - - name: WORDPRESS_TABLE_PREFIX - value: {{ .Values.wordPressTablePrefix }} # readinessProbe: # httpGet: # path: / @@ -144,20 +120,6 @@ spec: securityContext: runAsNonRoot: false runAsUser: 0 - env: - - name: WORDPRESS_DB_HOST - value: {{ .Release.Name }}-database - - name: WORDPRESS_DB_USER - value: {{ .Values.database.db.user }} - - name: WORDPRESS_DB_PASSWORD - valueFrom: - secretKeyRef: - name: {{ .Release.Name }}-database - key: mariadb-password - - name: WORDPRESS_DB_NAME - value: {{ .Values.database.db.name }} - - name: WORDPRESS_TABLE_PREFIX - value: {{ .Values.wordPressTablePrefix }} volumeMounts: - name: {{ include "wordpress.name" . }}-wp-storage mountPath: /var/www/html diff --git a/values-local.yaml.example b/values-local.yaml.example index 51f827c12b8d39d115a7b68d9f3eb53fa7380fc6..d801919213211301a1697e1e49609fbb62fff450 100644 --- a/values-local.yaml.example +++ b/values-local.yaml.example @@ -118,13 +118,11 @@ openid_connect_settings: role_key: roles database: - db: - user: wordpress + auth: + username: wordpress password: <SET A DATABASE PASSWORD> - rootUser: - password: <SET A DB ROOT USER PASSWORD FOR UPGRADES TO WORK> - replication: - password: <SET A REPLICATION USER PASSWORD IF YOU HAVE REPLICATION ENABLED> + rootPassword: <SET A DB ROOT USER PASSWORD FOR UPGRADES TO WORK> + replicationPassword: <SET A REPLICATION USER PASSWORD IF YOU HAVE REPLICATION ENABLED> # Set this to true to have a Redis container next to your WP. The WP will be # configured to connect to this Redis and `Redis Object Cache` plugin will be @@ -221,3 +219,12 @@ redis: # service: # type: NodePort # port: 12345 + +# Labels that will be added to pods created by the wordpress StatefulSet. +# podLabels: +# key: value +# something: else + +# Labels that will be added to the wordpress StatefulSet itself. +# statefulSetLabels: +# someCustom: labelValue diff --git a/values.yaml b/values.yaml index 3c0943768bf9c097b32910f90e4fec0efe46e879..716fca151a9eb0bf4a34839e2a59115c69831364 100644 --- a/values.yaml +++ b/values.yaml @@ -220,13 +220,13 @@ ansibleVars: image: repository: open.greenhost.net:4567/openappstack/wordpress-helm/wordpress - tag: 0.2.0 + tag: 0.2.2 pullPolicy: Always pullSecrets: [] initImage: repository: open.greenhost.net:4567/openappstack/wordpress-helm/wordpress-cli-ansible - tag: 0.2.0 + tag: 0.2.2 pullPolicy: Always ingress: @@ -243,14 +243,14 @@ nodeSelector: {} tolerations: [] affinity: {} + database: - db: - user: wordpress + auth: + username: wordpress password: CHANGE-THIS-PASSWORD - name: wordpress_db - replication: - enabled: true - master: + database: wordpress_db + architecture: replication + primary: persistence: size: 4Gi config: |- @@ -274,7 +274,7 @@ database: [manager] port=3306 socket=/opt/bitnami/mariadb/tmp/mysql.sock - slave: + secondary: persistence: size: 4Gi config: |- @@ -298,6 +298,7 @@ database: [manager] port=3306 socket=/opt/bitnami/mariadb/tmp/mysql.sock + redis: # Set redis.enabled to true to have a Redis container next to your WP. The WP will be # configured to connect to this Redis and `Redis Object Cache` plugin will be @@ -330,11 +331,11 @@ ansibleSecrets: | BACKUP_NAME: {{ .Release.Name }} BACKUP_TARGET: {{ .Values.backup.target }} BACKUP_ISDATE: {{ .Values.backup.isDate }} - DB_HOST: {{ .Release.Name }}-database - DB_NAME: {{ .Values.database.db.name }} - DB_PASS: {{ .Values.database.db.password }} + DB_HOST: {{ .Release.Name }}-database-primary + DB_NAME: {{ .Values.database.auth.database }} + DB_PASS: {{ .Values.database.auth.password }} DB_PREFIX: {{ .Values.wordpress.config.db.prefix}} - DB_USER: {{ .Values.database.db.user }} + DB_USER: {{ .Values.database.auth.username }} LANGUAGES: {{ .Values.wordpress.site.languages }} DEFAULT_LANG: {{ .Values.wordpress.site.default_language }} WP_CONTENT_MOUNT: {{ .Values.wordpress.wp_content.mount_path }}