Structure documentation.

This commit is contained in:
Michael Lipp 2023-06-06 14:31:38 +02:00
parent f788724881
commit ba7147ba0e
4 changed files with 18 additions and 27 deletions

View file

@ -6,22 +6,6 @@
The goal of this project is to provide the means for running Qemu
based VMs in Kubernetes pods.
The project was triggered by a remark in the discussion about RedHat
[dropping SPICE support](https://bugzilla.redhat.com/show_bug.cgi?id=2030592)
from the RHEL packages.
[One comment](https://bugzilla.redhat.com/show_bug.cgi?id=2030592#c4)
mentioned that the [KubeVirt](https://kubevirt.io/) project isn't
interested in supporting SPICE.
See the [project's home page](https://mnlipp.github.io/VM-Operator/)
for details.
Time to have a look at alternatives. Libvirt has become a common
tool to configure and run Qemu. But some of its functionality, notably
the management of storage for the VMs and networking is already provided
by Kubernetes. Therefore this project takes a fresh approach of
running Qemu in a pod using a simple, lightweight manager called "runner".
The runner makes use of the Kubernetes features for resource management as
much as possible.
The project does in no way attempt to replace kubevirt. Its goal is
to provide a simple solution for the use case of running a virtual
machine in a common configuration in a Kubernetes cluster.

View file

@ -53,12 +53,15 @@ import org.jgrapes.util.events.WatchFile;
/**
* A component that handles the communication over the Qemu monitor
* socket.
*
* If the log level for this class is set to fine, the messages
* exchanged on the monitor socket are logged.
*/
public class QemuMonitor extends Component {
@SuppressWarnings({ "PMD.FieldNamingConventions",
"PMD.VariableNamingConventions" })
private static final Logger monitorLog
private static final Logger logger
= Logger.getLogger(QemuMonitor.class.getName());
@SuppressWarnings("PMD.UseConcurrentHashMap")
@ -165,7 +168,7 @@ public class QemuMonitor extends Component {
}
private void writeToMonitor(String message) {
monitorLog.fine(() -> "monitor(out): " + message);
logger.fine(() -> "monitor(out): " + message);
monitorChannel.associated(Writer.class).ifPresent(writer -> {
try {
writer.append(message).append('\n').flush();
@ -194,7 +197,7 @@ public class QemuMonitor extends Component {
private void processMonitorInput(String line)
throws IOException {
monitorLog.fine(() -> "monitor(in): " + line);
logger.fine(() -> "monitor(in): " + line);
try {
var response
= ((Runner) channel()).mapper().readValue(line, JsonNode.class);

View file

@ -72,15 +72,12 @@ import org.jgrapes.util.events.InitialConfiguration;
import org.jgrapes.util.events.WatchFile;
/**
* The Runner is responsible for manageing the Qemu process and
* optionally a process that emulates a TPM (software TPM). It
* it's function is best described by a state diagram.
* The Runner is responsible for managing the Qemu process and
* optionally a process that emulates a TPM (software TPM). It's
* main function is best described by the following state diagram.
*
* ![Runner state diagram](RunnerStates.svg)
*
* If the log level for `org.jdrupes.vmoperator.runner.qemu.monitor`
* is set to fine, the messages exchanged on the monitor socket are logged.
*
* @startuml RunnerStates.svg
* [*] --> Initializing
* Initializing -> Initializing: InitialConfiguration/configure Runner

View file

@ -0,0 +1,7 @@
A Kubernetes operator for running VMs as pods.
VM-Operator
===========
The VM-operator is built on the [JGrapes](https://mnlipp.github.io/jgrapes/)
event driven framework.