{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/ksail/latest.json",
  "title": "KSail Cluster Configuration",
  "description": "JSON schema for KSail cluster configuration (ksail.yaml)",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/devantler-tech/ksail/refs/heads/main/schemas/ksail-config.schema.json",
    "sourceSha256": "dbc550c21f350361790a2b090e6a18af4f9d4ea79550b7bfd9eab25c6d168157",
    "fileMatch": [
      "ksail-*.yaml",
      "ksail-*.yml",
      "ksail_*.yaml",
      "ksail_*.yml",
      "ksail.*.yaml",
      "ksail.*.yml",
      "*-ksail.yaml",
      "*-ksail.yml",
      "*_ksail.yaml",
      "*_ksail.yml",
      "*.ksail.yaml",
      "*.ksail.yml",
      "ksail.yaml",
      "ksail.yml"
    ],
    "parsers": [
      "yaml"
    ]
  },
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "enum": [
        "Cluster"
      ]
    },
    "apiVersion": {
      "type": "string",
      "enum": [
        "ksail.io/v1alpha1"
      ]
    },
    "spec": {
      "properties": {
        "editor": {
          "type": "string",
          "description": "Editor command for interactive workflows (e.g. code --wait)"
        },
        "cluster": {
          "properties": {
            "distributionConfig": {
              "type": "string"
            },
            "connection": {
              "properties": {
                "kubeconfig": {
                  "type": "string"
                },
                "context": {
                  "type": "string"
                },
                "timeout": {
                  "type": "string",
                  "pattern": "^[0-9]+(ns|us|µs|ms|s|m|h)$"
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "distribution": {
              "type": "string",
              "enum": [
                "Vanilla",
                "K3s",
                "Talos",
                "VCluster"
              ]
            },
            "provider": {
              "type": "string",
              "enum": [
                "Docker",
                "Hetzner",
                "Omni"
              ]
            },
            "cni": {
              "type": "string",
              "enum": [
                "Default",
                "Cilium",
                "Calico"
              ]
            },
            "csi": {
              "type": "string",
              "enum": [
                "Default",
                "Enabled",
                "Disabled"
              ]
            },
            "metricsServer": {
              "type": "string",
              "enum": [
                "Default",
                "Enabled",
                "Disabled"
              ]
            },
            "loadBalancer": {
              "type": "string",
              "enum": [
                "Default",
                "Enabled",
                "Disabled"
              ]
            },
            "certManager": {
              "type": "string",
              "enum": [
                "Enabled",
                "Disabled"
              ]
            },
            "policyEngine": {
              "type": "string",
              "enum": [
                "None",
                "Kyverno",
                "Gatekeeper"
              ]
            },
            "localRegistry": {
              "properties": {
                "registry": {
                  "type": "string"
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "gitOpsEngine": {
              "type": "string",
              "enum": [
                "None",
                "Flux",
                "ArgoCD"
              ]
            },
            "sops": {
              "properties": {
                "ageKeyEnvVar": {
                  "type": "string"
                },
                "enabled": {
                  "type": "boolean"
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "importImages": {
              "type": "string",
              "description": "Path to tar archive with container images to import after cluster creation but before component installation"
            },
            "vanilla": {
              "properties": {
                "mirrorsDir": {
                  "type": "string"
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "talos": {
              "properties": {
                "controlPlanes": {
                  "type": "integer"
                },
                "workers": {
                  "type": "integer"
                },
                "config": {
                  "type": "string"
                },
                "iso": {
                  "type": "integer"
                },
                "extraPortMappings": {
                  "items": {
                    "properties": {
                      "containerPort": {
                        "type": "integer"
                      },
                      "hostPort": {
                        "type": "integer"
                      },
                      "protocol": {
                        "type": "string",
                        "enum": [
                          "TCP",
                          "UDP"
                        ],
                        "default": "TCP"
                      }
                    },
                    "type": "object",
                    "additionalProperties": false
                  },
                  "type": "array"
                },
                "imageVerification": {
                  "type": "string",
                  "enum": [
                    "Enabled",
                    "Disabled"
                  ]
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "hetzner": {
              "properties": {
                "controlPlaneServerType": {
                  "type": "string"
                },
                "workerServerType": {
                  "type": "string"
                },
                "location": {
                  "type": "string"
                },
                "networkName": {
                  "type": "string"
                },
                "networkCidr": {
                  "type": "string"
                },
                "sshKeyName": {
                  "type": "string"
                },
                "tokenEnvVar": {
                  "type": "string"
                },
                "placementGroupStrategy": {
                  "type": "string",
                  "enum": [
                    "None",
                    "Spread"
                  ]
                },
                "placementGroup": {
                  "type": "string"
                },
                "fallbackLocations": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "placementGroupFallbackToNone": {
                  "type": "boolean"
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "omni": {
              "properties": {
                "endpoint": {
                  "type": "string"
                },
                "endpointEnvVar": {
                  "type": "string"
                },
                "serviceAccountKeyEnvVar": {
                  "type": "string"
                },
                "talosVersion": {
                  "type": "string"
                },
                "kubernetesVersion": {
                  "type": "string"
                },
                "machineClass": {
                  "type": "string"
                },
                "machines": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                }
              },
              "type": "object",
              "additionalProperties": false
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "workload": {
          "properties": {
            "sourceDirectory": {
              "type": "string",
              "description": "Path to the directory containing Kubernetes manifests. Used as the default path by validate, watch, and push when no explicit path argument is given."
            },
            "validateOnPush": {
              "type": "boolean",
              "description": "Validate manifests against schemas before pushing (validation disabled by default)"
            },
            "tag": {
              "type": "string",
              "description": "OCI artifact tag for ksail workload push. Priority: CLI oci:// ref > this field > registry-embedded tag > dev"
            },
            "kustomizationFile": {
              "type": "string",
              "description": "Path to the kustomization directory relative to sourceDirectory. When set, Flux Sync.Path is configured to this path so Flux uses the specified kustomization as the entry point instead of requiring a root kustomization.yaml."
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "chat": {
          "properties": {
            "model": {
              "type": "string",
              "description": "Chat model (empty or 'auto' for API default)"
            },
            "reasoningEffort": {
              "type": "string",
              "enum": [
                "low",
                "medium",
                "high"
              ],
              "description": "Reasoning effort level for chat responses (low, medium, or high)"
            }
          },
          "type": "object",
          "additionalProperties": false
        }
      },
      "type": "object",
      "additionalProperties": false
    }
  },
  "required": [
    "spec"
  ],
  "additionalProperties": false
}
