diff --git a/charts/mariadb/Chart.yaml b/charts/mariadb/Chart.yaml index 86a651e4166ebecf8a22ad590689cec18bbd067d..476f11a6a33620fa2549a253bd19d08e8981cb7e 100644 --- a/charts/mariadb/Chart.yaml +++ b/charts/mariadb/Chart.yaml @@ -7,6 +7,6 @@ type: application maintainers: - name: groundhog2k -version: 0.6.1 +version: 0.6.2 appVersion: "10.9.3" diff --git a/charts/mariadb/README.md b/charts/mariadb/README.md index 6c79ebea90234ad9b7bbadd8a4da43611d34a041..b907eefddec3075fa94c0436db8f9471f18f0d50 100644 --- a/charts/mariadb/README.md +++ b/charts/mariadb/README.md @@ -1,6 +1,6 @@ # MariaDB -   +   ## Changelog @@ -117,6 +117,7 @@ helm uninstall my-release | customConfig | string | `nil` | Additional MariaDB custom configuration mounted as `/etc/mysql/custom.cnf` | | extraEnvSecrets | list | `[]` | A list of existing secrets that will be mounted into the container as environment variables | | extraSecretConfigs | string | `nil` | An existing secret with files that will be mounted into the container as custom MariaDB configuration files (`*.cnf`) in `/etc/mysql/conf.d` | +| customScripts | object | `nil` | Optional custom scripts that can be defined inline and will be mounted as files in `/docker-entrypoint-initdb.d` | | extraScripts | string | `nil` | An existing configMap with files that will be mounted into the container as script files (`*.sql`, `*.sh`) in `/docker-entrypoint-initdb.d` | | extraSecrets | list | `[]` | A list of additional existing secrets that will be mounted into the container | | extraSecrets[].name | string | `nil` | Name of the existing K8s secret | diff --git a/charts/mariadb/RELEASENOTES.md b/charts/mariadb/RELEASENOTES.md index a09b145873c554331d53541ad57981927330c888..05eade4f1b6daacf2ab707b9a2103984aa4022b4 100644 --- a/charts/mariadb/RELEASENOTES.md +++ b/charts/mariadb/RELEASENOTES.md @@ -27,4 +27,5 @@ | 0.5.2 | 10.8.5 | Upgraded MariaDB to 10.8.5 | | 0.6.0 | 10.9.2 | Upgraded MariaDB to 10.9.2 | | 0.6.1 | 10.9.3 | Upgraded MariaDB to 10.9.3 | +| 0.6.2 | 10.9.3 | Implemented support for custom inline init scripts | | | | | diff --git a/charts/mariadb/templates/customscripts.yaml b/charts/mariadb/templates/customscripts.yaml new file mode 100644 index 0000000000000000000000000000000000000000..be82bf3a6f99989dfb95724dfa9cc53d43f67c88 --- /dev/null +++ b/charts/mariadb/templates/customscripts.yaml @@ -0,0 +1,13 @@ +{{- if .Values.customScripts }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "mariadb.fullname" . }}-customscripts + labels: + {{- include "mariadb.labels" . | nindent 4 }} +data: + {{- range $name, $value := .Values.customScripts }} + {{- $name | nindent 2 }}: | + {{- $value | nindent 4 }} + {{- end }} +{{- end }} diff --git a/charts/mariadb/templates/scripts.yaml b/charts/mariadb/templates/scripts.yaml index 369c753fb0ea0b31d73132eb0b9009f4ad563f34..150731d3e537a6bc0d0bf5e9b8b7eef80e75297b 100644 --- a/charts/mariadb/templates/scripts.yaml +++ b/charts/mariadb/templates/scripts.yaml @@ -12,6 +12,10 @@ data: echo "Copy extra scripts" cp /extrascripts/* /scripts fi + if [ -d /customscripts ]; then + echo "Copy custom scripts" + cp /customscripts/* /scripts + fi if [ -d /extraconfigs ]; then echo "Copy extra configs" cp /extraconfigs/* /configs diff --git a/charts/mariadb/templates/statefulset.yaml b/charts/mariadb/templates/statefulset.yaml index ae1287ac349c67b73fe2fc86dabbf7b8874525d8..20454851dabb7040a2be111f4644fb01ff94833e 100644 --- a/charts/mariadb/templates/statefulset.yaml +++ b/charts/mariadb/templates/statefulset.yaml @@ -21,6 +21,7 @@ spec: annotations: checksum/customconfig: {{ include (print $.Template.BasePath "/customconfig.yaml") . | sha256sum }} checksum/secureconfig: {{ include (print $.Template.BasePath "/secureconfig.yaml") . | sha256sum }} + checksum/customscripts: {{ include (print $.Template.BasePath "/customscripts.yaml") . | sha256sum }} checksum/scripts: {{ include (print $.Template.BasePath "/scripts.yaml") . | sha256sum }} {{- with .Values.podAnnotations }} {{- toYaml . | nindent 8 }} @@ -50,6 +51,10 @@ spec: - mountPath: /extrascripts name: extrascripts-volume {{- end }} + {{- if .Values.customScripts }} + - mountPath: /customscripts + name: customscripts-volume + {{- end }} {{- if .Values.extraSecretConfigs }} - mountPath: /extraconfigs name: extraconfigs-volume @@ -212,6 +217,12 @@ spec: configMap: name: {{ include "mariadb.fullname" . }}-scripts defaultMode: 0555 + {{- if .Values.customScripts }} + - name: customscripts-volume + configMap: + name: {{ include "mariadb.fullname" . }}-customscripts + defaultMode: 0555 + {{- end }} {{- if .Values.extraSecretConfigs }} - name: extraconfigs-volume secret: diff --git a/charts/mariadb/values.yaml b/charts/mariadb/values.yaml index 48524c5f415838e6b57e84224848a5454cdbba18..54411d63461c550e68d8a39164cefb87a5da2212 100644 --- a/charts/mariadb/values.yaml +++ b/charts/mariadb/values.yaml @@ -152,6 +152,13 @@ userDatabase: {} ## For more flexible options see extraSecretConfigs: section customConfig: | +## Optional custom scripts that can be defined inline and will be mounted as files in /docker-entrypoint-initdb.d +customScripts: {} +# 01-a-script.sh: | +# echo "hello" +# 02-another-script.sh: | +# echo "hello 2" + ## A list of existing secrets that will be mounted into the container as environment variables ## As an alternative these secrets can set the database root password or optional user database when userDatabase: and rootPassword: were not specified ## For example: Setting MARIADB_DATABASE, MARIADB_USER, MARIADB_PASSWORD will allow creating a user database and grant access for the given user diff --git a/charts/mongodb/Chart.yaml b/charts/mongodb/Chart.yaml index 0155b62097411ecd737ea8e2553ad5e8064a20db..8cf443f6dd42d1dd34147eaf4045714776acd298 100644 --- a/charts/mongodb/Chart.yaml +++ b/charts/mongodb/Chart.yaml @@ -7,6 +7,6 @@ type: application maintainers: - name: groundhog2k -version: 0.5.0 +version: 0.5.1 appVersion: "6.0.1" diff --git a/charts/mongodb/README.md b/charts/mongodb/README.md index 8e0346344e8acdf38123e68759102412a0ba63b3..43c0d5f3a98c08a8d800e9cc1f97287f0ad62ea4 100644 --- a/charts/mongodb/README.md +++ b/charts/mongodb/README.md @@ -1,6 +1,6 @@ # MongoDB -   +   ## Changelog @@ -116,6 +116,7 @@ helm uninstall my-release | customConfig | string | `nil` | Custom MongoDB configuration block that will be mounted as file in `/etc/mongo/custom.conf` | | extraEnvSecrets | list | `[]` | A list of existing secrets that will be mounted into the container as environment variables | | extraSecretConfigs | string | `nil` | An existing secret with files that will be added to the mongodb configuration in addition to `/etc/mongo/custom.conf` | +| customScripts | object | `nil` | Optional custom scripts that can be defined inline and will be mounted as files in `/docker-entrypoint-initdb.d` | | extraScripts | string | `nil` | An existing configMap with files that will be mounted into the container as script files (`*.js`, `*.sh`) in `/docker-entrypoint-initdb.d` | | extraSecrets | list | `[]` | A list of additional existing secrets that will be mounted into the container | | extraSecrets[].name | string | `nil` | Name of the existing K8s secret | diff --git a/charts/mongodb/RELEASENOTES.md b/charts/mongodb/RELEASENOTES.md index fe8af3279dfc6b21315f536ff8ddea829ae74dc8..5d057fb9582e58d2fc7c260882eaa4422ba56318 100644 --- a/charts/mongodb/RELEASENOTES.md +++ b/charts/mongodb/RELEASENOTES.md @@ -30,4 +30,5 @@ | 0.4.9 | 5.0.11 | Upgraded to MongoDB 5.0.11 | | 0.4.10 | 5.0.12 | Upgraded to MongoDB 5.0.12 | | 0.5.0 | 6.0.1 | Upgraded to MongoDB 6.0.1 | +| 0.5.1 | 6.0.1 | Implemented support for custom inline init scripts | | | | | diff --git a/charts/mongodb/templates/customscripts.yaml b/charts/mongodb/templates/customscripts.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f6ea68eb13fa032b575ead4075ee608398128735 --- /dev/null +++ b/charts/mongodb/templates/customscripts.yaml @@ -0,0 +1,13 @@ +{{- if .Values.customScripts }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "mongodb.fullname" . }}-customscripts + labels: + {{- include "mongodb.labels" . | nindent 4 }} +data: + {{- range $name, $value := .Values.customScripts }} + {{- $name | nindent 2 }}: | + {{- $value | nindent 4 }} + {{- end }} +{{- end }} diff --git a/charts/mongodb/templates/scripts.yaml b/charts/mongodb/templates/scripts.yaml index e87ac0fa14c6b147b6ec4f524d54238f3ec3cfde..f198a17a9878c7b3d0f245f4534367692051067b 100644 --- a/charts/mongodb/templates/scripts.yaml +++ b/charts/mongodb/templates/scripts.yaml @@ -27,6 +27,10 @@ data: echo "Copy extra scripts" cp /extrascripts/* /scripts fi + if [ -d /customscripts ]; then + echo "Copy custom scripts" + cp /customscripts/* /scripts + fi if [ -d /customconfig ]; then echo "Create custom mongodb config" cat /customconfig/* >>/configs/custom.conf diff --git a/charts/mongodb/templates/statefulset.yaml b/charts/mongodb/templates/statefulset.yaml index 4182a09b212b7cb27cb6b4ab7128dd72eaf0c3ef..8d0f811b75ebcb080b4cd5422ed458f2601c6548 100644 --- a/charts/mongodb/templates/statefulset.yaml +++ b/charts/mongodb/templates/statefulset.yaml @@ -21,6 +21,7 @@ spec: annotations: checksum/customconfig: {{ include (print $.Template.BasePath "/customconfig.yaml") . | sha256sum }} checksum/secureconfig: {{ include (print $.Template.BasePath "/secureconfig.yaml") . | sha256sum }} + checksum/customscripts: {{ include (print $.Template.BasePath "/customscripts.yaml") . | sha256sum }} checksum/scripts: {{ include (print $.Template.BasePath "/scripts.yaml") . | sha256sum }} {{- with .Values.podAnnotations }} {{- toYaml . | nindent 8 }} @@ -54,6 +55,10 @@ spec: - mountPath: /extraconfigs name: extraconfigs-volume {{- end }} + {{- if .Values.customScripts }} + - mountPath: /customscripts + name: customscripts-volume + {{- end }} {{- if .Values.customConfig }} - mountPath: /customconfig name: customconfig-volume @@ -88,9 +93,9 @@ spec: startupProbe: exec: command: - - mongosh - - --eval - - "db.adminCommand('ping')" + - /bin/sh + - -c + - mongosh --eval "db.adminCommand('ping')" {{- with .Values.startupProbe }} initialDelaySeconds: {{ .initialDelaySeconds }} timeoutSeconds: {{ .timeoutSeconds }} @@ -108,9 +113,9 @@ spec: livenessProbe: exec: command: - - mongosh - - --eval - - "db.adminCommand('ping')" + - /bin/sh + - -c + - mongosh --eval "db.adminCommand('ping')" {{- with .Values.livenessProbe }} initialDelaySeconds: {{ .initialDelaySeconds }} timeoutSeconds: {{ .timeoutSeconds }} @@ -128,9 +133,9 @@ spec: readinessProbe: exec: command: - - mongosh - - --eval - - "db.adminCommand('ping')" + - /bin/sh + - -c + - mongosh --eval "db.adminCommand('ping')" {{- with .Values.readinessProbe }} initialDelaySeconds: {{ .initialDelaySeconds }} timeoutSeconds: {{ .timeoutSeconds }} @@ -209,7 +214,13 @@ spec: configMap: name: {{ .Values.extraScripts }} defaultMode: 0555 - {{- end }} + {{- end }} + {{- if .Values.customScripts }} + - name: customscripts-volume + configMap: + name: {{ include "mongodb.fullname" . }}-customscripts + defaultMode: 0555 + {{- end }} {{- if .Values.extraSecretConfigs }} - name: extraconfigs-volume secret: diff --git a/charts/mongodb/values.yaml b/charts/mongodb/values.yaml index 409c68524ae371dafc0f844b60c9a93a6f90bd29..717d412345f21ddd77651b508042e74484f1efac 100644 --- a/charts/mongodb/values.yaml +++ b/charts/mongodb/values.yaml @@ -145,6 +145,13 @@ userDatabase: {} ## For more flexible options see extraSecretConfigs: section customConfig: | +## Optional custom scripts that can be defined inline and will be mounted as files in /docker-entrypoint-initdb.d +customScripts: {} +# 01-a-script.sh: | +# echo "hello" +# 02-another-script.sh: | +# echo "hello 2" + ## A list of existing secrets that will be mounted into the container as environment variables ## As an alternative these secrets can set the database root user and password or other options when settings.rootUsername and settings.rootPassword was not specified ## For example: Setting MONGO_INITDB_DATABASE, USERDB_USER, USERDB_PASSWORD will allow creating a user database and grant access for the given user diff --git a/charts/mysql/Chart.yaml b/charts/mysql/Chart.yaml index 7d0b0af834dbb863087f007eaf774b8c8b4484e8..3b00f2814bbf4c22565b6a9cec1286778d4f125a 100644 --- a/charts/mysql/Chart.yaml +++ b/charts/mysql/Chart.yaml @@ -7,6 +7,6 @@ type: application maintainers: - name: groundhog2k -version: 0.1.1 +version: 0.1.2 appVersion: "8.0.30-oracle" diff --git a/charts/mysql/README.md b/charts/mysql/README.md index 2ec87dd01a77e4048bf6e251485f1eea4982dadc..0b56cf1eb2293ac76ff066795dc43672cadc72ec 100644 --- a/charts/mysql/README.md +++ b/charts/mysql/README.md @@ -1,6 +1,6 @@ # MySQL -   +   ## Changelog @@ -117,6 +117,7 @@ helm uninstall my-release | customConfig | string | `nil` | Additional MySQL custom configuration mounted as `/etc/mysql/custom.cnf` | | extraEnvSecrets | list | `[]` | A list of existing secrets that will be mounted into the container as environment variables | | extraSecretConfigs | string | `nil` | An existing secret with files that will be mounted into the container as custom MySQL configuration files (`*.cnf`) in `/etc/mysql/conf.d` | +| customScripts | object | `nil` | Optional custom scripts that can be defined inline and will be mounted as files in `/docker-entrypoint-initdb.d` | | extraScripts | string | `nil` | An existing configMap with files that will be mounted into the container as script files (`*.sql`, `*.sh`) in `/docker-entrypoint-initdb.d` | | extraSecrets | list | `[]` | A list of additional existing secrets that will be mounted into the container | | extraSecrets[].name | string | `nil` | Name of the existing K8s secret | diff --git a/charts/mysql/RELEASENOTES.md b/charts/mysql/RELEASENOTES.md index c89b281e9e5b9149c6e868f5433df090fdd7bc90..e36568048fb1c2691fd70f70e21ed12862ff5c72 100644 --- a/charts/mysql/RELEASENOTES.md +++ b/charts/mysql/RELEASENOTES.md @@ -4,4 +4,5 @@ | :------------ | :---------- | :----------------- | | 0.1.0 | 8.0.29 | Initial version of chart | | 0.1.1 | 8.0.30 | Upgraded MySQL to 8.0.30 | +| 0.1.2 | 8.0.30 | Implemented support for custom inline init scripts | | | | | diff --git a/charts/mysql/templates/customscripts.yaml b/charts/mysql/templates/customscripts.yaml new file mode 100644 index 0000000000000000000000000000000000000000..bf903b247ea4252ed61370ad2c7342fb83532879 --- /dev/null +++ b/charts/mysql/templates/customscripts.yaml @@ -0,0 +1,13 @@ +{{- if .Values.customScripts }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "mysql.fullname" . }}-customscripts + labels: + {{- include "mysql.labels" . | nindent 4 }} +data: + {{- range $name, $value := .Values.customScripts }} + {{- $name | nindent 2 }}: | + {{- $value | nindent 4 }} + {{- end }} +{{- end }} diff --git a/charts/mysql/templates/scripts.yaml b/charts/mysql/templates/scripts.yaml index 989333e63cfa1b6c23d634605ff51483da2e8161..c80ab89d1b385250455dab95a639583ebdc22b4b 100644 --- a/charts/mysql/templates/scripts.yaml +++ b/charts/mysql/templates/scripts.yaml @@ -12,6 +12,10 @@ data: echo "Copy extra scripts" cp /extrascripts/* /scripts fi + if [ -d /customscripts ]; then + echo "Copy custom scripts" + cp /customscripts/* /scripts + fi if [ -d /extraconfigs ]; then echo "Copy extra configs" cp /extraconfigs/* /configs diff --git a/charts/mysql/templates/statefulset.yaml b/charts/mysql/templates/statefulset.yaml index abd876cf3fc6ca8aef970ae7ca4d492927759395..007a5d8078c9ed68dac59163ee1935d96477e694 100644 --- a/charts/mysql/templates/statefulset.yaml +++ b/charts/mysql/templates/statefulset.yaml @@ -21,6 +21,7 @@ spec: annotations: checksum/customconfig: {{ include (print $.Template.BasePath "/customconfig.yaml") . | sha256sum }} checksum/secureconfig: {{ include (print $.Template.BasePath "/secureconfig.yaml") . | sha256sum }} + checksum/customscripts: {{ include (print $.Template.BasePath "/customscripts.yaml") . | sha256sum }} checksum/scripts: {{ include (print $.Template.BasePath "/scripts.yaml") . | sha256sum }} {{- with .Values.podAnnotations }} {{- toYaml . | nindent 8 }} @@ -50,6 +51,10 @@ spec: - mountPath: /extrascripts name: extrascripts-volume {{- end }} + {{- if .Values.customScripts }} + - mountPath: /customscripts + name: customscripts-volume + {{- end }} {{- if .Values.extraSecretConfigs }} - mountPath: /extraconfigs name: extraconfigs-volume @@ -212,6 +217,12 @@ spec: configMap: name: {{ include "mysql.fullname" . }}-scripts defaultMode: 0555 + {{- if .Values.customScripts }} + - name: customscripts-volume + configMap: + name: {{ include "mysql.fullname" . }}-customscripts + defaultMode: 0555 + {{- end }} {{- if .Values.extraSecretConfigs }} - name: extraconfigs-volume secret: diff --git a/charts/mysql/values.yaml b/charts/mysql/values.yaml index cdbd7e3f21345105fb35e3f51dbf45b6ff6b3d43..8f9281b132f01289445e7d97939cd5fa30078605 100644 --- a/charts/mysql/values.yaml +++ b/charts/mysql/values.yaml @@ -152,6 +152,12 @@ userDatabase: {} ## For more flexible options see extraSecretConfigs: section customConfig: | +customScripts: {} +# 01-a-script.sh: | +# echo "hello" +# 02-another-script.sh: | +# echo "hello 2" + ## A list of existing secrets that will be mounted into the container as environment variables ## As an alternative these secrets can set the database root password or optional user database when userDatabase: and rootPassword: were not specified ## For example: Setting MYSQL_DATABASE, MYSQL_USER, MYSQL_PASSWORD will allow creating a user database and grant access for the given user diff --git a/charts/postgres/Chart.yaml b/charts/postgres/Chart.yaml index 4cfe061e7045f8d9268f436eb4fecbe02eeb33cc..88985572449c0ee9cf65968902fd87f46f9ef4e9 100644 --- a/charts/postgres/Chart.yaml +++ b/charts/postgres/Chart.yaml @@ -7,6 +7,6 @@ type: application maintainers: - name: groundhog2k -version: 0.4.0 +version: 0.3.12 appVersion: "14.5" diff --git a/charts/postgres/README.md b/charts/postgres/README.md index c8f4e2a7ab90b63d8729dbe67e835251338c516f..935a724695e1da87fff21a10ba4e2fb53f2ef048 100644 --- a/charts/postgres/README.md +++ b/charts/postgres/README.md @@ -1,6 +1,6 @@ # PostgreSQL -   +   ## Changelog diff --git a/charts/postgres/RELEASENOTES.md b/charts/postgres/RELEASENOTES.md index 4c71a430b832b826623026fc744ce92c68a1f083..73679794bf8325a2685e6fd48aeaf1037185ca9e 100644 --- a/charts/postgres/RELEASENOTES.md +++ b/charts/postgres/RELEASENOTES.md @@ -16,5 +16,5 @@ | 0.3.9 | 14.3 | Upgraded to Postgres 14.3 | | 0.3.10 | 14.4 | Upgraded to Postgres 14.4 | | 0.3.11 | 14.5 | Upgraded to Postgres 14.5 | -| 0.4.0 | 14.5 | Implemented support for custom inline init scripts | +| 0.3.12 | 14.5 | Implemented support for custom inline init scripts | | | | |