aland-zhang / kubevirt-manager

Kubevirt Web UI / Web Interface Manager

Home Page:https://kubevirt-manager.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

kubevirt-manager

Maintainers: feitnomore

Simple Angular Frontend Web UI Interface to operate Kubevirt. This tools lets you perform basic operations around Virtual Machines, Virtual Machine Instances, and Disks. It was built based on requirements I had for my own environment.

WARNING: Use it at your own risk.

INTRODUCTION

I've created this Frontend for KubeVirt while I was trying to learn a little bit of Angular. Basically this tool uses kubectl proxy to proxy API requests to kubeapiserver. To handle the Disk/Volume part, the tool works through CDI.

REQUIREMENTS

Kubevirt featureGate ExpandDisks is required.

CDI is required with featureGate HonorWaitForFirstConsumer active:

  config:
    featureGates:
    - HonorWaitForFirstConsumer

StorageClass features WaitForFirstConsumer and allowVolumeExpansion are required:

volumeBindingMode: WaitForFirstConsumer
allowVolumeExpansion: true

HOW TO INSTALL IT

Create the Namespace

$ kubectl apply -f kubernetes/ns.yaml

Create the Service Account and RBAC

$ kubectl apply -f kubernetes/rbac.yaml

Create the FrontEnd Deployment

$ kubectl apply -f kubernetes/deployment.yaml

Create the Priority Classes

$ kubectl apply -f kubernetes/pc.yaml

Create the FrontEnd Service

kubectl apply -f kubernetes/service.yaml

PROMETHEUS INTEGRATION

To integrate kubevirt-manager with prometheus, you need to edit kubernetes/prometheus-config.yaml and adjust your endpoint on line 21. After adjusting the endpoint, apply the configmap:

$ kubectl apply -f kubernetes/prometheus-config.yaml

This integration was tested using prometheus-operator. A ServiceMonitor descriptor to integrate KubeVirt with prometheus-operator has been provided as an example at kubernetes/servicemonitor.yaml. Note that you need to set the namespace on the ServiceMonitor accordingly and you need to update your KubeVirt resource to reflect the namespace as well:

spec:
  monitorNamespace: monitoring

Note: The tool assumes Prometheus is exposing the following metrics: kubevirt_vmi_storage_write_traffic_bytes_total, kubevirt_vmi_storage_read_traffic_bytes_total, kubevirt_vmi_network_transmit_bytes_total, kubevirt_vmi_network_receive_bytes_total, kube_pod_container_resource_requests and kubevirt_vmi_memory_domain_total_bytes. These metrics are exposed by KubeVirt and kube-state-metrics.

HOW TO USE IT

To use the tool, you can either use kubectl port-forward on port 8080, use a Service with type NodePort or LoadBalancer, or, create an Ingress for your service.
Note: As the tool needs Websocket support, if you are using an Ingress make sure you set it up accordingly.

Screenshot

Dashboard:

Virtual Machines:

Node Pools:

Instance Types & Network:

Data Volumes & Load Balancers:

VNC Screen

Building

To build the tool simply run:

docker build -t your-repo/kubevirt-manager:version .
docker push your-repo/kubevirt-manager:version

Building & Running Locally

To build the tool run:

npm install
ng build

To run the tool:

kubectl proxy --www=./dist/kubevirtmgr-webui/ --accept-hosts=^.*$ --address=[::] --api-prefix=/k8s/ --www-prefix=

Access the tool at: http://localhost:8001/

Note: Make sure your kubectl is pointing to the right cluster.
Note: Make sure the account your kubectl is using has correct RBAC.
Note: This method doesn't support Prometheus integration.

References

  1. Kubernetes
  2. Kubectl
  3. CDI
  4. KubeVirt
  5. NodeJS
  6. Angular
  7. AdminLTE
  8. NoVNC
  9. Prometheus Operator
  10. kube-state-metrics
  11. KubeVirt Monitoring

License

kubevirt-manager is licensed under the Apache Licence, Version 2.0.

About

Kubevirt Web UI / Web Interface Manager

https://kubevirt-manager.io

License:Apache License 2.0


Languages

Language:JavaScript 89.4%Language:CSS 6.2%Language:TypeScript 3.5%Language:HTML 0.9%Language:Dockerfile 0.0%Language:Shell 0.0%