mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2025-12-13 21:34:40 +03:00
CI: use VirtualMachineInstance for VMs
VMI in Kubevirt are the abstraction below VirtualMachine. - We don't really need the extra abstraction of VirtualMachine objects - Convert the waiting for VMs ip address to use kubernetes.core.k8s_info and no shell pipeline
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
---
|
||||
apiVersion: kubevirt.io/v1
|
||||
kind: VirtualMachine
|
||||
kind: VirtualMachineInstance
|
||||
metadata:
|
||||
generateName: test-vm-
|
||||
namespace: {{ pod_namespace }}
|
||||
@@ -8,6 +8,8 @@ metadata:
|
||||
kubespray.com/ci.template-path: "tests/cloud_playbooks/roles/packet-ci/templates/vm.yml.j2"
|
||||
labels:
|
||||
kubevirt.io/os: {{ cloud_image }}
|
||||
kubevirt.io/size: small
|
||||
kubevirt.io/domain: "{{ test_name }}"
|
||||
ci_job_id: "{{ ci_job_id }}"
|
||||
ci_job_name: "{{ ci_job_name }}"
|
||||
# leverage the Kubernetes GC for resources cleanup
|
||||
@@ -17,46 +19,39 @@ metadata:
|
||||
name: "{{ pod_name }}"
|
||||
uid: "{{ pod_uid }}"
|
||||
spec:
|
||||
running: true
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
kubevirt.io/size: small
|
||||
kubevirt.io/domain: "{{ test_name }}"
|
||||
spec:
|
||||
domain:
|
||||
devices:
|
||||
blockMultiQueue: true
|
||||
disks:
|
||||
- disk:
|
||||
bus: virtio
|
||||
name: containervolume
|
||||
cache: writethrough
|
||||
- disk:
|
||||
bus: virtio
|
||||
name: cloudinitvolume
|
||||
interfaces:
|
||||
- name: default
|
||||
bridge: {}
|
||||
cpu:
|
||||
cores: {{ vm_cpu_cores }}
|
||||
sockets: {{ vm_cpu_sockets }}
|
||||
threads: {{ vm_cpu_threads }}
|
||||
resources:
|
||||
requests:
|
||||
memory: "{{ vm_memory * memory_allocation_ratio }}Mi"
|
||||
cpu: {{ vm_cpu_cores * cpu_allocation_ratio }}
|
||||
limits:
|
||||
memory: "{{ vm_memory }}Mi"
|
||||
cpu: {{ vm_cpu_cores }}
|
||||
networks:
|
||||
domain:
|
||||
devices:
|
||||
blockMultiQueue: true
|
||||
disks:
|
||||
- disk:
|
||||
bus: virtio
|
||||
name: containervolume
|
||||
cache: writethrough
|
||||
- disk:
|
||||
bus: virtio
|
||||
name: cloudinitvolume
|
||||
interfaces:
|
||||
- name: default
|
||||
pod: {}
|
||||
terminationGracePeriodSeconds: 0
|
||||
volumes:
|
||||
- name: containervolume
|
||||
containerDisk:
|
||||
image: quay.io/kubespray/vm-{{ cloud_image }}
|
||||
- name: cloudinitvolume
|
||||
cloudInitNoCloud:
|
||||
userDataBase64: {{ cloud_init[cloud_image] }}
|
||||
bridge: {}
|
||||
cpu:
|
||||
cores: {{ vm_cpu_cores }}
|
||||
sockets: {{ vm_cpu_sockets }}
|
||||
threads: {{ vm_cpu_threads }}
|
||||
resources:
|
||||
requests:
|
||||
memory: "{{ vm_memory * memory_allocation_ratio }}Mi"
|
||||
cpu: {{ vm_cpu_cores * cpu_allocation_ratio }}
|
||||
limits:
|
||||
memory: "{{ vm_memory }}Mi"
|
||||
cpu: {{ vm_cpu_cores }}
|
||||
networks:
|
||||
- name: default
|
||||
pod: {}
|
||||
terminationGracePeriodSeconds: 0
|
||||
volumes:
|
||||
- name: containervolume
|
||||
containerDisk:
|
||||
image: quay.io/kubespray/vm-{{ cloud_image }}
|
||||
- name: cloudinitvolume
|
||||
cloudInitNoCloud:
|
||||
userDataBase64: {{ cloud_init[cloud_image] }}
|
||||
|
||||
Reference in New Issue
Block a user