From 55282acdba6468b7bf696096fccd32930c8743f6 Mon Sep 17 00:00:00 2001 From: Andrei Kvapil Date: Fri, 30 Aug 2024 13:14:46 +0200 Subject: [PATCH] vm: use block volumes to enable live-migration (#316) Signed-off-by: Andrei Kvapil --- packages/apps/virtual-machine/Makefile | 3 ++- packages/apps/virtual-machine/README.md | 5 ----- packages/apps/virtual-machine/templates/vm.yaml | 3 ++- packages/apps/virtual-machine/values.schema.json | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/packages/apps/virtual-machine/Makefile b/packages/apps/virtual-machine/Makefile index 12b42be0..350e5796 100644 --- a/packages/apps/virtual-machine/Makefile +++ b/packages/apps/virtual-machine/Makefile @@ -4,6 +4,7 @@ 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.resources.properties.memory["x-display"] = "slider"' \ + jq '.properties.resources.properties.memory["x-display"] = "slider"' | \ + jq '.properties.externalPorts.items.type = "integer"' \ > values.schema.json rm -f values.schema.json.tmp diff --git a/packages/apps/virtual-machine/README.md b/packages/apps/virtual-machine/README.md index 0d8bf457..46656419 100644 --- a/packages/apps/virtual-machine/README.md +++ b/packages/apps/virtual-machine/README.md @@ -55,11 +55,6 @@ You can customize the exposed ports by specifying them under `service.ports` in ## Example virtual machine: ```yaml -external: true -externalPorts: -- 22 -- 80 -- 443 running: true image: fedora storageClass: replicated diff --git a/packages/apps/virtual-machine/templates/vm.yaml b/packages/apps/virtual-machine/templates/vm.yaml index 42117564..faf987df 100644 --- a/packages/apps/virtual-machine/templates/vm.yaml +++ b/packages/apps/virtual-machine/templates/vm.yaml @@ -11,8 +11,9 @@ spec: name: {{ include "virtual-machine.fullname" . }} spec: pvc: + volumeMode: Block accessModes: - - ReadWriteOnce + - ReadWriteMany resources: requests: storage: {{ .Values.resources.disk | quote }} diff --git a/packages/apps/virtual-machine/values.schema.json b/packages/apps/virtual-machine/values.schema.json index 57b4d65c..0f37c2ba 100644 --- a/packages/apps/virtual-machine/values.schema.json +++ b/packages/apps/virtual-machine/values.schema.json @@ -12,7 +12,7 @@ "description": "Specify ports to forward from outside the cluster", "default": "[]", "items": { - "type": "string" + "type": "integer" } }, "running": {