{
  "$schema": "https://json-schema.org/draft-07/schema#",
  "type": "object",
  "properties": {
    "nameOverride": {
      "type": "string"
    },
    "fullnameOverride": {
      "type": "string"
    },
    "replicaCount": {
      "type": "integer",
      "minimum": 1
    },
    "image": {
      "type": "object",
      "properties": {
        "repository": {
          "type": "string",
          "minLength": 1
        },
        "tag": {
          "type": "string"
        },
        "pullPolicy": {
          "type": "string",
          "enum": ["Always", "IfNotPresent", "Never"]
        }
      },
      "required": ["repository", "pullPolicy"]
    },
    "imagePullSecrets": {
      "type": "array"
    },
    "planner": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "dbPath": {
          "type": "string",
          "minLength": 1
        },
        "seedStateFile": {
          "type": "string"
        },
        "persistence": {
          "type": "object",
          "properties": {
            "enabled": {
              "type": "boolean"
            },
            "type": {
              "type": "string",
              "enum": ["ephemeral", "pvc"]
            },
            "mountPath": {
              "type": "string",
              "minLength": 1
            },
            "size": {
              "type": "string",
              "minLength": 1
            },
            "storageClassName": {
              "type": "string"
            },
            "accessModes": {
              "type": "array",
              "minItems": 1
            }
          },
          "required": [
            "enabled",
            "type",
            "mountPath",
            "size",
            "storageClassName",
            "accessModes"
          ]
        }
      },
      "required": ["name", "dbPath", "seedStateFile", "persistence"]
    },
    "auth": {
      "type": "object",
      "properties": {
        "existingSecret": {
          "type": "string"
        },
        "existingSecretKey": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": ["existingSecret", "existingSecretKey"]
    },
    "ha": {
      "type": "object",
      "properties": {
        "enabled": {
          "type": "boolean"
        },
        "leaseName": {
          "type": "string",
          "minLength": 1
        },
        "namespace": {
          "type": "string"
        },
        "serviceAccount": {
          "type": "object",
          "properties": {
            "create": {
              "type": "boolean"
            },
            "name": {
              "type": "string"
            }
          },
          "required": ["create", "name"]
        }
      },
      "required": ["enabled", "leaseName", "namespace", "serviceAccount"]
    },
    "logLevel": {
      "type": "string",
      "minLength": 1
    },
    "service": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": ["ClusterIP", "NodePort", "LoadBalancer"]
        },
        "port": {
          "type": "integer",
          "minimum": 1,
          "maximum": 65535
        },
        "annotations": {
          "type": "object"
        }
      },
      "required": ["type", "port", "annotations"]
    },
    "podAnnotations": {
      "type": "object"
    },
    "podLabels": {
      "type": "object"
    },
    "podSecurityContext": {
      "type": "object"
    },
    "containerSecurityContext": {
      "type": "object"
    },
    "resources": {
      "type": "object"
    },
    "extraEnv": {
      "type": "array"
    },
    "nodeSelector": {
      "type": "object"
    },
    "tolerations": {
      "type": "array"
    },
    "affinity": {
      "type": "object"
    }
  },
  "required": [
    "replicaCount",
    "image",
    "imagePullSecrets",
    "planner",
    "auth",
    "ha",
    "logLevel",
    "service",
    "podAnnotations",
    "podLabels",
    "podSecurityContext",
    "containerSecurityContext",
    "resources",
    "extraEnv",
    "nodeSelector",
    "tolerations",
    "affinity"
  ]
}
