-
Notifications
You must be signed in to change notification settings - Fork 34
/
create-vm-from-manifest.yaml
83 lines (83 loc) · 2.81 KB
/
create-vm-from-manifest.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
---
apiVersion: tekton.dev/v1
kind: Task
metadata:
annotations:
tekton.dev/pipelines.minVersion: "0.43.0"
tekton.dev/categories: Automation
tekton.dev/tags: kubevirt
tekton.dev/displayName: "KubeVirt create VM from manifest"
tekton.dev/platforms: "linux/amd64"
artifacthub.io/maintainers: |
- name: KubeVirt Tekton tasks maintainers
email: [email protected]
artifacthub.io/provider: KubeVirt
artifacthub.io/recommendations: |
- url: https://kubevirt.io/
artifacthub.io/category: integration-delivery
labels:
app.kubernetes.io/version: v0.23.0
name: create-vm-from-manifest
spec:
description: >-
Automates creation of the KubeVirt virtual machine.
User can create VM from manifest or with the same parameters as for virtctl.
It is possible to immediatelly start the vm after creation with startVM parameter.
params:
- name: manifest
description: YAML manifest of a VirtualMachine resource to be created.
default: ""
type: string
- name: virtctl
description: "Parameters for virtctl create vm command that will be used to create VirtualMachine."
default: ""
type: string
- name: namespace
description: Namespace where to create the VM. (defaults to manifest namespace or active namespace)
default: ""
type: string
- name: startVM
description: Set to true or false to start / not start vm after creation. In case of runStrategy is set to Always, startVM flag is ignored.
default: ""
type: string
- name: runStrategy
description: Set runStrategy to VM. If runStrategy is set, vm.spec.running attribute is set to nil.
default: ""
type: string
- name: setOwnerReference
description: Set owner reference to the new object created by the task run pod. Allowed values true/false
type: string
default: "false"
results:
- name: name
description: The name of a VM that was created.
- name: namespace
description: The namespace of a VM that was created.
steps:
- name: createvm
image: "quay.io/kubevirt/tekton-tasks:v0.23.0"
command:
- create-vm
args:
- "--output=yaml"
env:
- name: VM_MANIFEST
value: $(params.manifest)
- name: VM_NAMESPACE
value: $(params.namespace)
- name: VIRTCTL
value: $(params.virtctl)
- name: START_VM
value: $(params.startVM)
- name: SET_OWNER_REFERENCE
value: $(params.setOwnerReference)
- name: RUN_STRATEGY
value: $(params.runStrategy)
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name