Skip to content

Commit

Permalink
refactor: optimise chart by using more definitions in values schema" (#…
Browse files Browse the repository at this point in the history
…204)

* update changelog

* use definitions for node disk size

* use definitions for node memory size

* revert copy+paste failure introduced during refactoring

* use definitions for CPU count

* remove redundant titles and correct min memory size

* use definition for resource pool name

* use definition for VM template

* use definitions for VM network interface configuration
  • Loading branch information
glitchcrab authored May 21, 2024
1 parent 3745fe1 commit 42bca9c
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 109 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Normalise JSON schema.
- Remove unused values from schema.
- Update example manifests post-refactor.
- Improve values schema with definitions to make it more DRY.

## [0.51.0] - 2024-05-16

Expand Down
204 changes: 95 additions & 109 deletions helm/cluster-vsphere/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@
},
"minItems": 1
},
"diskGiB": {
"type": "integer",
"title": "Disk size",
"examples": [
30
],
"exclusiveMinimum": 0
},
"featureGate": {
"type": "object",
"title": "Feature gate",
Expand All @@ -31,6 +39,66 @@
"pattern": "^[A-Za-z0-9]+$"
}
}
},
"memoryGiB": {
"type": "integer",
"title": "Memory size",
"examples": [
8192
],
"minimum": 8192
},
"network": {
"type": "object",
"title": "Network configuration",
"additionalProperties": false,
"properties": {
"devices": {
"type": "array",
"title": "Network devices",
"description": "Network interface configuration for VMs.",
"additionalProperties": false,
"items": {
"type": "object",
"title": "Devices",
"required": [
"networkName"
],
"additionalProperties": false,
"properties": {
"dhcp4": {
"type": "boolean",
"title": "IPv4 DHCP",
"description": "Is DHCP enabled on this segment.",
"default": true
},
"networkName": {
"type": "string",
"title": "Segment name",
"description": "Segment name to attach nodes to. Must already exist."
}
}
}
}
}
},
"numCPUs": {
"type": "integer",
"title": "Number of CPUs",
"examples": [
6
],
"minimum": 2
},
"resourcePool": {
"type": "string",
"title": "vSphere resource pool name",
"default": "*/Resources"
},
"template": {
"type": "string",
"title": "VM template",
"default": "flatcar-stable-3602.2.1-kube-v1.25.16-gs"
}
},
"type": "object",
Expand Down Expand Up @@ -303,71 +371,30 @@
"default": "linkedClone"
},
"diskGiB": {
"type": "integer",
"title": "Disk size",
"description": "Control plane node root volume size, in GB.",
"minimum": 25
"$ref": "#/$defs/diskGiB",
"description": "Control plane node root volume size, in GB."
},
"memoryMiB": {
"type": "integer",
"title": "Memory size",
"$ref": "#/$defs/memoryGiB",
"description": "Control plane memory size, in MB.",
"default": 8192,
"minimum": 8192
"default": 8192
},
"network": {
"type": "object",
"title": "Network configuration",
"description": "Control plane node network configuration.",
"additionalProperties": false,
"properties": {
"devices": {
"type": "array",
"title": "Network devices",
"description": "Control plane node network devices.",
"additionalProperties": false,
"items": {
"type": "object",
"title": "Devices",
"required": [
"networkName"
],
"additionalProperties": false,
"properties": {
"dhcp4": {
"type": "boolean",
"title": "IPv4 DHCP",
"description": "Is DHCP enabled on this segment.",
"default": true
},
"networkName": {
"type": "string",
"title": "Segment name",
"description": "Segment name to attach nodes to. Must already exist."
}
}
}
}
}
"$ref": "#/$defs/network",
"description": "Control plane node network configuration."
},
"numCPUs": {
"type": "integer",
"title": "Number of CPUs",
"$ref": "#/$defs/numCPUs",
"description": "Control plane CPU count.",
"default": 4,
"minimum": 2
"default": 4
},
"resourcePool": {
"type": "string",
"title": "Resource pool name",
"description": "Name of the resource pool to use.",
"default": "*/Resources"
"$ref": "#/$defs/resourcePool",
"description": "Name of the resource pool to use."
},
"template": {
"type": "string",
"title": "VM template",
"description": "Full name of the VM template.",
"default": "flatcar-stable-3602.2.1-kube-v1.25.16-gs"
"$ref": "#/$defs/template",
"description": "Full name of the VM template."
}
}
},
Expand Down Expand Up @@ -477,7 +504,7 @@
},
"nodeClasses": {
"type": "object",
"title": "Template to define control plane nodes",
"title": "Template to define worker nodes",
"properties": {
"default": {
"type": "object",
Expand All @@ -491,71 +518,30 @@
"default": "linkedClone"
},
"diskGiB": {
"type": "integer",
"title": "Disk size",
"description": "Control plane node root volume size, in GB.",
"minimum": 25
"$ref": "#/$defs/diskGiB",
"description": "Worker node root volume size, in GB."
},
"memoryMiB": {
"type": "integer",
"title": "Memory size",
"description": "Control plane memory size, in MB.",
"default": 16896,
"minimum": 8192
"$ref": "#/$defs/memoryGiB",
"description": "Worker memory size, in MB.",
"default": 16896
},
"network": {
"type": "object",
"title": "Network configuration",
"description": "Control plane node network configuration.",
"additionalProperties": false,
"properties": {
"devices": {
"type": "array",
"title": "Network devices",
"description": "Control plane node network devices.",
"additionalProperties": false,
"items": {
"type": "object",
"title": "Devices",
"required": [
"networkName"
],
"additionalProperties": false,
"properties": {
"dhcp4": {
"type": "boolean",
"title": "IPv4 DHCP",
"description": "Is DHCP enabled on this segment.",
"default": true
},
"networkName": {
"type": "string",
"title": "Segment name",
"description": "Segment name to attach nodes to. Must already exist."
}
}
}
}
}
"$ref": "#/$defs/network",
"description": "Worker node network configuration."
},
"numCPUs": {
"type": "integer",
"title": "Number of CPUs",
"description": "Control plane CPU count.",
"default": 6,
"minimum": 2
"$ref": "#/$defs/numCPUs",
"description": "Worker node CPU count.",
"default": 6
},
"resourcePool": {
"type": "string",
"title": "Resource pool name",
"description": "Name of the resource pool to use.",
"default": "*/Resources"
"$ref": "#/$defs/resourcePool",
"description": "Name of the resource pool to use."
},
"template": {
"type": "string",
"title": "VM template",
"description": "Full name of the VM template.",
"default": "flatcar-stable-3602.2.1-kube-v1.25.16-gs"
"$ref": "#/$defs/template",
"description": "Full name of the VM template."
}
}
}
Expand Down

0 comments on commit 42bca9c

Please sign in to comment.