WIP
This commit is contained in:
354
schemas/cluster.json
Normal file
354
schemas/cluster.json
Normal file
@@ -0,0 +1,354 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "Cluster",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"base": {
|
||||
"$ref": "#/$defs/Base",
|
||||
"writeOnly": true
|
||||
},
|
||||
"clusterEnv": {
|
||||
"$ref": "#/$defs/ClusterEnv"
|
||||
},
|
||||
"controlPlaneIp": {
|
||||
"type": "string",
|
||||
"format": "ipv4"
|
||||
},
|
||||
"default": {
|
||||
"$ref": "#/$defs/OptionalNode",
|
||||
"writeOnly": true
|
||||
},
|
||||
"nodes": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"version": {
|
||||
"$ref": "#/$defs/Version"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"version",
|
||||
"nodes",
|
||||
"clusterEnv",
|
||||
"controlPlaneIp",
|
||||
"base"
|
||||
],
|
||||
"$defs": {
|
||||
"Base": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"kernelArgs": {
|
||||
"type": "array",
|
||||
"default": [],
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"patches": {
|
||||
"$ref": "#/$defs/Patches",
|
||||
"default": {
|
||||
"all": [],
|
||||
"controlPlane": []
|
||||
}
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"ClusterEnv": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"production",
|
||||
"staging"
|
||||
]
|
||||
},
|
||||
"FileSecret": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"file": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
]
|
||||
},
|
||||
"NodeArch": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"amd64"
|
||||
]
|
||||
},
|
||||
"NodeType": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"worker",
|
||||
"controlPlane"
|
||||
]
|
||||
},
|
||||
"OptionalInstall": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"auto": {
|
||||
"type": [
|
||||
"boolean",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"disk": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"serial": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"OptionalNetwork": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"dns": {
|
||||
"type": [
|
||||
"array",
|
||||
"null"
|
||||
],
|
||||
"items": {
|
||||
"type": "string",
|
||||
"format": "ipv4"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"gateway": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"format": "ipv4"
|
||||
},
|
||||
"interface": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"ip": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"format": "ipv4"
|
||||
},
|
||||
"netmask": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"format": "ipv4"
|
||||
},
|
||||
"tailscale": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/$defs/OptionalTailscale"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"OptionalNode": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"arch": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/$defs/NodeArch"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
},
|
||||
"install": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/$defs/OptionalInstall"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
},
|
||||
"kernelArgs": {
|
||||
"type": [
|
||||
"array",
|
||||
"null"
|
||||
],
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"network": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/$defs/OptionalNetwork"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
},
|
||||
"ntp": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"patches": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/$defs/OptionalPatches"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
},
|
||||
"type": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/$defs/NodeType"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"OptionalPatches": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"all": {
|
||||
"type": [
|
||||
"array",
|
||||
"null"
|
||||
],
|
||||
"items": {
|
||||
"$ref": "#/$defs/Patch"
|
||||
}
|
||||
},
|
||||
"controlPlane": {
|
||||
"type": [
|
||||
"array",
|
||||
"null"
|
||||
],
|
||||
"items": {
|
||||
"$ref": "#/$defs/Patch"
|
||||
}
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"OptionalTailscale": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"advertiseRoutes": {
|
||||
"type": [
|
||||
"boolean",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"authKey": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/$defs/Secret"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
},
|
||||
"server": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"default": null
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"Patch": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Patches": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"all": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/$defs/Patch"
|
||||
}
|
||||
},
|
||||
"controlPlane": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/$defs/Patch"
|
||||
}
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"all",
|
||||
"controlPlane"
|
||||
]
|
||||
},
|
||||
"Secret": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"$ref": "#/$defs/FileSecret"
|
||||
}
|
||||
]
|
||||
},
|
||||
"SemVer": {
|
||||
"type": "string",
|
||||
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$"
|
||||
},
|
||||
"Version": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"kubernetes": {
|
||||
"$ref": "#/$defs/SemVer"
|
||||
},
|
||||
"talos": {
|
||||
"$ref": "#/$defs/SemVer"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"kubernetes",
|
||||
"talos"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
248
schemas/node.json
Normal file
248
schemas/node.json
Normal file
@@ -0,0 +1,248 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"title": "OptionalNode",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"arch": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/$defs/NodeArch"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
},
|
||||
"install": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/$defs/OptionalInstall"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
},
|
||||
"kernelArgs": {
|
||||
"type": [
|
||||
"array",
|
||||
"null"
|
||||
],
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"network": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/$defs/OptionalNetwork"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
},
|
||||
"ntp": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"patches": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/$defs/OptionalPatches"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
},
|
||||
"type": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/$defs/NodeType"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"$defs": {
|
||||
"FileSecret": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"file": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
]
|
||||
},
|
||||
"NodeArch": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"amd64"
|
||||
]
|
||||
},
|
||||
"NodeType": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"worker",
|
||||
"controlPlane"
|
||||
]
|
||||
},
|
||||
"OptionalInstall": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"auto": {
|
||||
"type": [
|
||||
"boolean",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"disk": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"serial": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"OptionalNetwork": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"dns": {
|
||||
"type": [
|
||||
"array",
|
||||
"null"
|
||||
],
|
||||
"items": {
|
||||
"type": "string",
|
||||
"format": "ipv4"
|
||||
},
|
||||
"maxItems": 2,
|
||||
"minItems": 2
|
||||
},
|
||||
"gateway": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"format": "ipv4"
|
||||
},
|
||||
"interface": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"ip": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"format": "ipv4"
|
||||
},
|
||||
"netmask": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"format": "ipv4"
|
||||
},
|
||||
"tailscale": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/$defs/OptionalTailscale"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"OptionalPatches": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"all": {
|
||||
"type": [
|
||||
"array",
|
||||
"null"
|
||||
],
|
||||
"items": {
|
||||
"$ref": "#/$defs/Patch"
|
||||
}
|
||||
},
|
||||
"controlPlane": {
|
||||
"type": [
|
||||
"array",
|
||||
"null"
|
||||
],
|
||||
"items": {
|
||||
"$ref": "#/$defs/Patch"
|
||||
}
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"OptionalTailscale": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"advertiseRoutes": {
|
||||
"type": [
|
||||
"boolean",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"authKey": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/$defs/Secret"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
},
|
||||
"server": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"default": null
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"Patch": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Secret": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"$ref": "#/$defs/FileSecret"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user