diff --git a/base-kustomize/mariadb-cluster/base/mariadb-backup.yaml b/base-kustomize/mariadb-cluster/base/mariadb-backup.yaml index c785340e..73ce1139 100644 --- a/base-kustomize/mariadb-cluster/base/mariadb-backup.yaml +++ b/base-kustomize/mariadb-cluster/base/mariadb-backup.yaml @@ -9,6 +9,8 @@ spec: namespace: openstack schedule: cron: "0 0 * * *" + serviceAccountName: backup + compression: gzip storage: persistentVolumeClaim: resources: @@ -16,5 +18,16 @@ spec: storage: 1Gi accessModes: - ReadWriteOnce - securityContext: - runAsUser: 0 + args: + - --single-transaction + - --all-databases + - --verbose + resources: + requests: + cpu: 100m + memory: 128Mi + limits: + cpu: 300m + memory: 512Mi + affinity: + antiAffinityEnabled: true diff --git a/base-kustomize/mariadb-cluster/base/mariadb-replication.yaml b/base-kustomize/mariadb-cluster/base/mariadb-replication.yaml index 875e1b54..1aa85d23 100644 --- a/base-kustomize/mariadb-cluster/base/mariadb-replication.yaml +++ b/base-kustomize/mariadb-cluster/base/mariadb-replication.yaml @@ -10,7 +10,8 @@ spec: generate: false username: mariadb database: mariadb - image: mariadb:10.11.7 + image: docker-registry1.mariadb.com/library/mariadb:11.4.3 + affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: diff --git a/bin/install-mariadb-operator.sh b/bin/install-mariadb-operator.sh index 144500b5..f3354355 100755 --- a/bin/install-mariadb-operator.sh +++ b/bin/install-mariadb-operator.sh @@ -1,8 +1,10 @@ #!/bin/bash # shellcheck disable=SC2124,SC2145,SC2294 +export VERSION="${VERSION:-0.36.0}" + # Default parameter value -CLUSTER_NAME=${1:-cluster.local} +export CLUSTER_NAME=${CLUSTER_NAME:-cluster.local} # Directory to check for YAML files CONFIG_DIR="/etc/genestack/helm-configs/mariadb-operator" @@ -27,12 +29,19 @@ if [ "${CLUSTER_NAME}" != "cluster.local" ]; then fi fi +# Add the mariadb-operator helm repository +helm repo add mariadb-operator https://helm.mariadb.com/mariadb-operator +helm repo update + +# Install the CRDs that match the version defined +helm upgrade --install mariadb-operator-crds mariadb-operator/mariadb-operator-crds --version "${VERSION}" + # Helm command setup -HELM_CMD="helm upgrade --install mariadb-operator mariadb-operator --repo https://mariadb-operator.github.io/mariadb-operator \ +HELM_CMD="helm upgrade --install mariadb-operator mariadb-operator \ --namespace=mariadb-system \ --create-namespace \ --timeout 120m \ - --version 0.28.1 \ + --version ${VERSION} \ --post-renderer /etc/genestack/kustomize/kustomize.sh \ --post-renderer-args mariadb-operator/overlay \ -f /opt/genestack/base-helm-configs/mariadb-operator/mariadb-operator-helm-overrides.yaml"