-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add centos stream 8 and 9 templates delete centos 8 template because centos 8 is EOL Signed-off-by: Karel Šimon <[email protected]> * update osinfo Signed-off-by: Karel Šimon <[email protected]>
- Loading branch information
Showing
5 changed files
with
183 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
apiVersion: template.openshift.io/v1 | ||
kind: Template | ||
metadata: | ||
name: {{ os }}-{{ item.workload }}-{{ item.flavor }} | ||
annotations: | ||
openshift.io/display-name: "CentOS Stream 9 VM" | ||
description: >- | ||
Template for CentOS Stream 9 VM or newer. | ||
A PVC with the CentOS Stream disk image must be available. | ||
tags: "hidden,kubevirt,virtualmachine,linux,centosstream" | ||
iconClass: "icon-{{ icon }}" | ||
openshift.io/provider-display-name: "KubeVirt" | ||
openshift.io/documentation-url: "https://github.com/kubevirt/common-templates" | ||
openshift.io/support-url: "https://github.com/kubevirt/common-templates/issues" | ||
template.openshift.io/bindable: "false" | ||
template.kubevirt.io/version: v1alpha1 | ||
defaults.template.kubevirt.io/disk: rootdisk | ||
template.kubevirt.io/editable: | | ||
/objects[0].spec.template.spec.domain.cpu.sockets | ||
/objects[0].spec.template.spec.domain.cpu.cores | ||
/objects[0].spec.template.spec.domain.cpu.threads | ||
/objects[0].spec.template.spec.domain.resources.requests.memory | ||
/objects[0].spec.template.spec.domain.devices.disks | ||
/objects[0].spec.template.spec.volumes | ||
/objects[0].spec.template.spec.networks | ||
{% for osl in oslabels %} | ||
name.os.template.kubevirt.io/{{ osl }}: {{ lookup('osinfo', oslabels[0]).name }} or higher | ||
{% endfor %} | ||
labels: | ||
{% for osl in oslabels %} | ||
os.template.kubevirt.io/{{ osl }}: "true" | ||
{% endfor %} | ||
workload.template.kubevirt.io/{{ item.workload }}: "true" | ||
flavor.template.kubevirt.io/{{ item.flavor }}: "true" | ||
template.kubevirt.io/type: "base" | ||
template.kubevirt.io/version: "{{ lookup('env', 'VERSION') | default('devel', true) }}" | ||
{% if item.default %} | ||
template.kubevirt.io/default-os-variant: "true" | ||
{% endif %} | ||
objects: | ||
- apiVersion: kubevirt.io/v1 | ||
kind: VirtualMachine | ||
metadata: | ||
name: ${NAME} | ||
labels: | ||
vm.kubevirt.io/template: {{ os }}-{{ item.workload }}-{{ item.flavor }} | ||
vm.kubevirt.io/template.version: "{{ lookup('env', 'VERSION') | default('devel', true) }}" | ||
vm.kubevirt.io/template.revision: "{{ lookup('env', 'REVISION') | default(1, true) }}" | ||
app: ${NAME} | ||
annotations: | ||
vm.kubevirt.io/validations: | | ||
[ | ||
{ | ||
"name": "minimal-required-memory", | ||
"path": "jsonpath::.spec.domain.resources.requests.memory", | ||
"rule": "integer", | ||
"message": "This VM requires more memory.", | ||
"min": {{ lookup('osinfo', osinfoname)["minimum_resources.architecture=x86_64|all.ram"] }} | ||
} | ||
] | ||
spec: | ||
dataVolumeTemplates: | ||
- apiVersion: cdi.kubevirt.io/v1beta1 | ||
kind: DataVolume | ||
metadata: | ||
name: ${NAME} | ||
spec: | ||
storage: | ||
resources: | ||
requests: | ||
storage: 30Gi | ||
sourceRef: | ||
kind: DataSource | ||
name: ${SRC_PVC_NAME} | ||
namespace: ${SRC_PVC_NAMESPACE} | ||
running: false | ||
template: | ||
metadata: | ||
annotations: | ||
vm.kubevirt.io/os: "{{ os }}" | ||
vm.kubevirt.io/workload: "{{ item.workload }}" | ||
vm.kubevirt.io/flavor: "{{ item.flavor }}" | ||
labels: | ||
kubevirt.io/domain: ${NAME} | ||
kubevirt.io/size: {{ item.flavor }} | ||
spec: | ||
domain: | ||
{% if item.iothreads %} | ||
ioThreadsPolicy: shared | ||
{% endif %} | ||
cpu: | ||
sockets: {{ item.cpus }} | ||
cores: 1 | ||
threads: 1 | ||
{% if cpumodel |default("") %} | ||
model: {{ cpumodel }} | ||
{% endif %} | ||
resources: | ||
requests: | ||
memory: {{ item.memsize }} | ||
devices: | ||
rng: {} | ||
networkInterfaceMultiqueue: true | ||
{% if item.tablet %} | ||
inputs: | ||
- type: tablet | ||
bus: virtio | ||
name: tablet | ||
{% endif %} | ||
disks: | ||
- disk: | ||
bus: {{ diskbus | default("virtio") }} | ||
name: ${NAME} | ||
- disk: | ||
bus: {{ diskbus | default("virtio") }} | ||
name: cloudinitdisk | ||
interfaces: | ||
- masquerade: {} | ||
name: default | ||
terminationGracePeriodSeconds: 180 | ||
networks: | ||
- name: default | ||
pod: {} | ||
volumes: | ||
- dataVolume: | ||
name: ${NAME} | ||
name: ${NAME} | ||
- cloudInitNoCloud: | ||
userData: |- | ||
#cloud-config | ||
user: {{ cloudusername }} | ||
password: ${CLOUD_USER_PASSWORD} | ||
chpasswd: { expire: False } | ||
name: cloudinitdisk | ||
parameters: | ||
- description: VM name | ||
from: '{{ os }}-[a-z0-9]{16}' | ||
generate: expression | ||
name: NAME | ||
- name: SRC_PVC_NAME | ||
description: Name of the DataSource to clone | ||
value: '{{ majorrelease }}' | ||
- name: SRC_PVC_NAMESPACE | ||
description: Namespace of the DataSource | ||
value: kubevirt-os-images | ||
- description: Randomized password for the cloud-init user {{ cloudusername }} | ||
from: '[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}' | ||
generate: expression | ||
name: CLOUD_USER_PASSWORD |