forked from kubevirt/kubevirt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hooks: create OnDefineDomain hook point and use it
- Loading branch information
Showing
9 changed files
with
161 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,28 @@ | ||
# KubeVirt SMBIOS hook sidecar | ||
|
||
Example VM definition: | ||
To use this hook, use following annotations: | ||
|
||
```yaml | ||
apiVersion: kubevirt.io/v1alpha2 | ||
kind: VirtualMachineInstance | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
special: vm-hook-sidecar-consumer | ||
name: vm-hook-sidecar-consumer | ||
annotations: | ||
# Request the hook sidecar | ||
hooks.kubevirt.io/hookSidecars: '[{"image": "registry:5000/kubevirt/example-hook-sidecar:devel"}]' | ||
# Overwrite base board manufacturer name | ||
smbios.vm.kubevirt.io/baseBoardManufacturer: "Radical Edward" | ||
spec: | ||
domain: | ||
devices: | ||
disks: | ||
- disk: | ||
bus: virtio | ||
name: registrydisk | ||
volumeName: registryvolume | ||
machine: | ||
type: "" | ||
resources: | ||
requests: | ||
memory: 64M | ||
terminationGracePeriodSeconds: 0 | ||
volumes: | ||
- name: registryvolume | ||
registryDisk: | ||
image: registry:5000/kubevirt/cirros-registry-disk-demo:devel | ||
status: {} | ||
annotations: | ||
# Request the hook sidecar | ||
hooks.kubevirt.io/hookSidecars: '[{"image": "registry:5000/kubevirt/example-hook-sidecar:devel"}]' | ||
# Overwrite base board manufacturer name | ||
smbios.vm.kubevirt.io/baseBoardManufacturer: "Radical Edward" | ||
``` | ||
## Example | ||
```shell | ||
# Create a VM requesting the hook sidecar | ||
cluster/kubectl.sh create -f cluster/examples/hook-sidecar-consumer.yml | ||
|
||
# Once the VM is ready, connect to its display and login using name and password "fedora" | ||
cluster/virtctl.sh vnc vm-hook-sidecar-consumer | ||
|
||
# Install dmidecode | ||
sudo dnf install -y dmidecode | ||
|
||
# Check whether the base board manufacturer value was successfully overwritten | ||
sudo dmidecode -s baseboard-manufacturer | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.