Skip to content

Commit b59d283

Browse files
committed
Add Virtual Machine (simple)
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
1 parent 4812874 commit b59d283

File tree

14 files changed

+776
-1
lines changed

14 files changed

+776
-1
lines changed

packages/apps/versions_map

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ tenant 1.3.0 ceefae03
7777
tenant 1.3.1 c56e5769
7878
tenant 1.4.0 94c688f7
7979
tenant 1.5.0 HEAD
80+
virtual-machine 0.1.4 f2015d6
81+
virtual-machine 0.1.5 7cd7de7
82+
virtual-machine 0.2.0 5ca8823
83+
virtual-machine 0.3.0 b908400
84+
virtual-machine 0.4.0 4746d51
85+
virtual-machine 0.5.0 HEAD
8086
vm-disk 0.1.0 HEAD
8187
vm-instance 0.1.0 HEAD
8288
vpn 0.1.0 f642698
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.helmignore
2+
/logos
3+
/Makefile
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
apiVersion: v2
2+
#name: Virtual Machine
3+
name: virtual-machine
4+
description: Virtual Machine (simple)
5+
icon: /logos/vm.svg
6+
7+
# A chart can be either an 'application' or a 'library' chart.
8+
#
9+
# Application charts are a collection of templates that can be packaged into versioned archives
10+
# to be deployed.
11+
#
12+
# Library charts provide useful utilities or functions for the chart developer. They're included as
13+
# a dependency of application charts to inject those utilities and functions into the rendering
14+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
15+
type: application
16+
17+
# This is the chart version. This version number should be incremented each time you make changes
18+
# to the chart and its templates, including the app version.
19+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
20+
version: 0.5.0
21+
22+
# This is the version number of the application being deployed. This version number should be
23+
# incremented each time you make changes to the application. Versions are not expected to
24+
# follow Semantic Versioning. They should reflect the version the application is using.
25+
# It is recommended to use it with quotes.
26+
appVersion: "1.16.1"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
include ../../../scripts/package.mk
2+
3+
generate:
4+
readme-generator -v values.yaml -s values.schema.json -r README.md
5+
INSTANCE_TYPES=$$(yq e '.metadata.name' -o=json -r ../../system/kubevirt-instancetypes/templates/instancetypes.yaml | yq 'split(" ") | . + [""]' -o json) \
6+
&& yq -i -o json ".properties.instanceType.optional=true | .properties.instanceType.enum = $${INSTANCE_TYPES}" values.schema.json
7+
PREFERENCES=$$(yq e '.metadata.name' -o=json -r ../../system/kubevirt-instancetypes/templates/preferences.yaml | yq 'split(" ") | . + [""]' -o json) \
8+
&& yq -i -o json ".properties.instanceProfile.optional=true | .properties.instanceProfile.enum = $${PREFERENCES}" values.schema.json
9+
yq -i -o json '.properties.externalPorts.items.type = "integer"' values.schema.json
10+
yq -i -o json '.properties.systemDisk.properties.image.enum = ["ubuntu", "cirros", "alpine", "fedora", "talos"]' values.schema.json
Lines changed: 268 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,268 @@
1+
# Virtual Machine (simple)
2+
3+
A Virtual Machine (VM) simulates computer hardware, enabling various operating systems and applications to run in an isolated environment.
4+
5+
## Deployment Details
6+
7+
The virtual machine is managed and hosted through KubeVirt, allowing you to harness the benefits of virtualization within your Kubernetes ecosystem.
8+
9+
- Docs: [KubeVirt User Guide](https://kubevirt.io/user-guide/)
10+
- GitHub: [KubeVirt Repository](https://github.com/kubevirt/kubevirt)
11+
12+
## Accessing virtual machine
13+
14+
You can access the virtual machine using the virtctl tool:
15+
- [KubeVirt User Guide - Virtctl Client Tool](https://kubevirt.io/user-guide/user_workloads/virtctl_client_tool/)
16+
17+
To access the serial console:
18+
19+
```
20+
virtctl console <vm>
21+
```
22+
23+
To access the VM using VNC:
24+
25+
```
26+
virtctl vnc <vm>
27+
```
28+
29+
To SSH into the VM:
30+
31+
```
32+
virtctl ssh <user>@<vm>
33+
```
34+
35+
## Parameters
36+
37+
### Common parameters
38+
39+
| Name | Description | Value |
40+
| ------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------- |
41+
| `external` | Enable external access from outside the cluster | `false` |
42+
| `externalPorts` | Specify ports to forward from outside the cluster | `[]` |
43+
| `running` | Determines if the virtual machine should be running | `true` |
44+
| `instanceType` | Virtual Machine instance type | `u1.medium` |
45+
| `instanceProfile` | Virtual Machine prefferences profile | `ubuntu` |
46+
| `systemDisk.image` | The base image for the virtual machine. Allowed values: `ubuntu`, `cirros`, `alpine`, `fedora` and `talos` | `ubuntu` |
47+
| `systemDisk.storage` | The size of the disk allocated for the virtual machine | `5Gi` |
48+
| `systemDisk.storageClass` | StorageClass used to store the data | `replicated` |
49+
| `resources.cpu` | The number of CPU cores allocated to the virtual machine | `""` |
50+
| `resources.memory` | The amount of memory allocated to the virtual machine | `""` |
51+
| `sshKeys` | List of SSH public keys for authentication. Can be a single key or a list of keys. | `[]` |
52+
| `cloudInit` | cloud-init user data config. See cloud-init documentation for more details. | `#cloud-config
53+
` |
54+
55+
## U Series
56+
57+
The U Series is quite neutral and provides resources for
58+
general purpose applications.
59+
60+
*U* is the abbreviation for "Universal", hinting at the universal
61+
attitude towards workloads.
62+
63+
VMs of instance types will share physical CPU cores on a
64+
time-slice basis with other VMs.
65+
66+
### U Series Characteristics
67+
68+
Specific characteristics of this series are:
69+
- *Burstable CPU performance* - The workload has a baseline compute
70+
performance but is permitted to burst beyond this baseline, if
71+
excess compute resources are available.
72+
- *vCPU-To-Memory Ratio (1:4)* - A vCPU-to-Memory ratio of 1:4, for less
73+
noise per node.
74+
75+
## O Series
76+
77+
The O Series is based on the U Series, with the only difference
78+
being that memory is overcommitted.
79+
80+
*O* is the abbreviation for "Overcommitted".
81+
82+
### UO Series Characteristics
83+
84+
Specific characteristics of this series are:
85+
- *Burstable CPU performance* - The workload has a baseline compute
86+
performance but is permitted to burst beyond this baseline, if
87+
excess compute resources are available.
88+
- *Overcommitted Memory* - Memory is over-committed in order to achieve
89+
a higher workload density.
90+
- *vCPU-To-Memory Ratio (1:4)* - A vCPU-to-Memory ratio of 1:4, for less
91+
noise per node.
92+
93+
## CX Series
94+
95+
The CX Series provides exclusive compute resources for compute
96+
intensive applications.
97+
98+
*CX* is the abbreviation of "Compute Exclusive".
99+
100+
The exclusive resources are given to the compute threads of the
101+
VM. In order to ensure this, some additional cores (depending
102+
on the number of disks and NICs) will be requested to offload
103+
the IO threading from cores dedicated to the workload.
104+
In addition, in this series, the NUMA topology of the used
105+
cores is provided to the VM.
106+
107+
### CX Series Characteristics
108+
109+
Specific characteristics of this series are:
110+
- *Hugepages* - Hugepages are used in order to improve memory
111+
performance.
112+
- *Dedicated CPU* - Physical cores are exclusively assigned to every
113+
vCPU in order to provide fixed and high compute guarantees to the
114+
workload.
115+
- *Isolated emulator threads* - Hypervisor emulator threads are isolated
116+
from the vCPUs in order to reduce emaulation related impact on the
117+
workload.
118+
- *vNUMA* - Physical NUMA topology is reflected in the guest in order to
119+
optimize guest sided cache utilization.
120+
- *vCPU-To-Memory Ratio (1:2)* - A vCPU-to-Memory ratio of 1:2.
121+
122+
## M Series
123+
124+
The M Series provides resources for memory intensive
125+
applications.
126+
127+
*M* is the abbreviation of "Memory".
128+
129+
### M Series Characteristics
130+
131+
Specific characteristics of this series are:
132+
- *Hugepages* - Hugepages are used in order to improve memory
133+
performance.
134+
- *Burstable CPU performance* - The workload has a baseline compute
135+
performance but is permitted to burst beyond this baseline, if
136+
excess compute resources are available.
137+
- *vCPU-To-Memory Ratio (1:8)* - A vCPU-to-Memory ratio of 1:8, for much
138+
less noise per node.
139+
140+
## RT Series
141+
142+
The RT Series provides resources for realtime applications, like Oslat.
143+
144+
*RT* is the abbreviation for "realtime".
145+
146+
This series of instance types requires nodes capable of running
147+
realtime applications.
148+
149+
### RT Series Characteristics
150+
151+
Specific characteristics of this series are:
152+
- *Hugepages* - Hugepages are used in order to improve memory
153+
performance.
154+
- *Dedicated CPU* - Physical cores are exclusively assigned to every
155+
vCPU in order to provide fixed and high compute guarantees to the
156+
workload.
157+
- *Isolated emulator threads* - Hypervisor emulator threads are isolated
158+
from the vCPUs in order to reduce emaulation related impact on the
159+
workload.
160+
- *vCPU-To-Memory Ratio (1:4)* - A vCPU-to-Memory ratio of 1:4 starting from
161+
the medium size.
162+
163+
## Development
164+
165+
To get started with customizing or creating your own instancetypes and preferences
166+
see [DEVELOPMENT.md](./DEVELOPMENT.md).
167+
168+
## Resources
169+
170+
The following instancetype resources are provided by Cozystack:
171+
172+
Name | vCPUs | Memory
173+
-----|-------|-------
174+
cx1.2xlarge | 8 | 16Gi
175+
cx1.4xlarge | 16 | 32Gi
176+
cx1.8xlarge | 32 | 64Gi
177+
cx1.large | 2 | 4Gi
178+
cx1.medium | 1 | 2Gi
179+
cx1.xlarge | 4 | 8Gi
180+
gn1.2xlarge | 8 | 32Gi
181+
gn1.4xlarge | 16 | 64Gi
182+
gn1.8xlarge | 32 | 128Gi
183+
gn1.xlarge | 4 | 16Gi
184+
m1.2xlarge | 8 | 64Gi
185+
m1.4xlarge | 16 | 128Gi
186+
m1.8xlarge | 32 | 256Gi
187+
m1.large | 2 | 16Gi
188+
m1.xlarge | 4 | 32Gi
189+
n1.2xlarge | 16 | 32Gi
190+
n1.4xlarge | 32 | 64Gi
191+
n1.8xlarge | 64 | 128Gi
192+
n1.large | 4 | 8Gi
193+
n1.medium | 4 | 4Gi
194+
n1.xlarge | 8 | 16Gi
195+
o1.2xlarge | 8 | 32Gi
196+
o1.4xlarge | 16 | 64Gi
197+
o1.8xlarge | 32 | 128Gi
198+
o1.large | 2 | 8Gi
199+
o1.medium | 1 | 4Gi
200+
o1.micro | 1 | 1Gi
201+
o1.nano | 1 | 512Mi
202+
o1.small | 1 | 2Gi
203+
o1.xlarge | 4 | 16Gi
204+
rt1.2xlarge | 8 | 32Gi
205+
rt1.4xlarge | 16 | 64Gi
206+
rt1.8xlarge | 32 | 128Gi
207+
rt1.large | 2 | 8Gi
208+
rt1.medium | 1 | 4Gi
209+
rt1.micro | 1 | 1Gi
210+
rt1.small | 1 | 2Gi
211+
rt1.xlarge | 4 | 16Gi
212+
u1.2xlarge | 8 | 32Gi
213+
u1.2xmedium | 2 | 4Gi
214+
u1.4xlarge | 16 | 64Gi
215+
u1.8xlarge | 32 | 128Gi
216+
u1.large | 2 | 8Gi
217+
u1.medium | 1 | 4Gi
218+
u1.micro | 1 | 1Gi
219+
u1.nano | 1 | 512Mi
220+
u1.small | 1 | 2Gi
221+
u1.xlarge | 4 | 16Gi
222+
223+
The following preference resources are provided by Cozystack:
224+
225+
Name | Guest OS
226+
-----|---------
227+
alpine | Alpine
228+
centos.7 | CentOS 7
229+
centos.7.desktop | CentOS 7
230+
centos.stream10 | CentOS Stream 10
231+
centos.stream10.desktop | CentOS Stream 10
232+
centos.stream8 | CentOS Stream 8
233+
centos.stream8.desktop | CentOS Stream 8
234+
centos.stream8.dpdk | CentOS Stream 8
235+
centos.stream9 | CentOS Stream 9
236+
centos.stream9.desktop | CentOS Stream 9
237+
centos.stream9.dpdk | CentOS Stream 9
238+
cirros | Cirros
239+
fedora | Fedora (amd64)
240+
fedora.arm64 | Fedora (arm64)
241+
opensuse.leap | OpenSUSE Leap
242+
opensuse.tumbleweed | OpenSUSE Tumbleweed
243+
rhel.10 | Red Hat Enterprise Linux 10 Beta (amd64)
244+
rhel.10.arm64 | Red Hat Enterprise Linux 10 Beta (arm64)
245+
rhel.7 | Red Hat Enterprise Linux 7
246+
rhel.7.desktop | Red Hat Enterprise Linux 7
247+
rhel.8 | Red Hat Enterprise Linux 8
248+
rhel.8.desktop | Red Hat Enterprise Linux 8
249+
rhel.8.dpdk | Red Hat Enterprise Linux 8
250+
rhel.9 | Red Hat Enterprise Linux 9 (amd64)
251+
rhel.9.arm64 | Red Hat Enterprise Linux 9 (arm64)
252+
rhel.9.desktop | Red Hat Enterprise Linux 9 Desktop (amd64)
253+
rhel.9.dpdk | Red Hat Enterprise Linux 9 DPDK (amd64)
254+
rhel.9.realtime | Red Hat Enterprise Linux 9 Realtime (amd64)
255+
sles | SUSE Linux Enterprise Server
256+
ubuntu | Ubuntu
257+
windows.10 | Microsoft Windows 10
258+
windows.10.virtio | Microsoft Windows 10 (virtio)
259+
windows.11 | Microsoft Windows 11
260+
windows.11.virtio | Microsoft Windows 11 (virtio)
261+
windows.2k16 | Microsoft Windows Server 2016
262+
windows.2k16.virtio | Microsoft Windows Server 2016 (virtio)
263+
windows.2k19 | Microsoft Windows Server 2019
264+
windows.2k19.virtio | Microsoft Windows Server 2019 (virtio)
265+
windows.2k22 | Microsoft Windows Server 2022
266+
windows.2k22.virtio | Microsoft Windows Server 2022 (virtio)
267+
windows.2k25 | Microsoft Windows Server 2025
268+
windows.2k25.virtio | Microsoft Windows Server 2025 (virtio)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#!/bin/sh
Lines changed: 21 additions & 0 deletions
Loading
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "virtual-machine.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "virtual-machine.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "virtual-machine.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "virtual-machine.labels" -}}
37+
helm.sh/chart: {{ include "virtual-machine.chart" . }}
38+
{{ include "virtual-machine.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "virtual-machine.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "virtual-machine.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}

0 commit comments

Comments
 (0)