Skip to content

Commit ced8e5b

Browse files
authored
Introduce InstanceTypes (#403)
This PR introduces the default instancetypes: - cx1.2xlarge - cx1.4xlarge - cx1.8xlarge - cx1.large - cx1.medium - cx1.xlarge - gn1.2xlarge - gn1.4xlarge - gn1.8xlarge - gn1.xlarge - m1.2xlarge - m1.4xlarge - m1.8xlarge - m1.large - m1.xlarge - n1.2xlarge - n1.4xlarge - n1.8xlarge - n1.large - n1.medium - n1.xlarge - o1.2xlarge - o1.4xlarge - o1.8xlarge - o1.large - o1.medium - o1.micro - o1.nano - o1.small - o1.xlarge - rt1.2xlarge - rt1.4xlarge - rt1.8xlarge - rt1.large - rt1.medium - rt1.micro - rt1.small - rt1.xlarge - u1.2xlarge - u1.2xmedium - u1.4xlarge - u1.8xlarge - u1.large - u1.medium - u1.micro - u1.nano - u1.small - u1.xlarge And the following profiles: - alpine - centos.7 - centos.7.desktop - centos.stream10 - centos.stream10.desktop - centos.stream8 - centos.stream8.desktop - centos.stream8.dpdk - centos.stream9 - centos.stream9.desktop - centos.stream9.dpdk - cirros - fedora - fedora.arm64 - opensuse.leap - opensuse.tumbleweed - rhel.10 - rhel.10.arm64 - rhel.7 - rhel.7.desktop - rhel.8 - rhel.8.desktop - rhel.8.dpdk - rhel.9 - rhel.9.arm64 - rhel.9.desktop - rhel.9.dpdk - rhel.9.realtime - sles - ubuntu - windows.10 - windows.10.virtio - windows.11 - windows.11.virtio - windows.2k16 - windows.2k16.virtio - windows.2k19 - windows.2k19.virtio - windows.2k22 - windows.2k22.virtio - windows.2k25 - windows.2k25.virtio as part of #258 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced new instance types and preferences for Virtual Machines. - Added new sections in the documentation for better clarity on series and parameters. - Enhanced resource management with new fields for CPU and memory specifications. - New release added for `kubevirt-common-instancetypes`. - Added a new chart for `vm-disk` with detailed deployment instructions. - New `vm-instance` chart introduced with comprehensive deployment details. - New `vm-disk` resources for managing virtual machine disks and resizing PVCs. - **Bug Fixes** - Corrected indentation issues in configuration files. - **Documentation** - Updated README files with new parameters and sections for improved user guidance. - **Chores** - Version updates across various components to ensure compatibility and access to the latest features. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Andrei Kvapil <[email protected]>
1 parent 1a47328 commit ced8e5b

38 files changed

Lines changed: 4362 additions & 290 deletions

‎packages/apps/kubernetes/Chart.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ type: application
1616
# This is the chart version. This version number should be incremented each time you make changes
1717
# to the chart and its templates, including the app version.
1818
# Versions are expected to follow Semantic Versioning (https://semver.org/)
19-
version: 0.12.1
19+
version: 0.13.0
2020

2121
# This is the version number of the application being deployed. This version number should be
2222
# incremented each time you make changes to the application. Versions are not expected to

‎packages/apps/kubernetes/README.md‎

Lines changed: 173 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,181 @@ How to access to deployed cluster:
2727
kubectl get secret -n <namespace> kubernetes-<clusterName>-admin-kubeconfig -o go-template='{{ printf "%s\n" (index .data "super-admin.conf" | base64decode) }}' > test
2828
```
2929

30-
## Parameters
30+
# Series
3131

32-
### Common parameters
32+
<!-- source: https://github.com/kubevirt/common-instancetypes/blob/main/README.md -->
3333

34-
| Name | Description | Value |
35-
| ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
36-
| `host` | The hostname used to access the Kubernetes cluster externally (defaults to using the cluster name as a subdomain for the tenant host). | `""` |
37-
| `controlPlane.replicas` | Number of replicas for Kubernetes contorl-plane components | `2` |
38-
| `storageClass` | StorageClass used to store user data | `replicated` |
39-
| `nodeGroups` | nodeGroups configuration | `{}` |
34+
. | U | O | CX | M | RT
35+
----------------------------|-----|-----|------|-----|------
36+
*Has GPUs* | | | | |
37+
*Hugepages* | | | ✓ | ✓ | ✓
38+
*Overcommitted Memory* | | ✓ | | |
39+
*Dedicated CPU* | | | ✓ | | ✓
40+
*Burstable CPU performance* | ✓ | ✓ | | ✓ |
41+
*Isolated emulator threads* | | | ✓ | | ✓
42+
*vNUMA* | | | ✓ | | ✓
43+
*vCPU-To-Memory Ratio* | 1:4 | 1:4 | 1:2 | 1:8 | 1:4
4044

41-
### Cluster Addons
4245

43-
| Name | Description | Value |
44-
| ------------------------------------ | ---------------------------------------------------------------------------------- | ------- |
45-
| `addons.certManager.enabled` | Enables the cert-manager | `false` |
46-
| `addons.certManager.valuesOverride` | Custom values to override | `{}` |
47-
| `addons.ingressNginx.enabled` | Enable Ingress-NGINX controller (expect nodes with 'ingress-nginx' role) | `false` |
48-
| `addons.ingressNginx.valuesOverride` | Custom values to override | `{}` |
49-
| `addons.ingressNginx.hosts` | List of domain names that should be passed through to the cluster by upper cluster | `[]` |
50-
| `addons.fluxcd.enabled` | Enables Flux CD | `false` |
51-
| `addons.fluxcd.valuesOverride` | Custom values to override | `{}` |
46+
## U Series
5247

48+
The U Series is quite neutral and provides resources for
49+
general purpose applications.
50+
51+
*U* is the abbreviation for "Universal", hinting at the universal
52+
attitude towards workloads.
53+
54+
VMs of instance types will share physical CPU cores on a
55+
time-slice basis with other VMs.
56+
57+
### U Series Characteristics
58+
59+
Specific characteristics of this series are:
60+
- *Burstable CPU performance* - The workload has a baseline compute
61+
performance but is permitted to burst beyond this baseline, if
62+
excess compute resources are available.
63+
- *vCPU-To-Memory Ratio (1:4)* - A vCPU-to-Memory ratio of 1:4, for less
64+
noise per node.
65+
66+
## O Series
67+
68+
The O Series is based on the U Series, with the only difference
69+
being that memory is overcommitted.
70+
71+
*O* is the abbreviation for "Overcommitted".
72+
73+
### UO Series Characteristics
74+
75+
Specific characteristics of this series are:
76+
- *Burstable CPU performance* - The workload has a baseline compute
77+
performance but is permitted to burst beyond this baseline, if
78+
excess compute resources are available.
79+
- *Overcommitted Memory* - Memory is over-committed in order to achieve
80+
a higher workload density.
81+
- *vCPU-To-Memory Ratio (1:4)* - A vCPU-to-Memory ratio of 1:4, for less
82+
noise per node.
83+
84+
## CX Series
85+
86+
The CX Series provides exclusive compute resources for compute
87+
intensive applications.
88+
89+
*CX* is the abbreviation of "Compute Exclusive".
90+
91+
The exclusive resources are given to the compute threads of the
92+
VM. In order to ensure this, some additional cores (depending
93+
on the number of disks and NICs) will be requested to offload
94+
the IO threading from cores dedicated to the workload.
95+
In addition, in this series, the NUMA topology of the used
96+
cores is provided to the VM.
97+
98+
### CX Series Characteristics
99+
100+
Specific characteristics of this series are:
101+
- *Hugepages* - Hugepages are used in order to improve memory
102+
performance.
103+
- *Dedicated CPU* - Physical cores are exclusively assigned to every
104+
vCPU in order to provide fixed and high compute guarantees to the
105+
workload.
106+
- *Isolated emulator threads* - Hypervisor emulator threads are isolated
107+
from the vCPUs in order to reduce emaulation related impact on the
108+
workload.
109+
- *vNUMA* - Physical NUMA topology is reflected in the guest in order to
110+
optimize guest sided cache utilization.
111+
- *vCPU-To-Memory Ratio (1:2)* - A vCPU-to-Memory ratio of 1:2.
112+
113+
## M Series
114+
115+
The M Series provides resources for memory intensive
116+
applications.
117+
118+
*M* is the abbreviation of "Memory".
119+
120+
### M Series Characteristics
121+
122+
Specific characteristics of this series are:
123+
- *Hugepages* - Hugepages are used in order to improve memory
124+
performance.
125+
- *Burstable CPU performance* - The workload has a baseline compute
126+
performance but is permitted to burst beyond this baseline, if
127+
excess compute resources are available.
128+
- *vCPU-To-Memory Ratio (1:8)* - A vCPU-to-Memory ratio of 1:8, for much
129+
less noise per node.
130+
131+
## RT Series
132+
133+
The RT Series provides resources for realtime applications, like Oslat.
134+
135+
*RT* is the abbreviation for "realtime".
136+
137+
This series of instance types requires nodes capable of running
138+
realtime applications.
139+
140+
### RT Series Characteristics
141+
142+
Specific characteristics of this series are:
143+
- *Hugepages* - Hugepages are used in order to improve memory
144+
performance.
145+
- *Dedicated CPU* - Physical cores are exclusively assigned to every
146+
vCPU in order to provide fixed and high compute guarantees to the
147+
workload.
148+
- *Isolated emulator threads* - Hypervisor emulator threads are isolated
149+
from the vCPUs in order to reduce emaulation related impact on the
150+
workload.
151+
- *vCPU-To-Memory Ratio (1:4)* - A vCPU-to-Memory ratio of 1:4 starting from
152+
the medium size.
153+
154+
## Resources
155+
156+
The following instancetype resources are provided by Cozystack:
157+
158+
Name | vCPUs | Memory
159+
-----|-------|-------
160+
cx1.2xlarge | 8 | 16Gi
161+
cx1.4xlarge | 16 | 32Gi
162+
cx1.8xlarge | 32 | 64Gi
163+
cx1.large | 2 | 4Gi
164+
cx1.medium | 1 | 2Gi
165+
cx1.xlarge | 4 | 8Gi
166+
gn1.2xlarge | 8 | 32Gi
167+
gn1.4xlarge | 16 | 64Gi
168+
gn1.8xlarge | 32 | 128Gi
169+
gn1.xlarge | 4 | 16Gi
170+
m1.2xlarge | 8 | 64Gi
171+
m1.4xlarge | 16 | 128Gi
172+
m1.8xlarge | 32 | 256Gi
173+
m1.large | 2 | 16Gi
174+
m1.xlarge | 4 | 32Gi
175+
n1.2xlarge | 16 | 32Gi
176+
n1.4xlarge | 32 | 64Gi
177+
n1.8xlarge | 64 | 128Gi
178+
n1.large | 4 | 8Gi
179+
n1.medium | 4 | 4Gi
180+
n1.xlarge | 8 | 16Gi
181+
o1.2xlarge | 8 | 32Gi
182+
o1.4xlarge | 16 | 64Gi
183+
o1.8xlarge | 32 | 128Gi
184+
o1.large | 2 | 8Gi
185+
o1.medium | 1 | 4Gi
186+
o1.micro | 1 | 1Gi
187+
o1.nano | 1 | 512Mi
188+
o1.small | 1 | 2Gi
189+
o1.xlarge | 4 | 16Gi
190+
rt1.2xlarge | 8 | 32Gi
191+
rt1.4xlarge | 16 | 64Gi
192+
rt1.8xlarge | 32 | 128Gi
193+
rt1.large | 2 | 8Gi
194+
rt1.medium | 1 | 4Gi
195+
rt1.micro | 1 | 1Gi
196+
rt1.small | 1 | 2Gi
197+
rt1.xlarge | 4 | 16Gi
198+
u1.2xlarge | 8 | 32Gi
199+
u1.2xmedium | 2 | 4Gi
200+
u1.4xlarge | 16 | 64Gi
201+
u1.8xlarge | 32 | 128Gi
202+
u1.large | 2 | 8Gi
203+
u1.medium | 1 | 4Gi
204+
u1.micro | 1 | 1Gi
205+
u1.nano | 1 | 512Mi
206+
u1.small | 1 | 2Gi
207+
u1.xlarge | 4 | 16Gi

‎packages/apps/kubernetes/templates/cluster.yaml‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ spec:
1515
node-role.kubernetes.io/{{ . }}: ""
1616
{{- end }}
1717
spec:
18+
{{- with .group.instanceType }}
19+
instancetype:
20+
kind: VirtualMachineClusterInstancetype
21+
name: {{ . }}
22+
{{- end }}
1823
runStrategy: Always
1924
template:
2025
metadata:
@@ -26,10 +31,12 @@ spec:
2631
{{- end }}
2732
spec:
2833
domain:
34+
{{- if and .group.resources .group.resources.cpu }}
2935
cpu:
3036
threads: 1
3137
cores: {{ .group.resources.cpu }}
3238
sockets: 1
39+
{{- end }}
3340
devices:
3441
disks:
3542
- name: system
@@ -43,8 +50,10 @@ spec:
4350
interfaces:
4451
- name: default
4552
bridge: {}
53+
{{- if and .group.resources .group.resources.memory }}
4654
memory:
4755
guest: {{ .group.resources.memory }}
56+
{{- end }}
4857
evictionStrategy: External
4958
volumes:
5059
- name: system
@@ -176,6 +185,14 @@ spec:
176185
template:
177186
{{- $kubevirtmachinetemplate | nindent 4 }}
178187
---
188+
{{- $instanceType := dict }}
189+
{{- if $group.instanceType }}
190+
{{- $instanceType = (lookup "instancetype.kubevirt.io/v1beta1" "VirtualMachineClusterInstancetype" "" $group.instanceType) }}
191+
{{- if not $instanceType }}
192+
{{- fail (printf "Specified instancetype not exists in cluster: %s" $group.instanceType) }}
193+
{{- end }}
194+
{{- end }}
195+
179196
apiVersion: cluster.x-k8s.io/v1beta1
180197
kind: MachineDeployment
181198
metadata:
@@ -184,8 +201,16 @@ metadata:
184201
annotations:
185202
cluster.x-k8s.io/cluster-api-autoscaler-node-group-min-size: "{{ $group.minReplicas }}"
186203
cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size: "{{ $group.maxReplicas }}"
204+
{{- if and $group.resources $group.resources.memory }}
187205
capacity.cluster-autoscaler.kubernetes.io/memory: "{{ $group.resources.memory }}"
206+
{{- else }}
207+
capacity.cluster-autoscaler.kubernetes.io/memory: "{{ $instanceType.spec.memory.guest }}"
208+
{{- end }}
209+
{{- if and $group.resources $group.resources.cpu }}
188210
capacity.cluster-autoscaler.kubernetes.io/cpu: "{{ $group.resources.cpu }}"
211+
{{- else }}
212+
capacity.cluster-autoscaler.kubernetes.io/cpu: "{{ $instanceType.spec.cpu.guest }}"
213+
{{- end }}
189214
spec:
190215
clusterName: {{ $.Release.Name }}
191216
template:

‎packages/apps/kubernetes/values.yaml‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@ nodeGroups:
1515
md0:
1616
minReplicas: 0
1717
maxReplicas: 10
18-
resources:
19-
cpu: 2
20-
memory: 1024Mi
18+
instanceType: "u1.medium"
2119
ephemeralStorage: 20Gi
2220
roles:
2321
- ingress-nginx
2422

23+
resources:
24+
cpu: ""
25+
memory: ""
26+
2527
## @section Cluster Addons
2628
##
2729
addons:

‎packages/apps/versions_map‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ kubernetes 0.10.0 ac5c38b
3535
kubernetes 0.11.0 4eaca42
3636
kubernetes 0.11.1 4f430a90
3737
kubernetes 0.12.0 74649f8
38-
kubernetes 0.12.1 HEAD
38+
kubernetes 0.12.1 28fca4e
39+
kubernetes 0.13.0 HEAD
3940
mysql 0.1.0 f642698
4041
mysql 0.2.0 8b975ff0
4142
mysql 0.3.0 5ca8823
@@ -75,11 +76,8 @@ tenant 1.2.0 15478a88
7576
tenant 1.3.0 ceefae03
7677
tenant 1.3.1 c56e5769
7778
tenant 1.4.0 HEAD
78-
virtual-machine 0.1.4 f2015d6
79-
virtual-machine 0.1.5 7cd7de7
80-
virtual-machine 0.2.0 5ca8823
81-
virtual-machine 0.3.0 b908400
82-
virtual-machine 0.4.0 HEAD
79+
vm-disk 0.1.0 HEAD
80+
vm-instance 0.1.0 HEAD
8381
vpn 0.1.0 f642698
8482
vpn 0.2.0 7151424
8583
vpn 0.3.0 HEAD

‎packages/apps/virtual-machine/Makefile‎

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)