Skip to content

Commit f639151

Browse files
authored
Merge pull request #114 from cloudymax/bump-kubevirt-vm
- bump version of cloud-init included in kubevirt-vm to 0.4.0 - cleanup default values by fixing some indent and type errors - enable templating a networkData secret when `cloudinit.staticIPs` is set
2 parents 0fbd3ea + 6c59b90 commit f639151

File tree

5 files changed

+50
-28
lines changed

5 files changed

+50
-28
lines changed

charts/kubevirt-vm/Chart.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dependencies:
22
- name: cloud-init
33
repository: https://cloudymax.github.io/kubevirt-community-stack
4-
version: 0.3.0
5-
digest: sha256:f06491ebc3cb3267b4fb9056f337af4405aadb1e3e4dde64817e2b8c0ef09c3b
6-
generated: "2025-08-07T18:48:50.521660925Z"
4+
version: 0.4.0
5+
digest: sha256:d67fa26bb90d70c748a9461e2c0f205f2f271962e97570ab618e814260b83122
6+
generated: "2025-10-06T23:04:49.454877+02:00"

charts/kubevirt-vm/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: kubevirt-vm
33
description: Configure a virtual machine for use with Kubevirt
44

55
type: application
6-
version: 0.5.1
6+
version: 0.6.0
77
appVersion: "0.1.0"
88

99
maintainers:
@@ -14,6 +14,6 @@ maintainers:
1414
dependencies:
1515
- name: cloud-init
1616
alias: cloudinit
17-
version: 0.3.0
17+
version: 0.4.0
1818
repository: https://cloudymax.github.io/kubevirt-community-stack
1919
condition: cloudinit.enabled

charts/kubevirt-vm/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# kubevirt-vm
22

3-
![Version: 0.5.1](https://img.shields.io/badge/Version-0.5.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.0](https://img.shields.io/badge/AppVersion-0.1.0-informational?style=flat-square)
3+
![Version: 0.6.0](https://img.shields.io/badge/Version-0.6.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.0](https://img.shields.io/badge/AppVersion-0.1.0-informational?style=flat-square)
44

55
Configure a virtual machine for use with Kubevirt
66

@@ -14,13 +14,13 @@ Configure a virtual machine for use with Kubevirt
1414

1515
| Repository | Name | Version |
1616
|------------|------|---------|
17-
| https://cloudymax.github.io/kubevirt-community-stack | cloudinit(cloud-init) | 0.3.0 |
17+
| https://cloudymax.github.io/kubevirt-community-stack | cloudinit(cloud-init) | 0.4.0 |
1818

1919
## Values
2020

2121
| Key | Type | Default | Description |
2222
|-----|------|---------|-------------|
23-
| cloudinit | object | `{"argocdAppName":"","boot_cmd":[],"ca_certs":[],"debug":false,"disable_root":false,"disk_setup":{},"enabled":true,"envsubst":false,"existingConfigMap":false,"extraEnvVars":[],"fs_setup":[],"hostname":"test","image":"deserializeme/kv-cloud-init:v0.0.1","mounts":[],"namespace":"kubevirt","network":{"config":"disabled"},"package_reboot_if_required":false,"package_update":true,"package_upgrade":false,"packages":[],"runcmd":[],"salt":"saltsaltlettuce","secret_name":"test-scrapmetal-user-data","serviceAccount":{"create":true,"existingServiceAccountName":"cloud-init-sa","name":"cloud-init-sa"},"swap":{"enabled":false,"filename":"/swapfile","maxsize":"1G","size":"1G"},"users":[{"groups":"users, admin, docker, sudo, kvm","lock_passwd":false,"name":"test","password":{"random":true},"shell":"/bin/bash","ssh_authorized_keys":[],"ssh_import_id":[],"sudo":"ALL=(ALL) NOPASSWD:ALL"}],"wireguard":[],"write_files":[]}` | Enable or disable usage of cloud-init sub-chart |
23+
| cloudinit | object | `{"argocdAppName":"","boot_cmd":[],"ca_certs":[],"debug":false,"disable_root":false,"disk_setup":[],"enabled":true,"envsubst":false,"existingConfigMap":false,"extraEnvVars":[],"fs_setup":[],"hostname":"test","image":"deserializeme/kv-cloud-init:v0.0.1","mounts":[],"namespace":"kubevirt","network":{"config":"disabled"},"package_reboot_if_required":false,"package_update":true,"package_upgrade":false,"packages":[],"runcmd":[],"salt":"saltsaltlettuce","secret_name":"test-scrapmetal-user-data","serviceAccount":{"create":true,"existingServiceAccountName":"cloud-init-sa","name":"cloud-init-sa"},"staticIPs":[],"swap":{"enabled":false,"filename":"/swapfile","maxsize":"1G","size":"1G"},"users":[{"groups":"users, admin, docker, sudo, kvm","lock_passwd":false,"name":"test","password":{"random":true},"shell":"/bin/bash","ssh_authorized_keys":[],"ssh_import_id":[],"sudo":"ALL=(ALL) NOPASSWD:ALL"}],"wireguard":[],"write_files":[]}` | Enable or disable usage of cloud-init sub-chart |
2424
| cloudinit.argocdAppName | string | `""` | - ArgoCD App name for optional resource tracking |
2525
| cloudinit.boot_cmd | list | `[]` | Run arbitrary commands early in the boot process See https://cloudinit.readthedocs.io/en/latest/reference/modules.html#bootcmd |
2626
| cloudinit.ca_certs | list | `[]` | Add CA certificates See https://cloudinit.readthedocs.io/en/latest/reference/modules.html#ca-certificates |
@@ -39,6 +39,7 @@ Configure a virtual machine for use with Kubevirt
3939
| cloudinit.salt | string | `"saltsaltlettuce"` | salt used for password generation |
4040
| cloudinit.secret_name | string | `"test-scrapmetal-user-data"` | name of secret in which to save the user-data file |
4141
| cloudinit.serviceAccount | object | `{"create":true,"existingServiceAccountName":"cloud-init-sa","name":"cloud-init-sa"}` | Choose weather to create a service-account or not. Once a SA has been created you should set this to false on subsequent runs. |
42+
| cloudinit.staticIPs | list | `[]` | Add a list staatic IP address assignment via networkData. For use with Multus |
4243
| cloudinit.swap | object | `{"enabled":false,"filename":"/swapfile","maxsize":"1G","size":"1G"}` | creates a swap file using human-readable values. |
4344
| cloudinit.users | list | `[{"groups":"users, admin, docker, sudo, kvm","lock_passwd":false,"name":"test","password":{"random":true},"shell":"/bin/bash","ssh_authorized_keys":[],"ssh_import_id":[],"sudo":"ALL=(ALL) NOPASSWD:ALL"}]` | user configuration options See https://cloudinit.readthedocs.io/en/latest/reference/modules.html#users-and-groups do NOT use 'admin' as username - it conflicts with multiele cloud-images |
4445
| cloudinit.users[0].password | object | `{"random":true}` | set user password from existing secret or generate random |

charts/kubevirt-vm/templates/virtualmachine.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,17 @@ spec:
262262
{{- if eq .Values.cloudinit.enabled true }}
263263
name: {{ .Values.cloudinit.secret_name }}
264264
{{- end }}
265+
{{- if eq .Values.cloudinit.enabled true }}
266+
{{- if .Values.cloudinit.staticIPs }}
267+
networkDataSecretRef:
268+
{{- if eq .Values.userDataSecret.enabled true }}
269+
name: {{ .Values.userDataSecret.name }}
270+
{{- else }}
271+
name: {{ .Values.cloudinit.secret_name }}
272+
{{- end }}
273+
{{- end }}
274+
{{- end }}
275+
265276
{{- end }}
266277
{{- end }}
267278
{{- end }}

charts/kubevirt-vm/values.yaml

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -200,25 +200,25 @@ disks:
200200
#################################################
201201
# DataVolume disk with URL source example
202202
#################################################
203-
- name: harddrive
204-
# -- Disk type: disk, cdrom, filesystem, or lun
205-
type: disk
206-
# -- Bus type: sata or virtio
207-
bus: virtio
208-
# -- Sets disk position in boot order, lower numbers are checked earlier
209-
bootorder: 2
210-
# -- Set disk to be Read-only
211-
readonly: false
212-
# -- Size of disk in GB
213-
pvsize: 16Gi
214-
# -- Storage class to use for the pvc
215-
pvstorageClassName: fast-raid
216-
# -- Access mode for the PVC
217-
pvaccessMode: ReadWriteOnce
218-
# -- source type of the disk image. One of `url`, `pvc`
219-
source: url
220-
# -- URL of cloud-image
221-
url: "https://buildstars.online/debian-12-generic-amd64-daily.qcow2"
203+
- name: harddrive
204+
# -- Disk type: disk, cdrom, filesystem, or lun
205+
type: disk
206+
# -- Bus type: sata or virtio
207+
bus: virtio
208+
# -- Sets disk position in boot order, lower numbers are checked earlier
209+
bootorder: 2
210+
# -- Set disk to be Read-only
211+
readonly: false
212+
# -- Size of disk in GB
213+
pvsize: 16Gi
214+
# -- Storage class to use for the pvc
215+
pvstorageClassName: fast-raid
216+
# -- Access mode for the PVC
217+
pvaccessMode: ReadWriteOnce
218+
# -- source type of the disk image. One of `url`, `pvc`
219+
source: url
220+
# -- URL of cloud-image
221+
url: "https://buildstars.online/debian-12-generic-amd64-daily.qcow2"
222222

223223
#########################################################
224224
# Ephemeral disk example
@@ -382,7 +382,7 @@ cloudinit:
382382
size: 1G
383383
maxsize: 1G
384384

385-
disk_setup: {}
385+
disk_setup: []
386386
# -- The name of the device.
387387
# - name: /dev/vdb
388388
# # -- This is a list of values, with the percentage of disk that
@@ -506,6 +506,16 @@ cloudinit:
506506
runcmd: []
507507
# - docker run -d -p 8080:80 nginx
508508

509+
# -- Add a list staatic IP address assignment via networkData.
510+
# For use with Multus
511+
staticIPs: []
512+
#- name: enp1s0
513+
# type: physical
514+
# subnets:
515+
# - type: static
516+
# address: 192.168.2.111/32
517+
# gateway: 192.168.2.1
518+
509519
################################################################################
510520
# ____ _ ___ ___
511521
#/ ___| ___ _ ____ _(_) ___ ___ ( _ ) |_ _|_ __ __ _ _ __ ___ ___ ___

0 commit comments

Comments
 (0)