{
  "$schema": "http://json-schema.org/schema#",
  "type": "object",
  "properties": {
    "galera": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "title": "Galera cluster name",
          "form": true
        },
        "mariabackup": {
          "type": "object",
          "properties": {
            "password": {
              "type": "string",
              "title": "Mariabackup password for SST",
              "form": true,
              "description": "Defaults to a random 10-character alphanumeric string if not set",
              "hidden": {
                "value": true,
                "path": "existingSecret"
              }
            }
          }
        }
      }
    },
    "rootUser": {
      "type": "object",
      "properties": {
        "password": {
          "type": "string",
          "title": "MariaDB admin password",
          "form": true,
          "description": "Defaults to a random 10-character alphanumeric string if not set",
          "hidden": {
            "value": true,
            "path": "existingSecret"
          }
        },
        "user": {
          "type": "string",
          "title": "MariaDB admin user",
          "description": "Name of the admin user to be created during the 1st initialization of MariaDB.",
          "form": true
        }
      }
    },
    "db": {
      "type": "object",
      "title": "Custom database & users",
      "properties": {
        "name": {
          "type": "string",
          "title": "MariaDB custom database",
          "description": "Name of the custom database to be created during the 1st initialization of MariaDB",
          "form": true
        },
        "user": {
          "type": "string",
          "title": "MariaDB custom user",
          "description": "Name of the custom user to be created during the 1st initialization of MariaDB. This user only has permissions on the MariaDB custom database",
          "form": true
        },
        "password": {
          "type": "string",
          "title": "Password for MariaDB custom user",
          "form": true,
          "description": "Defaults to a random 10-character alphanumeric string if not set",
          "hidden": {
            "value": true,
            "path": "existingSecret"
          }
        }
      }
    },
    "ldap": {
      "type": "object",
      "title": "LDAP configuration",
      "form": true,
      "properties": {
        "enabled": {
          "type": "boolean",
          "form": true,
          "title": "Enable LDAP support",
          "description": "Enable authentication using LDAP"
        },
        "uri": {
          "type": "string",
          "title": "LDAP URL",
          "form": true,
          "hidden": {
            "value": false,
            "path": "ldap/enabled"
          }
        },
        "base": {
          "type": "string",
          "title": "LDAP base DN",
          "form": true,
          "hidden": {
            "value": false,
            "path": "ldap/enabled"
          }
        },
        "binddn": {
          "type": "string",
          "title": "LDAP bind DN",
          "form": true,
          "hidden": {
            "value": false,
            "path": "ldap/enabled"
          }
        },
        "bindpw": {
          "type": "string",
          "title": "LDAP bind password",
          "form": true,
          "hidden": {
            "value": false,
            "path": "ldap/enabled"
          }
        }
      }
    },
    "replicaCount": {
      "type": "integer",
      "form": true,
      "title": "Desired number of cluster nodes"
    },
    "persistence": {
      "type": "object",
      "title": "Persistence",
      "form": true,
      "properties": {
        "enabled": {
          "type": "boolean",
          "form": true,
          "title": "Enable persistence",
          "description": "Enable persistence using Persistent Volume Claims"
        },
        "size": {
          "type": "string",
          "title": "Persistent Volume Size",
          "form": true,
          "render": "slider",
          "sliderMin": 1,
          "sliderMax": 100,
          "sliderUnit": "Gi",
          "hidden": {
            "value": false,
            "path": "persistence/enabled"
          }
        }
      }
    },
    "serviceAccount": {
      "type": "object",
      "title": "ServiceAccount configuration",
      "form": true,
      "properties": {
        "create": {
          "type": "boolean",
          "form": true,
          "title": "Create a ServiceAcccount",
          "description": "Specify whether a ServiceAcccount for MariaDB Galera pods should be created"
        },
        "name": {
          "type": "string",
          "form": true,
          "title": "ServiceAcccount name",
          "description": "ServiceAcccount name to use. Auto-generated if not specified",
          "hidden": {
            "value": false,
            "path": "serviceAccount/create"
          }
        }
      }
    },
    "rbac": {
      "type": "object",
      "title": "RBAC rules configuration",
      "form": true,
      "properties": {
        "create": {
          "type": "boolean",
          "form": true,
          "title": "Create RBAC rules",
          "description": "Specify whether RBAC resources should be created and used"
        }
      }
    },
    "metrics": {
      "type": "object",
      "form": true,
      "title": "Prometheus metrics details",
      "properties": {
        "enabled": {
          "type": "boolean",
          "title": "Create Prometheus metrics exporter",
          "description": "Create a side-car container to expose Prometheus metrics",
          "form": true
        },
        "serviceMonitor": {
          "type": "object",
          "properties": {
            "enabled": {
              "type": "boolean",
              "title": "Create Prometheus Operator ServiceMonitor",
              "description": "Create a ServiceMonitor to track metrics using Prometheus Operator",
              "form": true,
              "hidden": {
                "value": false,
                "path": "metrics/enabled"
              }
            }
          }
        }
      }
    }
  }
}
