diff --git a/.vscode/settings.json b/.vscode/settings.json index 07efc12928..81a9724742 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -21,6 +21,7 @@ "files.trimTrailingWhitespace": true, "cSpell.enabled": false, "yaml.schemas": { + "Kubernetes": "cluster/*.yaml", "https://raw.githubusercontent.com/recyclarr/recyclarr/master/schemas/config-schema.json": "recyclarr.yaml", "https://raw.githubusercontent.com/recyclarr/recyclarr/master/schemas/settings-schema.json": "settings.yaml", "https://raw.githubusercontent.com/louygan/kubernetes-json-schema_yannh/master/v1.26.0/all.json": "k8s/**/*.yaml", @@ -28,7 +29,8 @@ "https://taskfile.dev/schema.json": [ "**/Taskfile.yaml", ".taskfiles/*.yml" - ] + ], + "https://raw.githubusercontent.com/budimanjojo/talhelper/master/pkg/config/schemas/talconfig.json": "file:///home/stephen/Documents/Development/home_cluster/infrastructure/talos/betty/talconfig.yaml" }, "material-icon-theme.folders.associations": { ".taskfiles": "utils", diff --git a/infrastructure/talos/betty/talconfig.json b/infrastructure/talos/betty/talconfig.json new file mode 100644 index 0000000000..c3a11c9584 --- /dev/null +++ b/infrastructure/talos/betty/talconfig.json @@ -0,0 +1,909 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://github.com/budimanjojo/talhelper/pkg/config/talhelper-config", + "$ref": "#/$defs/TalhelperConfig", + "$defs": { + "Bond": { + "properties": { + "interfaces": { + "items": { + "type": "string" + }, + "type": "array" + }, + "deviceSelectors": { + "items": { + "$ref": "#/$defs/NetworkDeviceSelector" + }, + "type": "array" + }, + "arpIPTarget": { + "items": { + "type": "string" + }, + "type": "array" + }, + "mode": { + "type": "string" + }, + "xmitHashPolicy": { + "type": "string" + }, + "lacpRate": { + "type": "string" + }, + "adActorSystem": { + "type": "string" + }, + "arpValidate": { + "type": "string" + }, + "arpAllTargets": { + "type": "string" + }, + "primary": { + "type": "string" + }, + "primaryReselect": { + "type": "string" + }, + "failOverMac": { + "type": "string" + }, + "adSelect": { + "type": "string" + }, + "miimon": { + "type": "integer" + }, + "updelay": { + "type": "integer" + }, + "downdelay": { + "type": "integer" + }, + "arpInterval": { + "type": "integer" + }, + "resendIgmp": { + "type": "integer" + }, + "minLinks": { + "type": "integer" + }, + "lpInterval": { + "type": "integer" + }, + "packetsPerSlave": { + "type": "integer" + }, + "numPeerNotif": { + "type": "integer" + }, + "tlbDynamicLb": { + "type": "integer" + }, + "allSlavesActive": { + "type": "integer" + }, + "useCarrier": { + "type": "boolean" + }, + "adActorSysPrio": { + "type": "integer" + }, + "adUserPortKey": { + "type": "integer" + }, + "peerNotifyDelay": { + "type": "integer" + } + }, + "additionalProperties": false, + "type": "object" + }, + "Bridge": { + "properties": { + "interfaces": { + "items": { + "type": "string" + }, + "type": "array" + }, + "stp": { + "$ref": "#/$defs/STP" + } + }, + "additionalProperties": false, + "type": "object" + }, + "CNIConfig": { + "properties": { + "name": { + "type": "string" + }, + "urls": { + "items": { + "type": "string" + }, + "type": "array" + }, + "flannel": { + "$ref": "#/$defs/FlannelCNIConfig" + } + }, + "additionalProperties": false, + "type": "object" + }, + "Customization": { + "properties": { + "extraKernelArgs": { + "items": { + "type": "string" + }, + "type": "array" + }, + "meta": { + "items": { + "$ref": "#/$defs/MetaValue" + }, + "type": "array" + }, + "systemExtensions": { + "$ref": "#/$defs/SystemExtensions" + } + }, + "additionalProperties": false, + "type": "object" + }, + "DHCPOptions": { + "properties": { + "routeMetric": { + "type": "integer" + }, + "ipv4": { + "type": "boolean" + }, + "ipv6": { + "type": "boolean" + }, + "duidv6": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "Device": { + "properties": { + "interface": { + "type": "string" + }, + "deviceSelector": { + "$ref": "#/$defs/NetworkDeviceSelector" + }, + "addresses": { + "items": { + "type": "string" + }, + "type": "array" + }, + "cidr": { + "type": "string" + }, + "routes": { + "items": { + "$ref": "#/$defs/Route" + }, + "type": "array" + }, + "bond": { + "$ref": "#/$defs/Bond" + }, + "bridge": { + "$ref": "#/$defs/Bridge" + }, + "vlans": { + "$ref": "#/$defs/VlanList" + }, + "mtu": { + "type": "integer" + }, + "dhcp": { + "type": "boolean" + }, + "ignore": { + "type": "boolean" + }, + "dummy": { + "type": "boolean" + }, + "dhcpOptions": { + "$ref": "#/$defs/DHCPOptions" + }, + "wireguard": { + "$ref": "#/$defs/DeviceWireguardConfig" + }, + "vip": { + "$ref": "#/$defs/DeviceVIPConfig" + } + }, + "additionalProperties": false, + "type": "object" + }, + "DeviceVIPConfig": { + "properties": { + "ip": { + "type": "string" + }, + "equinixMetal": { + "$ref": "#/$defs/VIPEquinixMetalConfig" + }, + "hcloud": { + "$ref": "#/$defs/VIPHCloudConfig" + } + }, + "additionalProperties": false, + "type": "object" + }, + "DeviceWireguardConfig": { + "properties": { + "privateKey": { + "type": "string" + }, + "listenPort": { + "type": "integer" + }, + "firewallMark": { + "type": "integer" + }, + "peers": { + "items": { + "$ref": "#/$defs/DeviceWireguardPeer" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "DeviceWireguardPeer": { + "properties": { + "publicKey": { + "type": "string" + }, + "endpoint": { + "type": "string" + }, + "persistentKeepaliveInterval": { + "type": "integer" + }, + "allowedIPs": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "DiskPartition": { + "properties": { + "size": { + "type": "integer" + }, + "mountpoint": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "FlannelCNIConfig": { + "properties": { + "extraArgs": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "ImageFactory": { + "properties": { + "registryURL": { + "type": "string", + "description": "Registry url or the image", + "default": "factory.talos.dev" + }, + "schematicEndpoint": { + "type": "string", + "default": "/schematics" + }, + "protocol": { + "type": "string", + "description": "Protocol of the registry(https or http)", + "default": "https" + }, + "installerURLTmpl": { + "type": "string", + "description": "Template for installer image URL", + "default": "{{.RegistryURL}}/installer/{{.ID}}:{{.Version}}" + }, + "ISOURLTmpl": { + "type": "string", + "description": "Template for ISO image URL", + "default": "{{.Protocol}}://{{.RegistryURL}}/image/{{.ID}}/{{.Version}}/{{.Mode}}-{{.Arch}}.iso" + } + }, + "additionalProperties": false, + "type": "object" + }, + "InstallDiskSelectorWrapper": { + "properties": { + "size": { + "type": "string", + "description": "Disk size", + "examples": [ + "4GB" + ] + }, + "name": { + "type": "string" + }, + "model": { + "type": "string" + }, + "serial": { + "type": "string" + }, + "modalias": { + "type": "string" + }, + "uuid": { + "type": "string" + }, + "wwid": { + "type": "string" + }, + "type": { + "type": "string", + "examples": [ + "ssd" + ] + }, + "busPath": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "InstallExtensionConfig": { + "properties": { + "image": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "KernelModuleConfig": { + "properties": { + "name": { + "type": "string" + }, + "parameters": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "MachineDisk": { + "properties": { + "device": { + "type": "string" + }, + "partitions": { + "items": { + "$ref": "#/$defs/DiskPartition" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "MachineFile": { + "properties": { + "content": { + "type": "string" + }, + "permissions": { + "type": "integer" + }, + "path": { + "type": "string" + }, + "op": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "MachineSpec": { + "properties": { + "mode": { + "type": "string", + "description": "Machine mode (e.g: metal)", + "default": "metal" + }, + "arch": { + "type": "string", + "description": "Machine architecture (e.g: amd64", + "default": "amd64" + } + }, + "additionalProperties": false, + "type": "object" + }, + "MetaValue": { + "properties": { + "key": { + "type": "integer" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "NetworkDeviceSelector": { + "properties": { + "busPath": { + "type": "string" + }, + "hardwareAddr": { + "type": "string" + }, + "pciID": { + "type": "string" + }, + "driver": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "Node": { + "oneOf": [ + { + "required": [ + "installDisk" + ], + "title": "installDiskSelector" + }, + { + "required": [ + "installDiskSelector" + ], + "title": "installDisk" + } + ], + "properties": { + "hostname": { + "type": "string", + "description": "Hostname of the node" + }, + "ipAddress": { + "type": "string", + "description": "IP address where the node can be reached", + "examples": [ + "192.168.200.11" + ] + }, + "controlPlane": { + "type": "boolean", + "description": "Whether the node is a controlplane" + }, + "nodeLabels": { + "additionalProperties": { + "type": "string" + }, + "type": "object", + "description": "Labels to be added to the node" + }, + "nodeTaints": { + "additionalProperties": { + "type": "string" + }, + "type": "object", + "description": "Node taints for the node. Effect is optional" + }, + "installDisk": { + "type": "string", + "description": "The disk used for installation" + }, + "installDiskSelector": { + "$ref": "#/$defs/InstallDiskSelectorWrapper", + "description": "Look up disk used for installation" + }, + "machineDisks": { + "items": { + "$ref": "#/$defs/MachineDisk" + }, + "type": "array", + "description": "List of additional disks to partition" + }, + "machineFiles": { + "items": { + "$ref": "#/$defs/MachineFile" + }, + "type": "array", + "description": "List of files to create inside the node" + }, + "extensions": { + "items": { + "$ref": "#/$defs/InstallExtensionConfig" + }, + "type": "array", + "description": "DEPRECATED: use \"schematic\" instead" + }, + "disableSearchDomain": { + "type": "boolean", + "description": "Whether to disable generating default search domain" + }, + "kernelModules": { + "items": { + "$ref": "#/$defs/KernelModuleConfig" + }, + "type": "array", + "description": "List of additional kernel modules to load inside the node" + }, + "nameservers": { + "items": { + "type": "string" + }, + "type": "array", + "description": "List of nameservers for the node" + }, + "networkInterfaces": { + "items": { + "$ref": "#/$defs/Device" + }, + "type": "array", + "description": "List of network interface configuration for the node" + }, + "configPatches": { + "items": { + "type": "object" + }, + "type": "array", + "description": "DEPRECATED: use \"patches\" instead" + }, + "inlinePatch": { + "type": "object", + "description": "DEPRECATED: use \"patches\" instead" + }, + "patches": { + "items": { + "type": "string" + }, + "type": "array", + "description": "Patches to be applied to the node" + }, + "talosImageURL": { + "type": "string", + "description": "Talos installer image url for the node", + "examples": [ + "factory.talos.dev/installer/e9c7ef96884d4fbc8c0a1304ccca4bb0287d766a8b4125997cb9dbe84262144e" + ] + }, + "schematic": { + "$ref": "#/$defs/Schematic", + "description": "Talos image customization to be used in the installer image" + }, + "machineSpec": { + "$ref": "#/$defs/MachineSpec", + "description": "Machine hardware specification" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "hostname", + "ipAddress" + ] + }, + "Route": { + "properties": { + "network": { + "type": "string" + }, + "gateway": { + "type": "string" + }, + "source": { + "type": "string" + }, + "metric": { + "type": "integer" + }, + "mtu": { + "type": "integer" + } + }, + "additionalProperties": false, + "type": "object" + }, + "STP": { + "properties": { + "enabled": { + "type": "boolean" + } + }, + "additionalProperties": false, + "type": "object" + }, + "Schematic": { + "properties": { + "customization": { + "$ref": "#/$defs/Customization" + } + }, + "additionalProperties": false, + "type": "object" + }, + "SystemExtensions": { + "properties": { + "officialExtensions": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "additionalProperties": false, + "type": "object" + }, + "TalhelperConfig": { + "properties": { + "clusterName": { + "type": "string", + "description": "Name of the cluster" + }, + "talosImageURL": { + "type": "string", + "description": "DEPRECATED: will not do anything", + "default": "ghcr.io/siderolabs/installer" + }, + "talosVersion": { + "type": "string", + "description": "Talos version to perform installation", + "examples": [ + "v1.5.4" + ] + }, + "kubernetesVersion": { + "type": "string", + "description": "Kubernetes version to use", + "examples": [ + "v1.27.0" + ] + }, + "endpoint": { + "type": "string", + "description": "Cluster's controlplane endpoint", + "examples": [ + "https://192.168.200.10:6443" + ] + }, + "domain": { + "type": "string", + "description": "The domain to be used by Kubernetes DNS", + "examples": [ + "cluster.local" + ] + }, + "allowSchedulingOnMasters": { + "type": "boolean", + "description": "Whether to allow running workload on controlplane nodes" + }, + "allowSchedulingOnControlPlanes": { + "type": "boolean", + "description": "Whether to allow running workload on controlplane nodes. It is an alias to \"AllowSchedulingOnMasters\"" + }, + "additionalMachineCertSans": { + "items": { + "type": "string" + }, + "type": "array", + "description": "Extra certificate SANs for the machine's certificate" + }, + "additionalApiServerCertSans": { + "items": { + "type": "string" + }, + "type": "array", + "description": "Extra certificate SANs for the API server's certificate" + }, + "clusterPodNets": { + "items": { + "type": "string" + }, + "type": "array", + "description": "The pod subnet CIDR list" + }, + "clusterSvcNets": { + "items": { + "type": "string" + }, + "type": "array", + "description": "The service subnet CIDR list" + }, + "cniConfig": { + "$ref": "#/$defs/CNIConfig", + "description": "The CNI to be used for the cluster's network" + }, + "patches": { + "items": { + "type": "string" + }, + "type": "array", + "description": "Patches to be applied to all nodes" + }, + "nodes": { + "items": { + "$ref": "#/$defs/Node" + }, + "type": "array", + "description": "List of configurations for Node" + }, + "imageFactory": { + "$ref": "#/$defs/ImageFactory" + }, + "controlPlane": { + "$ref": "#/$defs/controlPlane", + "description": "Configurations targetted for controlplane nodes" + }, + "worker": { + "$ref": "#/$defs/worker", + "description": "Configurations targetted for worker nodes" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "clusterName", + "endpoint", + "nodes" + ] + }, + "VIPEquinixMetalConfig": { + "properties": { + "apiToken": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "VIPHCloudConfig": { + "properties": { + "apiToken": { + "type": "string" + } + }, + "additionalProperties": false, + "type": "object" + }, + "Vlan": { + "properties": { + "addresses": { + "items": { + "type": "string" + }, + "type": "array" + }, + "cidr": { + "type": "string" + }, + "routes": { + "items": { + "$ref": "#/$defs/Route" + }, + "type": "array" + }, + "dhcp": { + "type": "boolean" + }, + "vlanId": { + "type": "integer" + }, + "mtu": { + "type": "integer" + }, + "vip": { + "$ref": "#/$defs/DeviceVIPConfig" + }, + "dhcpOptions": { + "$ref": "#/$defs/DHCPOptions" + } + }, + "additionalProperties": false, + "type": "object" + }, + "VlanList": { + "items": { + "$ref": "#/$defs/Vlan" + }, + "type": "array" + }, + "controlPlane": { + "properties": { + "configPatches": { + "items": { + "type": "object" + }, + "type": "array", + "description": "DEPRECATED: use \"patches\" instead" + }, + "inlinePatch": { + "type": "object", + "description": "DEPRECATED: use \"patches\" instead" + }, + "patches": { + "items": { + "type": "string" + }, + "type": "array", + "description": "Patches to be applied to all controlplane nodes" + }, + "schematic": { + "$ref": "#/$defs/Schematic", + "description": "Talos image customization to be applied to all controlplane nodes" + } + }, + "additionalProperties": false, + "type": "object" + }, + "worker": { + "properties": { + "configPatches": { + "items": { + "type": "object" + }, + "type": "array", + "description": "DEPRECATED: use \"patches\" instead" + }, + "inlinePatch": { + "type": "object", + "description": "DEPRECATED: use \"patches\" instead" + }, + "patches": { + "items": { + "type": "string" + }, + "type": "array", + "description": "Patches to be applied to all worker nodes" + }, + "schematic": { + "$ref": "#/$defs/Schematic", + "description": "Talos image customization to be applied to all worker nodes" + } + }, + "additionalProperties": false, + "type": "object" + } + } +} diff --git a/infrastructure/talos/betty/talconfig.yaml b/infrastructure/talos/betty/talconfig.yaml index b54aaa3af9..5a3444dcf7 100644 --- a/infrastructure/talos/betty/talconfig.yaml +++ b/infrastructure/talos/betty/talconfig.yaml @@ -30,6 +30,8 @@ nodes: ipAddress: 192.168.20.5 controlPlane: true installDisk: /dev/sda + networkInterfaces: + - - hostname: kmaster2.${domainName} ipAddress: 192.168.20.6