This repository has been archived by the owner on Apr 1, 2024. It is now read-only.
forked from aglitke/ocm-kubevirt-samples
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add sample optimized for ramen test environment
This VM can be used to test DR flows in ramen minikube based test environment running on a laptop. Changes: - Use latest cirros (0.6.2) from my repo that will be customized for testing ramen[2] - Use executable userData since cirros does not support #cloud-config - Inject ssh public key from secret - Storage class used by ramen test environment - Use bridge interface (see issue[1]) - Separate pvc and source resources - Minimize memory allocation and disk size to make it easier to run with limited resources - Use common labels to apply appname= label to all resources [1] kubevirt/kubevirt#9059 [2] RamenDR/ramen#1105
- Loading branch information
Showing
4 changed files
with
99 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
resources: | ||
- source.yaml | ||
- pvc.yaml | ||
- vm.yaml | ||
commonLabels: | ||
appname: vm-standalone-dv-odr-regional |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: sample-vm-pvc | ||
spec: | ||
dataSourceRef: | ||
apiGroup: cdi.kubevirt.io | ||
kind: VolumeImportSource | ||
name: cirros-source | ||
accessModes: | ||
- ReadWriteMany | ||
resources: | ||
requests: | ||
storage: 128Mi | ||
storageClassName: rook-ceph-block | ||
volumeMode: Block |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
apiVersion: cdi.kubevirt.io/v1beta1 | ||
kind: VolumeImportSource | ||
metadata: | ||
name: cirros-source | ||
spec: | ||
source: | ||
registry: | ||
# Image customized for ramen testing. | ||
# TODO: Consume from ramendr repo when available. | ||
url: "docker://quay.io/nirsof/cirros:0.6.2" |
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 |
---|---|---|
@@ -0,0 +1,64 @@ | ||
apiVersion: kubevirt.io/v1 | ||
kind: VirtualMachine | ||
metadata: | ||
name: sample-vm | ||
spec: | ||
running: true | ||
template: | ||
metadata: | ||
annotations: | ||
vm.kubevirt.io/flavor: small | ||
vm.kubevirt.io/os: fedora | ||
vm.kubevirt.io/workload: server | ||
labels: | ||
kubevirt.io/size: small | ||
spec: | ||
domain: | ||
cpu: | ||
cores: 1 | ||
sockets: 1 | ||
threads: 1 | ||
devices: | ||
disks: | ||
- disk: | ||
bus: virtio | ||
name: rootdisk | ||
- name: cloudinit | ||
disk: {} | ||
interfaces: | ||
- macAddress: 02:69:36:00:00:00 | ||
bridge: {} | ||
model: virtio | ||
name: default | ||
networkInterfaceMultiqueue: true | ||
rng: {} | ||
features: | ||
acpi: {} | ||
machine: | ||
type: pc-q35-rhel8.6.0 | ||
resources: | ||
requests: | ||
# Match cirros-source memory requirements. | ||
# See https://github.com/cirros-dev/cirros/issues/53 | ||
memory: 256Mi | ||
evictionStrategy: LiveMigrate | ||
networks: | ||
- name: default | ||
pod: {} | ||
terminationGracePeriodSeconds: 180 | ||
accessCredentials: | ||
- sshPublicKey: | ||
source: | ||
secret: | ||
secretName: my-public-key | ||
propagationMethod: | ||
configDrive: {} | ||
volumes: | ||
- name: rootdisk | ||
persistentVolumeClaim: | ||
claimName: sample-vm-pvc | ||
- name: cloudinit | ||
cloudInitConfigDrive: | ||
userData: | | ||
#!/bin/sh | ||
echo "Running user-data script" |