diff --git a/charts/mariadb/Chart.yaml b/charts/mariadb/Chart.yaml index d3aa1ae870ab611384c5d3cb0ddb195c51c665cb..473f510b57eb281f47d5d977559b6f5449102043 100644 --- a/charts/mariadb/Chart.yaml +++ b/charts/mariadb/Chart.yaml @@ -7,8 +7,6 @@ type: application maintainers: - name: groundhog2k -# This is the chart version. -version: 0.2.0 +version: 0.2.1 -# This is the version number of the application being deployed. appVersion: "10.5.8" diff --git a/charts/mariadb/README.md b/charts/mariadb/README.md index 743755bf6f6d936d48687567175f8d3b78d0d9f7..65ec73bdd2a82b783e57d0c8c60dd1d2cb343439 100644 --- a/charts/mariadb/README.md +++ b/charts/mariadb/README.md @@ -1,6 +1,6 @@ # MariaDB -   +   A Helm chart for MariaDB on Kubernetes @@ -15,7 +15,7 @@ $ helm install my-release groundhog2k/mariadb This chart uses the original [MariaDB image from Docker Hub](https://hub.docker.com/_/mariadb) to deploy a stateful MariaDB instance in a Kubernetes cluster. -It fully supports deployment of arm64v8 and amd64 multi-architecture docker image. Just set the `nodeSelector` value to `kubernetes.io/arch: "arm64"` (default is `"amd64"`) +It fully supports deployment of the multi-architecture docker image. ## Prerequisites @@ -57,7 +57,7 @@ $ helm uninstall my-release | livenessProbe | object | `see values.yaml` | Liveness probe configuration | | readinessProbe | object | `see values.yaml` | Readiness probe configuration | | resources | object | `{}` | Resource limits and requests | -| nodeSelector."kubernetes.io/arch" | string | `"amd64"` | Deployment node selector | +| nodeSelector | object | `{}` | Deployment node selector | | podAnnotations | object | `{}` | Additional pod annotations | | podSecurityContext | object | `{}` | Pod security context | | securityContext | object | `see values.yaml` | Container security context | @@ -79,9 +79,9 @@ $ helm uninstall my-release | Key | Type | Default | Description | |-----|------|---------|-------------| | storage.accessModes[0] | string | `"ReadWriteOnce"` | Storage access mode | -| storage.persistentVolumeClaimName | string | `""` | PVC name when existing storage volume should be used | -| storage.requestedSize | string | `""` | Size for new PVC, when no existing PVC is used | -| storage.className | string | `""` | Storage class name | +| storage.persistentVolumeClaimName | string | `nil` | PVC name when existing storage volume should be used | +| storage.requestedSize | string | `nil` | Size for new PVC, when no existing PVC is used | +| storage.className | string | `nil` | Storage class name | ## MariaDB parameters @@ -92,5 +92,5 @@ $ helm uninstall my-release | userDatabase.user | string | `""` | User name with full access to user database| | userDatabase.password | string | `""` | Password of created user (Random value if not specified) | | settings.rootPassword | string | `nil` | MariaDB root password (Random value if not specified) | -| settings.arguments | string | `nil` | Additional arguments for mysqld (entrypoint process) | -| customConfig | string | `""` | Additional MariaDB custom configuration mounted as custom.cnf | +| settings.arguments | list | `[]` | Additional arguments for mysqld (entrypoint process) | +| customConfig | string | `nil` | Additional MariaDB custom configuration mounted as custom.cnf | diff --git a/charts/mariadb/templates/service.yaml b/charts/mariadb/templates/service.yaml index 351d853a3c2171c23dc424b83e88adcb11174a46..3e1e564f9a970498b09bf3a0a858ab94aee655f2 100644 --- a/charts/mariadb/templates/service.yaml +++ b/charts/mariadb/templates/service.yaml @@ -5,11 +5,17 @@ metadata: labels: {{- include "mariadb.labels" . | nindent 4 }} spec: - clusterIP: None + type: {{ .Values.service.type }} ports: - port: {{ .Values.service.port }} targetPort: sql protocol: TCP name: sql + {{- if and (eq .Values.service.type "NodePort") (.Values.service.nodePort) }} + nodePort: {{ .Values.service.nodePort }} + {{- end }} + {{- if and (eq .Values.service.type "LoadBalancer") (.Values.service.clusterIP) }} + clusterIP: {{ .Values.service.clusterIP }} + {{- end }} selector: {{- include "mariadb.selectorLabels" . | nindent 4 }} diff --git a/charts/mariadb/templates/statefulset.yaml b/charts/mariadb/templates/statefulset.yaml index f58c09efc3b133bab6ad603131f013fbb9ded639..fa9a70c2b1637adc98f2b6099e2121a67903da10 100644 --- a/charts/mariadb/templates/statefulset.yaml +++ b/charts/mariadb/templates/statefulset.yaml @@ -30,8 +30,10 @@ spec: {{- end }} containers: - name: {{ .Chart.Name }} + {{- with .Values.securityContext }} securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} + {{- toYaml . | nindent 12 }} + {{- end }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} ports: diff --git a/charts/mariadb/values.yaml b/charts/mariadb/values.yaml index e4a8f8e3f1e9f786c619b72cc5e4b1554746235c..6ebffc2ffccad95b1599b4c8ef505ae4d7b4f0b3 100644 --- a/charts/mariadb/values.yaml +++ b/charts/mariadb/values.yaml @@ -22,10 +22,8 @@ serviceAccount: # If not set and create is true, a name is generated using the fullname template name: "" -## Default node type for the image -## use arm64 for the arm64v8 image -nodeSelector: - kubernetes.io/arch: amd64 +## Additional node selector +nodeSelector: {} ## Additional pod annotations podAnnotations: {} @@ -44,9 +42,14 @@ securityContext: ## Default database service port (default MySQL/MariaDB port) service: + type: ClusterIP port: 3306 + ## The node port (only relevant for type NodePort) + nodePort: {} + ## The cluster ip address (only relevant for type LoadBalancer) + clusterIP: {} -## Resource limits and requests +# Resource limits and requests resources: {} # limits: # cpu: 100m @@ -83,7 +86,7 @@ env: [] ## Database configuration settings: ## Arguments for the container entrypoint process - arguments: + arguments: [] # - --character-set-server=utf8mb4 # - --collation-server=utf8mb4_unicode_ci @@ -107,13 +110,13 @@ customConfig: |- ## Storage parameters storage: ## Set persistentVolumenClaimName to reference an existing PVC - # persistentVolumeClaimName: <own-pvc-name> + persistentVolumeClaimName: {} ## Alternative set requestedSize to define a size for a dynmaically created PVC - # requestedSize: <volume-size> + requestedSize: {} ## the storage class name - # className: + className: {} ## Default access mode (ReadWriteOnce) accessModes: