Support cloudInit in CRD.
This commit is contained in:
parent
499c1822fd
commit
b255f0e946
4 changed files with 62 additions and 1 deletions
|
|
@ -965,6 +965,21 @@ spec:
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
type: string
|
type: string
|
||||||
nullable: true
|
nullable: true
|
||||||
|
cloudInit:
|
||||||
|
type: object
|
||||||
|
description: >-
|
||||||
|
Provides data for generating a cloud-init ISO
|
||||||
|
image that is attached to the VM.
|
||||||
|
properties:
|
||||||
|
metaData:
|
||||||
|
description: Copied to cloud-init's meta-data file.
|
||||||
|
type: object
|
||||||
|
additionalProperties:
|
||||||
|
type: string
|
||||||
|
userData:
|
||||||
|
description: Copied to cloud-init's user-data file.
|
||||||
|
type: object
|
||||||
|
x-kubernetes-preserve-unknown-fields: true
|
||||||
vm:
|
vm:
|
||||||
type: object
|
type: object
|
||||||
description: Defines the VM.
|
description: Defines the VM.
|
||||||
|
|
|
||||||
1
dev-example/.gitignore
vendored
Normal file
1
dev-example/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
/test-vm-ci.yaml
|
||||||
30
dev-example/test-vm-shell.yaml
Normal file
30
dev-example/test-vm-shell.yaml
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
kind: Pod
|
||||||
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: test-vm-shell
|
||||||
|
namespace: vmop-dev
|
||||||
|
spec:
|
||||||
|
volumes:
|
||||||
|
- name: test-vm-system-disk
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: system-disk-test-vm-0
|
||||||
|
- name: vmop-image-repository
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: vmop-image-repository
|
||||||
|
containers:
|
||||||
|
- name: test-vm-shell
|
||||||
|
image: archlinux/archlinux
|
||||||
|
args:
|
||||||
|
- bash
|
||||||
|
imagePullPolicy: Always
|
||||||
|
stdin: true
|
||||||
|
stdinOnce: true
|
||||||
|
tty: true
|
||||||
|
volumeDevices:
|
||||||
|
- name: test-vm-system-disk
|
||||||
|
devicePath: /dev/test-vm-system-disk
|
||||||
|
volumeMounts:
|
||||||
|
- name: vmop-image-repository
|
||||||
|
mountPath: /var/local/vmop-image-repository
|
||||||
|
securityContext:
|
||||||
|
privileged: true
|
||||||
|
|
@ -44,7 +44,22 @@ data:
|
||||||
<#if cr.spec.runnerTemplate?? && cr.spec.runnerTemplate.update?? >
|
<#if cr.spec.runnerTemplate?? && cr.spec.runnerTemplate.update?? >
|
||||||
updateTemplate: ${ cr.spec.runnerTemplate.update.asBoolean?c }
|
updateTemplate: ${ cr.spec.runnerTemplate.update.asBoolean?c }
|
||||||
</#if>
|
</#if>
|
||||||
|
|
||||||
|
# Forward the cloud-init data if provided
|
||||||
|
<#if cr.spec.cloudInit??>
|
||||||
|
cloudInit:
|
||||||
|
<#if cr.spec.cloudInit.metaData??>
|
||||||
|
metaData: ${ cr.spec.cloudInit.metaData.toString() }
|
||||||
|
<#else>
|
||||||
|
metaData: {}
|
||||||
|
</#if>
|
||||||
|
<#if cr.spec.cloudInit.userData??>
|
||||||
|
userData: ${ cr.spec.cloudInit.userData.toString() }
|
||||||
|
<#else>
|
||||||
|
userData: {}
|
||||||
|
</#if>
|
||||||
|
</#if>
|
||||||
|
|
||||||
# Define the VM (required)
|
# Define the VM (required)
|
||||||
vm:
|
vm:
|
||||||
# The VM's name (required)
|
# The VM's name (required)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue