Skip to content

Commit 65583c5

Browse files
authored
Merge pull request #197 from djjudas21/scrap_bitnami
Swap Bitnami MariaDB out for MariaDB Operator CRs
2 parents c65e7e8 + fad28d5 commit 65583c5

File tree

8 files changed

+165
-81
lines changed

8 files changed

+165
-81
lines changed

charts/domainmod/Chart.yaml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ type: application
99
# This is the chart version. This version number should be incremented each time you make changes
1010
# to the chart and its templates, including the app version.
1111
# Versions are expected to follow Semantic Versioning (https://semver.org/)
12-
version: 0.5.4
12+
version: 1.0.0
1313

1414
# This is the version number of the application being deployed. This version number should be
1515
# incremented each time you make changes to the application. Versions are not expected to
@@ -28,12 +28,8 @@ sources:
2828
maintainers:
2929
- name: djjudas21
3030
email: djjudas21@users.noreply.github.com
31-
dependencies:
32-
- name: mariadb
33-
version: ~20
34-
repository: https://charts.bitnami.com/bitnami
35-
condition: mariadb.enabled
31+
dependencies: []
3632
annotations:
3733
artifacthub.io/changes: |-
3834
- kind: changed
39-
description: Switch to bitnamilegacy image as a stopgap
35+
description: Switch to use MariaDB Operator to deploy MariaDB

charts/domainmod/README.md

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
# domainmod
22

3-
![Version: 0.5.4](https://img.shields.io/badge/Version-0.5.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 4.23.0](https://img.shields.io/badge/AppVersion-4.23.0-informational?style=flat-square)
3+
![Version: 1.0.0](https://img.shields.io/badge/Version-1.0.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 4.23.0](https://img.shields.io/badge/AppVersion-4.23.0-informational?style=flat-square)
44

55
DomainMOD is a self-hosted open source application used to manage your domains and other Internet assets in a central location
66

7+
> [!WARNING]
8+
> This chart now uses the [MariaDB Operator](https://github.com/mariadb-operator/mariadb-operator) (which must be installed separately) to provision a MariaDB instance.
9+
> Your values **will** need to be configured based on the new default values in the chart.
10+
> Bitnami MariaDB will be **deleted upon upgrade**, so make sure you have exported your DomainMOD config, ready to re-import after upgrade!
11+
712
**Homepage:** <https://github.com/djjudas21/charts/tree/master/charts/domainmod>
813

914
## Maintainers
@@ -18,12 +23,6 @@ DomainMOD is a self-hosted open source application used to manage your domains a
1823
* <https://domainmod.org/>
1924
* <https://hub.docker.com/r/domainmod/domainmod>
2025

21-
## Requirements
22-
23-
| Repository | Name | Version |
24-
|------------|------|---------|
25-
| https://charts.bitnami.com/bitnami | mariadb | ~20 |
26-
2726
## Values
2827

2928
| Key | Type | Default | Description |
@@ -32,14 +31,12 @@ DomainMOD is a self-hosted open source application used to manage your domains a
3231
| deploymentAnnotations | object | `{}` | |
3332
| deploymentLabels | object | `{}` | |
3433
| env | object | See below | environment variables |
35-
| env.DOMAINMOD_DATABASE | string | `"domainmod"` | The name of the database. Set this to whatever you want, but it should match the database name in your database container. |
36-
| env.DOMAINMOD_DATABASE_HOST | string | `"domainmod-mariadb"` | The database hostname that DomainMOD should connect to. This needs to be the same name as the datbase container. |
37-
| env.DOMAINMOD_PASSWORD | string | `"domainmod"` | The password for DOMAINMOD_USER. Set this to whatever you want, but it should match the database password in your database container. |
38-
| env.DOMAINMOD_USER | string | `"domainmod"` | The name of the database user. Set this to whatever you want, but it should match the database user in your database container. |
34+
| env.DOMAINMOD_DATABASE | string | `""` | The name of the database. You do not need to configure this if you are using the MariaDB Operator integration. |
35+
| env.DOMAINMOD_DATABASE_HOST | string | `""` | The database hostname that DomainMOD should connect to. You do not need to configure this if you are using the MariaDB Operator integration. |
36+
| env.DOMAINMOD_PASSWORD | string | `""` | The password for DOMAINMOD_USER. You do not need to configure this if you are using the MariaDB Operator integration. |
37+
| env.DOMAINMOD_USER | string | `""` | The name of the database user. You do not need to configure this if you are using the MariaDB Operator integration. |
3938
| env.DOMAINMOD_WEB_ROOT | string | `nil` | Set this if you plan on running DomainMOD in a subdirectory, otherwise leave it blank. |
4039
| env.TZ | string | `"UTC"` | Container timezone |
41-
| externalMariadb | object | `{"auth":{"database":"domainmod","host":"","password":"","port":3306,"username":""},"enabled":false}` | Enable and configure external mariadb database |
42-
| externalMariadb.auth | object | `{"database":"domainmod","host":"","password":"","port":3306,"username":""}` | Name of the secret key containing the database URI uriKey: |
4340
| fullnameOverride | string | `""` | |
4441
| image.pullPolicy | string | `"IfNotPresent"` | image pull policy |
4542
| image.repository | string | `"domainmod/domainmod"` | image repository |
@@ -48,11 +45,16 @@ DomainMOD is a self-hosted open source application used to manage your domains a
4845
| ingress | object | See values.yaml | Enable and configure ingress settings for the chart under this key. |
4946
| livenessProbe.httpGet.path | string | `"/"` | |
5047
| livenessProbe.httpGet.port | string | `"http"` | |
51-
| mariadb | object | https://github.com/bitnami/charts/blob/master/bitnami/mariadb/values.yaml | Enable and configure mariadb database subchart under this key. For more options see [mariadb chart documentation](https://github.com/bitnami/charts/tree/master/bitnami/mariadb) |
52-
| mariadb.auth.database | string | `"domainmod"` | Database name |
53-
| mariadb.auth.password | string | `"domainmod"` | Database password |
54-
| mariadb.auth.rootPassword | string | `"domainmodadminpw"` | Database root password |
55-
| mariadb.auth.username | string | `"domainmod"` | Database user |
48+
| mariadbOperator | object | `{"auth":{"database":"domainmod","password":"domainmod","rootPassword":"domainmodadminpw","username":"domainmod"},"enabled":false,"persistence":{"size":"1Gi","storageClass":""},"resources":{}}` | Enable integration with MariaDB Operator This uses the MariaDB Operator (which must be installed separately) to provision a MariaDB instance. |
49+
| mariadbOperator.auth.database | string | `"domainmod"` | Database name to create |
50+
| mariadbOperator.auth.password | string | `"domainmod"` | Database password to create |
51+
| mariadbOperator.auth.rootPassword | string | `"domainmodadminpw"` | Database root password to create |
52+
| mariadbOperator.auth.username | string | `"domainmod"` | Database user to create |
53+
| mariadbOperator.enabled | bool | `false` | Enable integration with MariaDB Operator |
54+
| mariadbOperator.persistence | object | `{"size":"1Gi","storageClass":""}` | Persistence settings for MariaDB instance |
55+
| mariadbOperator.persistence.size | string | `"1Gi"` | Size of volume to provision for MariaDB instance |
56+
| mariadbOperator.persistence.storageClass | string | `""` | Storage class to use to provision volume for MariaDB instance |
57+
| mariadbOperator.resources | object | `{}` | Resources for MariaDB instance |
5658
| nameOverride | string | `""` | |
5759
| nodeSelector | object | `{}` | |
5860
| podAnnotations | object | `{}` | |
@@ -71,4 +73,4 @@ DomainMOD is a self-hosted open source application used to manage your domains a
7173
| tolerations | list | `[]` | |
7274

7375
----------------------------------------------
74-
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)
76+
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)

charts/domainmod/README.md.gotmpl

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{{ template "chart.header" . }}
2+
{{ template "chart.deprecationWarning" . }}
3+
4+
{{ template "chart.badgesSection" . }}
5+
6+
{{ template "chart.description" . }}
7+
8+
> [!WARNING]
9+
> This chart now uses the [MariaDB Operator](https://github.com/mariadb-operator/mariadb-operator) (which must be installed separately) to provision a MariaDB instance.
10+
> Your values **will** need to be configured based on the new default values in the chart.
11+
> Bitnami MariaDB will be **deleted upon upgrade**, so make sure you have exported your DomainMOD config, ready to re-import after upgrade!
12+
13+
{{ template "chart.homepageLine" . }}
14+
15+
{{ template "chart.maintainersSection" . }}
16+
17+
{{ template "chart.sourcesSection" . }}
18+
19+
{{ template "chart.requirementsSection" . }}
20+
21+
{{ template "chart.valuesSection" . }}
22+
23+
{{ template "helm-docs.versionFooter" . }}

charts/domainmod/templates/_helpers.tpl

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -67,19 +67,3 @@ Create the name of the credentials secret
6767
{{- define "domainmod.credentialsSecretName" -}}
6868
{{ .Values.domainmod.secretName | default (printf "%s-credentials" (include "domainmod.fullname" .)) }}
6969
{{- end }}
70-
71-
{{/*
72-
Build database connection strings as templates
73-
*/}}
74-
{{- define "domainmod.postgresConnectString" -}}
75-
postgres://{{- .Values.postgresql.auth.username -}}:{{- .Values.postgresql.auth.password -}}@{{- include "domainmod.fullname" . -}}-postgresql/{{- .Values.postgresql.auth.database -}}
76-
{{- end }}
77-
{{- define "domainmod.externalPostgresConnectString" -}}
78-
postgres://{{- .Values.externalPostgresql.auth.username -}}:{{- .Values.externalPostgresql.auth.password -}}@{{- .Values.externalPostgresql.auth.host -}}:{{- .Values.externalPostgresql.auth.port -}}/{{- .Values.externalPostgresql.auth.database -}}
79-
{{- end }}
80-
{{- define "domainmod.mariadbConnectString" -}}
81-
mysql://{{- .Values.mariadb.auth.username -}}:{{- .Values.mariadb.auth.password -}}@{{- include "domainmod.fullname" . -}}-mariadb/{{- .Values.mariadb.auth.database -}}
82-
{{- end }}
83-
{{- define "domainmod.externalMariadbConnectString" -}}
84-
mysql://{{- .Values.externalMariadb.auth.username -}}:{{- .Values.externalMariadb.auth.password -}}@{{- .Values.externalMariadb.auth.host -}}:{{- .Values.externalMariadb.auth.port -}}/{{- .Values.externalMariadb.auth.database -}}
85-
{{- end }}

charts/domainmod/templates/deployment.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,19 @@ spec:
4444
env:
4545
- name: DOMAINMOD_WEB_ROOT
4646
value: {{ .Values.env.DOMAINMOD_WEB_ROOT }}
47+
{{- if .Values.mariadbOperator.enabled }}
48+
- name: DOMAINMOD_DATABASE_HOST
49+
value: {{ include "domainmod.fullname" . }}-mariadb
50+
- name: DOMAINMOD_DATABASE
51+
value: {{ include "domainmod.fullname" . }}
52+
- name: DOMAINMOD_USER
53+
value: {{ .Values.mariadbOperator.auth.username }}
54+
- name: DOMAINMOD_PASSWORD
55+
valueFrom:
56+
secretKeyRef:
57+
name: {{ include "domainmod.fullname" . }}-mariadb-user
58+
key: password
59+
{{- else }}
4760
- name: DOMAINMOD_DATABASE_HOST
4861
value: {{ .Values.env.DOMAINMOD_DATABASE_HOST }}
4962
- name: DOMAINMOD_DATABASE
@@ -52,6 +65,7 @@ spec:
5265
value: {{ .Values.env.DOMAINMOD_USER }}
5366
- name: DOMAINMOD_PASSWORD
5467
value: {{ .Values.env.DOMAINMOD_PASSWORD }}
68+
{{- end }}
5569
ports:
5670
- name: http
5771
containerPort: {{ .Values.service.port }}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{{- if .Values.mariadbOperator.enabled }}
2+
apiVersion: v1
3+
kind: Secret
4+
metadata:
5+
name: {{ include "domainmod.fullname" . }}-mariadb-user
6+
data:
7+
password: {{ .Values.mariadbOperator.auth.password | b64enc }}
8+
---
9+
apiVersion: k8s.mariadb.com/v1alpha1
10+
kind: Database
11+
metadata:
12+
name: {{ include "domainmod.fullname" . }}
13+
spec:
14+
mariaDbRef:
15+
name: {{ include "domainmod.fullname" . }}-mariadb
16+
characterSet: utf8
17+
collate: utf8_general_ci
18+
---
19+
apiVersion: k8s.mariadb.com/v1alpha1
20+
kind: User
21+
metadata:
22+
name: {{ .Values.mariadbOperator.auth.username }}
23+
spec:
24+
mariaDbRef:
25+
name: {{ include "domainmod.fullname" . }}-mariadb
26+
passwordSecretKeyRef:
27+
name: {{ include "domainmod.fullname" . }}-mariadb-user
28+
key: password
29+
maxUserConnections: 20
30+
host: "%"
31+
---
32+
apiVersion: k8s.mariadb.com/v1alpha1
33+
kind: Grant
34+
metadata:
35+
name: {{ include "domainmod.fullname" . }}-{{ .Values.mariadbOperator.auth.username }}
36+
spec:
37+
mariaDbRef:
38+
name: {{ include "domainmod.fullname" . }}-mariadb
39+
privileges:
40+
- "ALL PRIVILEGES"
41+
database: {{ include "domainmod.fullname" . }}
42+
table: "*"
43+
username: {{ .Values.mariadbOperator.auth.username }}
44+
grantOption: false
45+
host: "%"
46+
{{- end }}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{{- if .Values.mariadbOperator.enabled }}
2+
apiVersion: v1
3+
kind: Secret
4+
metadata:
5+
name: {{ include "domainmod.fullname" . }}-mariadb-root
6+
data:
7+
root-password: {{ .Values.mariadbOperator.auth.rootPassword | b64enc }}
8+
---
9+
apiVersion: k8s.mariadb.com/v1alpha1
10+
kind: MariaDB
11+
metadata:
12+
name: {{ include "domainmod.fullname" . }}-mariadb
13+
spec:
14+
rootPasswordSecretKeyRef:
15+
name: {{ include "domainmod.fullname" . }}-mariadb-root
16+
key: root-password
17+
storage:
18+
size: {{ .Values.mariadbOperator.persistence.size }}
19+
storageClassName: {{ .Values.mariadbOperator.persistence.storageClass }}
20+
replicas: 1
21+
updateStrategy:
22+
autoUpdateDataPlane: true
23+
service:
24+
type: ClusterIP
25+
primaryService:
26+
type: ClusterIP
27+
secondaryService:
28+
type: ClusterIP
29+
resources:
30+
{{- toYaml .Values.resources | nindent 4 }}
31+
metrics:
32+
enabled: true
33+
{{- end }}

charts/domainmod/values.yaml

Lines changed: 25 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ env:
2424
TZ: UTC
2525
# -- Set this if you plan on running DomainMOD in a subdirectory, otherwise leave it blank.
2626
DOMAINMOD_WEB_ROOT:
27-
# -- The database hostname that DomainMOD should connect to. This needs to be the same name as the datbase container.
28-
DOMAINMOD_DATABASE_HOST: domainmod-mariadb
29-
# -- The name of the database. Set this to whatever you want, but it should match the database name in your database container.
30-
DOMAINMOD_DATABASE: domainmod
31-
# -- The name of the database user. Set this to whatever you want, but it should match the database user in your database container.
32-
DOMAINMOD_USER: domainmod
33-
# -- The password for DOMAINMOD_USER. Set this to whatever you want, but it should match the database password in your database container.
34-
DOMAINMOD_PASSWORD: domainmod
27+
# -- The database hostname that DomainMOD should connect to. You do not need to configure this if you are using the MariaDB Operator integration.
28+
DOMAINMOD_DATABASE_HOST: ""
29+
# -- The name of the database. You do not need to configure this if you are using the MariaDB Operator integration.
30+
DOMAINMOD_DATABASE: ""
31+
# -- The name of the database user. You do not need to configure this if you are using the MariaDB Operator integration.
32+
DOMAINMOD_USER: ""
33+
# -- The password for DOMAINMOD_USER. You do not need to configure this if you are using the MariaDB Operator integration.
34+
DOMAINMOD_PASSWORD: ""
3535

3636
serviceAccount:
3737
# -- Specifies whether a service account should be created
@@ -107,40 +107,26 @@ tolerations: []
107107

108108
affinity: {}
109109

110-
# -- Enable and configure mariadb database subchart under this key.
111-
# For more options see [mariadb chart documentation](https://github.com/bitnami/charts/tree/master/bitnami/mariadb)
112-
# @default -- https://github.com/bitnami/charts/blob/master/bitnami/mariadb/values.yaml
113-
mariadb:
110+
# -- Enable integration with MariaDB Operator
111+
# This uses the MariaDB Operator (which must be installed
112+
# separately) to provision a MariaDB instance.
113+
mariadbOperator:
114+
# -- Enable integration with MariaDB Operator
114115
enabled: false
115-
image:
116-
repository: bitnamilegacy/mariadb
117-
architecture: standalone
118116
auth:
119-
# -- Database name
117+
# -- Database name to create
120118
database: domainmod
121-
# -- Database user
119+
# -- Database user to create
122120
username: domainmod
123-
# -- Database password
121+
# -- Database password to create
124122
password: domainmod
125-
# -- Database root password
123+
# -- Database root password to create
126124
rootPassword: domainmodadminpw
127-
primary:
128-
resources: {}
129-
persistence:
130-
enabled: false
131-
size: 1Gi
132-
# storageClass: ""
133-
134-
# -- Enable and configure external mariadb database
135-
externalMariadb:
136-
enabled: false
137-
# -- Name of the Kubernetes secret containing the database URI
138-
# fromSecret:
139-
# -- Name of the secret key containing the database URI
140-
# uriKey:
141-
auth:
142-
host: ""
143-
port: 3306
144-
username: ""
145-
password: ""
146-
database: domainmod
125+
# -- Resources for MariaDB instance
126+
resources: {}
127+
# -- Persistence settings for MariaDB instance
128+
persistence:
129+
# -- Size of volume to provision for MariaDB instance
130+
size: 1Gi
131+
# -- Storage class to use to provision volume for MariaDB instance
132+
storageClass: ""

0 commit comments

Comments
 (0)