Skip to content

Commit

Permalink
VM: add Talos Linux (#319)
Browse files Browse the repository at this point in the history
  • Loading branch information
kvaps authored Aug 30, 2024
1 parent b7bfc4c commit 4746d51
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 16 deletions.
2 changes: 1 addition & 1 deletion packages/apps/virtual-machine/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ include ../../../scripts/package.mk
generate:
readme-generator -v values.yaml -s values.schema.json.tmp -r README.md
cat values.schema.json.tmp | \
jq '.properties.image.enum = ["ubuntu", "cirros", "alpine", "fedora"]' | \
jq '.properties.image.enum = ["ubuntu", "cirros", "alpine", "fedora", "talos"]' | \
jq '.properties.resources.properties.memory["x-display"] = "slider"' | \
jq '.properties.externalPorts.items.type = "integer"' \
> values.schema.json
Expand Down
24 changes: 12 additions & 12 deletions packages/apps/virtual-machine/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@ virtctl ssh <user>@<vm>

### Common parameters

| Name | Description | Value |
| ------------------ | ------------------------------------------------------------------------------------------------- | ---------------- |
| `external` | Enable external access from outside the cluster | `false` |
| `externalPorts` | Specify ports to forward from outside the cluster | `[]` |
| `running` | Determines if the virtual machine should be running | `true` |
| `image` | The base image for the virtual machine. Allowed values: `ubuntu`, `cirros`, `alpine` and `fedora` | `ubuntu` |
| `storageClass` | StorageClass used to store the data | `replicated` |
| `resources.cpu` | The number of CPU cores allocated to the virtual machine | `1` |
| `resources.memory` | The amount of memory allocated to the virtual machine | `1024M` |
| `resources.disk` | The size of the disk allocated for the virtual machine | `5Gi` |
| `sshKeys` | List of SSH public keys for authentication. Can be a single key or a list of keys. | `[]` |
| `cloudInit` | cloud-init user data config. See cloud-init documentation for more details. | `#cloud-config
| Name | Description | Value |
| ------------------ | ---------------------------------------------------------------------------------------------------------- | ---------------- |
| `external` | Enable external access from outside the cluster | `false` |
| `externalPorts` | Specify ports to forward from outside the cluster | `[]` |
| `running` | Determines if the virtual machine should be running | `true` |
| `image` | The base image for the virtual machine. Allowed values: `ubuntu`, `cirros`, `alpine`, `fedora` and `talos` | `ubuntu` |
| `storageClass` | StorageClass used to store the data | `replicated` |
| `resources.cpu` | The number of CPU cores allocated to the virtual machine | `1` |
| `resources.memory` | The amount of memory allocated to the virtual machine | `1024M` |
| `resources.disk` | The size of the disk allocated for the virtual machine | `5Gi` |
| `sshKeys` | List of SSH public keys for authentication. Can be a single key or a list of keys. | `[]` |
| `cloudInit` | cloud-init user data config. See cloud-init documentation for more details. | `#cloud-config
` |

You can customize the exposed ports by specifying them under `service.ports` in the `values.yaml` file.
Expand Down
2 changes: 2 additions & 0 deletions packages/apps/virtual-machine/templates/vm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ spec:
url: https://download.fedoraproject.org/pub/fedora/linux/releases/40/Cloud/x86_64/images/Fedora-Cloud-Base-Generic.x86_64-40-1.14.qcow2
{{- else if eq .Values.image "alpine" }}
url: https://dl-cdn.alpinelinux.org/alpine/v3.20/releases/cloud/nocloud_alpine-3.20.2-x86_64-bios-tiny-r0.qcow2
{{- else if eq .Values.image "talos" }}
url: https://github.com/siderolabs/talos/releases/download/v1.7.6/nocloud-amd64.raw.xz
{{- end }}
template:
metadata:
Expand Down
5 changes: 3 additions & 2 deletions packages/apps/virtual-machine/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@
},
"image": {
"type": "string",
"description": "The base image for the virtual machine. Allowed values: `ubuntu`, `cirros`, `alpine` and `fedora`",
"description": "The base image for the virtual machine. Allowed values: `ubuntu`, `cirros`, `alpine`, `fedora` and `talos`",
"default": "ubuntu",
"enum": [
"ubuntu",
"cirros",
"alpine",
"fedora"
"fedora",
"talos"
]
},
"storageClass": {
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/virtual-machine/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## @param external Enable external access from outside the cluster
## @param externalPorts [array] Specify ports to forward from outside the cluster
## @param running Determines if the virtual machine should be running
## @param image The base image for the virtual machine. Allowed values: `ubuntu`, `cirros`, `alpine` and `fedora`
## @param image The base image for the virtual machine. Allowed values: `ubuntu`, `cirros`, `alpine`, `fedora` and `talos`
## @param storageClass StorageClass used to store the data
## @param resources.cpu The number of CPU cores allocated to the virtual machine
## @param resources.memory The amount of memory allocated to the virtual machine
Expand Down

0 comments on commit 4746d51

Please sign in to comment.