agentleFS
Aidas-devAidas-dev/k8s-agent-skills/skills/mariadb-helm/SKILL.md

mariadb-helm

Skill4 starsChanged 5 months agoMITView on GitHub

Deploy MariaDB operator on Kubernetes via Helm — 3 charts, production HA values, Galera, MaxScale, backups, PITR configuration.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Check the GitHub releases for breaking changes.

    line 355
  2. Very specific:

    ⚠️ WARNING: If crds.enabled: true was set on mariadb-operator, uninstalling it deletes ALL CRDs, which cascades to delete ALL MariaDB …

    line 370

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

MariaDB Operator — Helm Charts

Repository: https://mariadb-operator.github.io/mariadb-operator
OCI: oci://ghcr.io/mariadb-operator/charts

Charts (3)

ChartLatestPurpose
mariadb-operator-crds26.6.0CRDs only (recommended: manage separately)
mariadb-operator26.6.0Controller + cert-controller + webhook + metrics
mariadb-cluster26.6.0MariaDB cluster + MaxScale + backups + users

App version: 26.6.0
Images: ghcr.io/mariadb-operator/mariadb-operator:26.6.0 (single image used for controller, webhook, cert-controller)

Quick Install

helm repo add mariadb-operator https://mariadb-operator.github.io/mariadb-operator
helm repo update

# 1. Install CRDs (separate chart to prevent accidental deletion)
helm install mariadb-operator-crds mariadb-operator/mariadb-operator-crds \
  --version 26.6.0

# 2. Install operator
helm install mariadb-operator mariadb-operator/mariadb-operator \
  --namespace mariadb-operator --create-namespace \
  --version 26.6.0

# 3. (Optional) Provision a MariaDB cluster
helm install mariadb-cluster mariadb-operator/mariadb-cluster \
  --namespace mariadb-operator \
  --version 26.6.0

Using OCI Registry

helm pull oci://ghcr.io/mariadb-operator/charts/mariadb-operator --version 26.6.0
helm pull oci://ghcr.io/mariadb-operator/charts/mariadb-operator-crds --version 26.6.0
helm pull oci://ghcr.io/mariadb-operator/charts/mariadb-cluster --version 26.6.0

mariadb-operator-crds

Manages CRDs independently. Safer than crds.enabled: true on the operator chart.

helm install mariadb-operator-crds mariadb-operator/mariadb-operator-crds \
  --version 26.6.0

This chart has no values — it only ships CRDs.

mariadb-operator

Deploys the controller, webhook, cert-controller, RBAC, service accounts, and ServiceMonitors.

Requirements

  • Kubernetes >= 1.26
  • Prometheus operator (optional, for ServiceMonitors)
  • cert-manager (optional, for webhook certs — otherwise cert-controller handles them)

Installation with HA

helm install mariadb-operator mariadb-operator/mariadb-operator \
  --namespace mariadb-operator \
  --set ha.enabled=true \
  --set 'metrics.enabled=true' \
  --set 'webhook.ha.enabled=true' \
  --set 'certController.ha.enabled=true'

Key Values

Controller

ParameterDefaultDescription
image.repositoryghcr.io/mariadb-operator/mariadb-operatorController image
image.tag"" (chart appVersion)Image tag
image.pullPolicyIfNotPresentPull policy
logLevelINFOLog level
clusterNamecluster.localCluster DNS name
currentNamespaceOnlyfalseWatch only operator namespace
ha.enabledfalseEnable controller HA
ha.replicas3HA replicas
crds.enabledfalseLet operator manage CRDs (⚠️ WARNING: uninstall deletes CRDs + all MariaDB instances)
resources{}Container resources
affinity{}Pod affinity
tolerations[]Node tolerations
topologySpreadConstraints[]Topology spread
nodeSelector{}Node selector
priorityClassName""Priority class
podAnnotations{}Pod annotations
podSecurityContext{}Pod security context
securityContext{}Container security context
extraArgs[]Extra controller args
extraEnv[]Extra env vars
extraEnvFrom[]Extra envFrom
extraVolumes[]Extra volumes
extraVolumeMounts[]Extra volume mounts
revisionHistoryLimit10Revision history limit
strategy{}Deployment strategy
serviceAccount.annotations{}SA annotations
serviceAccount.automounttrueAuto-mount token
serviceAccount.extraLabels{}SA extra labels
serviceAccount.name""SA name
rbac.enabledtrueCreate RBAC
rbac.aggregation.enabledtrueAggregate to view/edit roles
pdb.enabledfalsePDB for controller
pdb.maxUnavailable1PDB max unavailable

Metrics

ParameterDefaultDescription
metrics.enabledfalseEnable internal metrics
metrics.serviceMonitor.enabledtrueCreate ServiceMonitor
metrics.serviceMonitor.interval30sScrape interval
metrics.serviceMonitor.scrapeTimeout25sScrape timeout
metrics.serviceMonitor.additionalLabels{}Extra labels

Webhook

ParameterDefaultDescription
webhook.enabledtrueEnable webhook
webhook.port9443Webhook port
webhook.hostNetworkfalseHost network
webhook.ha.enabledfalseWebhook HA
webhook.ha.replicas3Webhook replicas
webhook.resources{}Webhook resources
webhook.cert.certManager.enabledfalseUse cert-manager instead of cert-controller
webhook.cert.certManager.issuerRef{}Issuer reference
webhook.cert.certManager.duration""Cert duration
webhook.cert.path/tmp/k8s-webhook-server/serving-certsCert mount path
webhook.cert.secretAnnotations{}TLS secret annotations
webhook.cert.secretLabels{}TLS secret labels
webhook.serviceMonitor.enabledtrueWebhook ServiceMonitor
webhook.annotations{}Webhook config annotations
webhook.extraArgs[]Extra webhook args
webhook.pdb.enabledfalseWebhook PDB

Cert-Controller

ParameterDefaultDescription
certController.enabledtrueEnable cert-controller
certController.caLifetime26280h (3 years)CA cert lifetime
certController.certLifetime2160h (90 days)Cert lifetime
certController.renewBeforePercentage33Renew at 33% remaining
certController.requeueDuration5mCert renewal check interval
certController.ha.enabledfalseCert-controller HA
certController.ha.replicas3Cert-controller replicas
certController.resources{}Cert-controller resources
certController.pdb.enabledfalseCert-controller PDB

Config (operator defaults)

ParameterDefaultDescription
config.galeraLibPath/usr/lib/galera/libgalera_smm.soGalera library path
config.mariadbDefaultVersion11.8Default MariaDB version
config.mariadbImage.repositorymariadbDefault image repo
config.mariadbImage.tag11.8.8Default image tag
config.mariadbImageNamemariadbDefault image name
config.maxscaleImage.repositorymariadb/maxscaleDefault MaxScale repo
config.maxscaleImage.tag23.08.5Default MaxScale tag
config.exporterImage.repositoryprom/mysqld-exporterExporter repo
config.exporterImage.tagv0.15.1Exporter tag
config.exporterMaxscaleImage.repositorymariadb/maxscale-prometheus-exporter-ubiMaxScale exporter
config.exporterMaxscaleImage.tagv0.0.1MaxScale exporter tag

HA Production Example

ha:
  enabled: true
  replicas: 3
metrics:
  enabled: true
  serviceMonitor:
    enabled: true
webhook:
  enabled: true
  ha:
    enabled: true
    replicas: 3
  cert:
    certManager:
      enabled: true
      issuerRef:
        name: letsencrypt-prod
        kind: ClusterIssuer
certController:
  enabled: true
  ha:
    enabled: true
    replicas: 3
affinity:
  podAntiAffinity:
    requiredDuringSchedulingIgnoredDuringExecution:
      - labelSelector:
          matchExpressions:
            - key: app.kubernetes.io/name
              operator: In
              values:
                - mariadb-operator
        topologyKey: kubernetes.io/hostname
resources:
  requests:
    cpu: 100m
    memory: 64Mi
  limits:
    cpu: 500m
    memory: 256Mi
pdb:
  enabled: true
  maxUnavailable: 1

mariadb-cluster

Provisions a MariaDB cluster (CRD resources). Generates MariaDB, Database, User, Grant, Backup, etc. CRs.

Requirements

  • mariadb-operator-crds installed
  • mariadb-operator deployed and running

Installation

helm install mariadb-cluster mariadb-operator/mariadb-cluster \
  --namespace mariadb-operator \
  --version 26.6.0 \
  --set mariadb.replicas=3 \
  --set mariadb.galera.enabled=true \
  --set mariadb.storage.size=10Gi

Key Values

MariaDB CR

ParameterDefaultDescription
mariadb.replicas3Replica count
mariadb.galera.enabledtrueEnable Galera
mariadb.storage.size1GiPVC size
mariadb.rootPasswordSecretKeyRef.name"" (auto-generated)Root password secret name
mariadb.rootPasswordSecretKeyRef.keyrootSecret key
mariadb.rootPasswordSecretKeyRef.generatetrueAuto-generate password

Databases, Users, Grants

ParameterTypeDescription
databases[]objectList of Database CRs (see operator skill for fields)
users[]objectList of User CRs
grants[]objectList of Grant CRs

Backups

ParameterTypeDescription
backups[]objectList of Backup CRs
physicalBackups[]objectList of PhysicalBackup CRs

Cluster with Apps Example

mariadb:
  replicas: 3
  galera:
    enabled: true
  storage:
    size: 50Gi
  rootPasswordSecretKeyRef:
    generate: true

databases:
  - name: myapp
    characterSet: utf8mb4
    collate: utf8mb4_unicode_ci

users:
  - name: myapp
    passwordSecretKeyRef:
      name: myapp-password
      key: password
      generate: true
    maxUserConnections: 50

grants:
  - name: myapp-rw
    privileges:
      - "ALL PRIVILEGES"
    database: "myapp"
    table: "*"
    username: myapp
    grantOption: true

backups:
  - name: nightly-s3
    schedule:
      cron: "0 0 * * *"
    compression: gzip
    maxRetention: 720h
    storage:
      s3:
        bucket: mariadb-backups
        prefix: cluster
        endpoint: s3.amazonaws.com
        region: us-east-1
        accessKeyIdSecretKeyRef:
          name: s3-creds
          key: access-key-id
        secretAccessKeySecretKeyRef:
          name: s3-creds
          key: secret-access-key

Upgrading

helm repo update

# Upgrade CRDs first
helm upgrade mariadb-operator-crds mariadb-operator/mariadb-operator-crds \
  --version 26.6.0

# Then upgrade operator
helm upgrade mariadb-operator mariadb-operator/mariadb-operator \
  --namespace mariadb-operator \
  --version 26.6.0 \
  --values values.yaml

Upgrade Notes

  • Upgrade CRDs before the operator to ensure schema compatibility.
  • Controller restarts are expected during upgrade (webhook certs may need re-issuance).
  • MariaDB clusters managed by the operator are not affected by operator upgrades.
  • Check the GitHub releases for breaking changes.

Uninstalling

# Uninstall cluster first (this deletes MariaDB CRs = data loss)
helm uninstall mariadb-cluster --namespace mariadb-operator

# Uninstall operator
helm uninstall mariadb-operator --namespace mariadb-operator

# Uninstall CRDs (⚠️ DELETES ALL MariaDB CRs in the cluster)
helm uninstall mariadb-operator-crds

⚠️ WARNING: If crds.enabled: true was set on mariadb-operator, uninstalling it deletes ALL CRDs, which cascades to delete ALL MariaDB instances across ALL namespaces.

Common Mistakes

  • CRDs not installed first — Without mariadb-operator-crds, the operator and cluster chart fail with "no matching CRD found".
  • crds.enabled: true risk — Only set during initial deploy. If you uninstall the operator chart with this enabled, all MariaDB instances are deleted.
  • mariadb-cluster without operator — The cluster chart CRs require the operator running to reconcile.
  • Metrics ServiceMonitor needs prometheus-operator — ServiceMonitors require the prometheus-operator CRDs installed.
  • cert-manager vs cert-controller — Default is cert-controller (built-in). Set webhook.cert.certManager.enabled: true to use cert-manager instead.
  • HA without anti-affinity — Controller replicas may schedule on the same node. Set affinity.podAntiAffinity for true HA.
  • Default image tags — Operator defaults to mariadb 11.8.8 and maxscale 23.08.5. Override config.* to change defaults.
  • logLevel — Valid values: DEBUG, INFO, WARN, ERROR. Default is INFO.
  • currentNamespaceOnly — When true, operator only watches CRs in its own namespace. Doesn't affect cluster-scoped CRDs.
  • Root password auto-generation — generate: true on rootPasswordSecretKeyRef creates the Secret automatically. Don't create a Secret with the same name.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.