ManageIQ/manageiq-providers-kubevirt

View on GitHub
manifests/example-template.yml

Summary

Maintainability
Test Coverage
apiVersion: v1
kind: Template
metadata:
  name: linux-vm-template
  annotations:
    description: "OCP KubeVirt Red Hat Enterprise Linux 7.4 VM template"
    tags: "kubevirt,ocp,template,linux"
  labels:
    kubevirt.io/os: rhel7.4
    miq.github.io/kubevirt-is-vm-template: "true"
objects:
- apiVersion: kubevirt.io/v1alpha3
  kind: VirtualMachine
  metadata:
    name: ${NAME}
  spec:
    template:
      spec:
        domain:
          cpu:
            cores: ${CPU_CORES}
          resources:
            requests:
              memory: ${MEMORY}
          machine:
            type: q35
          devices:
            disks:
            - name: disk0-pvc
              disk:
                dev: vda
        volumes:
          - name: disk0-pvc
            persistentVolumeClaim:
              claimName: linux-vm-pvc-${NAME}
- apiVersion: v1
  kind: PersistentVolumeClaim
  metadata:
    name: linux-vm-pvc-${NAME}
    #FIXME: add an annotation to specify which volume this pvc should be based on
  spec:
    accessModes:
    - ReadWriteOnce
    resources:
      requests:
        storage: 10Gi
parameters:
- name: NAME
  description: Name for the new VM
- name: MEMORY
  description: Amount of memory
  value: 4096Mi
- name: CPU_CORES
  description: Amount of cores
  value: "4"