From 5d90a6a8a9b4f1c8fe82982f2193bf6429b48320 Mon Sep 17 00:00:00 2001 From: "Michael N. Lipp" Date: Sun, 17 Nov 2024 12:21:16 +0100 Subject: [PATCH] Move test to tc1. --- dev-example/.gitignore | 1 + dev-example/config.yaml | 4 +- dev-example/gen-pool-vm-crds.sh | 47 +++++++++++++++++++++++ dev-example/test-vm.tpl.yaml | 67 +++++++++++++++++++++++++++++++++ 4 files changed, 117 insertions(+), 2 deletions(-) create mode 100755 dev-example/gen-pool-vm-crds.sh create mode 100644 dev-example/test-vm.tpl.yaml diff --git a/dev-example/.gitignore b/dev-example/.gitignore index 925478d..728072e 100644 --- a/dev-example/.gitignore +++ b/dev-example/.gitignore @@ -1 +1,2 @@ /test-vm-ci.yaml +/kubeconfig.yaml diff --git a/dev-example/config.yaml b/dev-example/config.yaml index af1f3b8..1c80ab8 100644 --- a/dev-example/config.yaml +++ b/dev-example/config.yaml @@ -7,8 +7,8 @@ "/Controller": namespace: vmop-dev "/Reconciler": - runnerData: - storageClassName: null + runnerDataPvc: + storageClassName: rook-cephfs loadBalancerService: labels: label1: label1 diff --git a/dev-example/gen-pool-vm-crds.sh b/dev-example/gen-pool-vm-crds.sh new file mode 100755 index 0000000..264e3ba --- /dev/null +++ b/dev-example/gen-pool-vm-crds.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +function usage() { + cat >&2 <&2 "Unknown option: $1"; exit 1;; + *) template="$1";; + esac + shift +done + +if [ -z "$template" ]; then + usage +fi + +if [ "$count" = "0" ]; then + exit 0 +fi +for number in $(seq 1 $count); do + if [ -z "$prefix" ]; then + prefix=$(basename $template .tpl.yaml) + fi + name="$prefix$number" + index=$(($number - 1)) + esh -o $destination/$name.yaml $template number=$number index=$index +done diff --git a/dev-example/test-vm.tpl.yaml b/dev-example/test-vm.tpl.yaml new file mode 100644 index 0000000..aa6f3d1 --- /dev/null +++ b/dev-example/test-vm.tpl.yaml @@ -0,0 +1,67 @@ +apiVersion: "vmoperator.jdrupes.org/v1" +kind: VirtualMachine +metadata: + namespace: vmop-dev + name: test-vm<%= ${number} %> + annotations: + argocd.argoproj.io/sync-wave: "20" + +spec: + image: +# repository: docker-registry.lan.mnl.de +# path: vmoperator/org.jdrupes.vmoperator.runner.qemu-arch +# pullPolicy: Always +# repository: ghcr.io +# path: mnlipp/org.jdrupes.vmoperator.runner.qemu-alpine +# version: "3.0.0" + source: registry.mnl.de/org/jdrupes/vm-operator/org.jdrupes.vmoperator.runner.qemu-arch:testing + pullPolicy: Always + + permissions: + - role: admin + may: + - "*" + - user: test + may: + - accessConsole + + guestShutdownStops: true + + cloudInit: {} + + vm: + # state: Running + bootMenu: true + maximumCpus: 4 + currentCpus: 2 + maximumRam: 4Gi + currentRam: 3Gi + + networks: + # No bridge on TC1 + # - tap: {} + - user: {} + + disks: + - volumeClaimTemplate: + metadata: + name: system + spec: + storageClassName: ceph-rbd3slow + dataSource: + name: test-vm-snapshot-1 + kind: VolumeSnapshot + apiGroup: snapshot.storage.k8s.io + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 40Gi + - cdrom: + image: "" + # image: https://download.fedoraproject.org/pub/fedora/linux/releases/38/Workstation/x86_64/iso/Fedora-Workstation-Live-x86_64-38-1.6.iso + + display: + spice: + port: <%= $((5910 + number)) %> + server: 192.168.179.20