From b1a277c8d592a7597479157a69c966f931558352 Mon Sep 17 00:00:00 2001 From: Stefan Reimer Date: Wed, 12 May 2021 18:11:40 +0200 Subject: [PATCH] feat: initial kuberzero-sql module incl. MariaDB-Galera --- charts/kubezero-sql/Chart.yaml | 22 +++++++ charts/kubezero-sql/README.md | 58 +++++++++++++++++++ charts/kubezero-sql/README.md.gotmpl | 20 +++++++ .../kubezero-sql/example-mariadb-galera.yaml | 27 +++++++++ charts/kubezero-sql/update.sh | 7 +++ charts/kubezero-sql/values.yaml | 20 +++++++ 6 files changed, 154 insertions(+) create mode 100644 charts/kubezero-sql/Chart.yaml create mode 100644 charts/kubezero-sql/README.md create mode 100644 charts/kubezero-sql/README.md.gotmpl create mode 100644 charts/kubezero-sql/example-mariadb-galera.yaml create mode 100755 charts/kubezero-sql/update.sh create mode 100644 charts/kubezero-sql/values.yaml diff --git a/charts/kubezero-sql/Chart.yaml b/charts/kubezero-sql/Chart.yaml new file mode 100644 index 00000000..dc734398 --- /dev/null +++ b/charts/kubezero-sql/Chart.yaml @@ -0,0 +1,22 @@ +apiVersion: v2 +name: kubezero-sql +description: KubeZero umbrella chart for SQL databases like MariaDB, PostgreSQL +type: application +version: 0.1.0 +home: https://kubezero.com +icon: https://cdn.zero-downtime.net/assets/kubezero/logo-small-64.png +keywords: + - kubezero + - mariadb + - postgresql +maintainers: + - name: Quarky9 +dependencies: + - name: kubezero-lib + version: ">= 0.1.3" + repository: https://zero-down-time.github.io/kubezero/ + - name: mariadb-galera + version: 5.8.0 + repository: https://charts.bitnami.com/bitnami + condition: mariadb.enabled +kubeVersion: ">= 1.18.0" diff --git a/charts/kubezero-sql/README.md b/charts/kubezero-sql/README.md new file mode 100644 index 00000000..a28e836f --- /dev/null +++ b/charts/kubezero-sql/README.md @@ -0,0 +1,58 @@ +# kubezero-mq + +![Version: 0.2.0](https://img.shields.io/badge/Version-0.2.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) + +KubeZero umbrella chart for MQ systems like NATS, RabbitMQ + +**Homepage:** + +## Maintainers + +| Name | Email | Url | +| ---- | ------ | --- | +| Quarky9 | | | + +## Requirements + +Kubernetes: `>= 1.18.0` + +| Repository | Name | Version | +|------------|------|---------| +| | nats | 0.8.3 | +| https://charts.bitnami.com/bitnami | rabbitmq | 8.13.1 | +| https://zero-down-time.github.io/kubezero/ | kubezero-lib | >= 0.1.3 | + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| nats.enabled | bool | `false` | | +| nats.exporter.serviceMonitor.enabled | bool | `false` | | +| nats.nats.advertise | bool | `false` | | +| nats.nats.image | string | `"nats:2.2.1-alpine3.13"` | | +| nats.nats.jetstream.enabled | bool | `true` | | +| nats.natsbox.enabled | bool | `false` | | +| rabbitmq.auth.erlangCookie | string | `"randomlongerlangcookie"` | | +| rabbitmq.auth.password | string | `"supersecret"` | | +| rabbitmq.auth.tls.enabled | bool | `false` | | +| rabbitmq.auth.tls.existingSecret | string | `"rabbitmq-server-certificate"` | | +| rabbitmq.auth.tls.existingSecretFullChain | bool | `true` | | +| rabbitmq.auth.tls.failIfNoPeerCert | bool | `false` | | +| rabbitmq.clustering.forceBoot | bool | `true` | | +| rabbitmq.enabled | bool | `false` | | +| rabbitmq.hosts | list | `[]` | hostnames of rabbitmq services, used for Istio and TLS | +| rabbitmq.istio.enabled | bool | `false` | | +| rabbitmq.istio.gateway | string | `"istio-ingress/private-ingressgateway"` | | +| rabbitmq.metrics.enabled | bool | `false` | | +| rabbitmq.metrics.serviceMonitor.enabled | bool | `false` | | +| rabbitmq.pdb.create | bool | `true` | | +| rabbitmq.podAntiAffinityPreset | string | `""` | | +| rabbitmq.replicaCount | int | `1` | | +| rabbitmq.resources.requests.cpu | string | `"100m"` | | +| rabbitmq.resources.requests.memory | string | `"256Mi"` | | +| rabbitmq.topologySpreadConstraints | string | `"- maxSkew: 1\n topologyKey: topology.kubernetes.io/zone\n whenUnsatisfiable: DoNotSchedule\n labelSelector:\n matchLabels: {{- include \"common.labels.matchLabels\" . | nindent 6 }}\n- maxSkew: 1\n topologyKey: kubernetes.io/hostname\n whenUnsatisfiable: DoNotSchedule\n labelSelector:\n matchLabels: {{- include \"common.labels.matchLabels\" . | nindent 6 }}"` | | + +## Resources + +### NATS +- https://grafana.com/grafana/dashboards/13707 diff --git a/charts/kubezero-sql/README.md.gotmpl b/charts/kubezero-sql/README.md.gotmpl new file mode 100644 index 00000000..07df9ab5 --- /dev/null +++ b/charts/kubezero-sql/README.md.gotmpl @@ -0,0 +1,20 @@ +{{ template "chart.header" . }} +{{ template "chart.deprecationWarning" . }} + +{{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}{{ template "chart.appVersionBadge" . }} + +{{ template "chart.description" . }} + +{{ template "chart.homepageLine" . }} + +{{ template "chart.maintainersSection" . }} + +{{ template "chart.sourcesSection" . }} + +{{ template "chart.requirementsSection" . }} + +{{ template "chart.valuesSection" . }} + +## Resources + +### MariaDB diff --git a/charts/kubezero-sql/example-mariadb-galera.yaml b/charts/kubezero-sql/example-mariadb-galera.yaml new file mode 100644 index 00000000..e6b9f05e --- /dev/null +++ b/charts/kubezero-sql/example-mariadb-galera.yaml @@ -0,0 +1,27 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: test-mariadb + namespace: argocd +spec: + project: default + source: + repoURL: 'https://github.com/zero-down-time/kubezero' + path: charts/kubezero-sql + targetRevision: master + helm: + values: | + mariadb-galera: + enabled: true + metrics: + serviceMonitor: + enabled: true + + destination: + server: 'https://kubernetes.default.svc' + namespace: db-sandbox + syncPolicy: + automated: + prune: true + syncOptions: + - CreateNamespace=true diff --git a/charts/kubezero-sql/update.sh b/charts/kubezero-sql/update.sh new file mode 100755 index 00000000..b0babf4b --- /dev/null +++ b/charts/kubezero-sql/update.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -ex + +### MariaDB + + +# Fetch dashboards diff --git a/charts/kubezero-sql/values.yaml b/charts/kubezero-sql/values.yaml new file mode 100644 index 00000000..c9ecfcec --- /dev/null +++ b/charts/kubezero-sql/values.yaml @@ -0,0 +1,20 @@ +mariadb-galera: + enabled: true + + replicaCount: 2 + + # Passwords should be fixed otherwise helm will create random new ones each time we template|apply + rootUser: + password: 12345qwert + db: + password: 12345qwert + galera: + mariabackup: + password: 12345qwert + + metrics: + serviceMonitor: + enabled: false + + prometheusRules: + enabled: false