Giter VIP home page Giter VIP logo

kubevirt-manager's Introduction

kubevirt-manager.io

Website: kubevirt-manager.io
Maintainers: feitnomore
Feedback/Feature Request: form

Simple Angular Frontend Web UI Interface to operate Kubevirt. This tools lets you perform basic operations around Virtual Machines, Virtual Machine Instances, Virtual Machine Pools and Disks. As the tool grew, other features got added like Load Balancing, Auto Scaling, Monitoring and Cluster API support. This tool was built initially based on requirements I had for my own environment at home and started growing as needed.
For a Quick Start, go to our website https://kubevirt-manager.io/

If you are using the tool, please help us by providing feedback here.

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. As the time passed by, support for other features like HPA, Services, Prometheus and Cluster API were added.
For a Quick Start, go to our website https://kubevirt-manager.io/ as we provide a bundled.yaml file that has the basic setup.

REQUIREMENTS

These are the minimum requirements to have the system running.
Kubevirt featureGate ExpandDisks is required.

CDI is required with featureGate HonorWaitForFirstConsumer active:

  config:
    featureGates:
    - HonorWaitForFirstConsumer

StorageClass feature allowVolumeExpansion is required:

allowVolumeExpansion: true

If you are using hostpath-provisioner or any other local node storage, you will need to use WaitForFirstConsumer:

volumeBindingMode: WaitForFirstConsumer

Note: These settings are required to work with a hostpath csi driver, in order to prevent virtual machine instances from being started in a node different from the node in which the disk/volume resides.

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

You will need to restart (delete) the Pod or redeploy the solution for the changes to take effect.

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.
Note: Due to the introduction of NGINX Authentication support, the configmap changed a bit, make sure you review it.

CLUSTER-API INTEGRATION

To use kubevirt-manager with cluster-api-provider for KubeVirt you must install Cluster API.
Check Cluster API Introduction for more information.
Feature ClusterResourceSet is required by the tool to automate CNI and Add-ons fuctionality on Standard clusters. Either enable it before installing Cluster API by following the documentation on ClusterResourceSet and export EXP_CLUSTER_RESOURCE_SET=true before running clusterctl generate, or enable it by adding ClusterResourceSet=true to the feature-gates argument line of your already running capi-controller-manager Deployment. Don't forget to wait for capi-controller-manager pods to restart or restart it manually if needed. The following can be done with a command like the below:

$ kubectl edit -n capi-system deployment.apps/capi-controller-manager

Note: Pre-baked images are provided from kubevirt-manager.online domain.
Note: Pre-baked images were created using image-builder project.
Note: Pre-baked images have qemu-guest-agent pre installed to provide instance details on dashboard.
Note: CNI files are also provided from kubevirt-manager.online domain.
Note: CNI files were mostly generated from original Helm Charts using helm template.
Note: CNI files have some value substituion before applying to the cluster in order to support user customization.
Note: The supported CNIs can be found here.
Note: Features are also provided as YAML files from kubevirt-manager.online domain.
Note: Features files were mostly generated from original Helm Charts using helm template.
Note: The supported features can be found here.

NGINX AUTHENTICATION

To add nginx with basic-auth, you need to edit kubernetes/auth_secret.yaml and add your htpasswd file contents in base64 to the secret. The provided example has a single entry which username is admin and password is admin. You are encouraged to create your own file and replace in the secret.
An example of how to get the base64 of your file is:

$ cat htpasswd-file | base64 -w0

After adjusting secret contents, apply the configmap and the secret:

$ kubectl apply -f kubernetes/auth-config.yaml
$ kubectl apply -f kubernetes/auth-secret.yaml

You will need to restart (delete) the Pod or redeploy the solution for the changes to take effect.

Note: If you had previous versions of Prometheus integration make sure proxy_set_header Authorization ""; is present on your Prometheus ConfigMap. You may use kubernetes/prometheus-config.yaml as a reference to make sure your ConfigMap looks ok.
Note: You may also want to check htpasswd documentation for extra help on creating and managing the file.

HOW TO USE IT

The recommended way to use this tool is through an Ingress or a Service.
You can also use kubectl port-forward on port 8080.

Note: As the tool needs Websocket support, if you are using an Ingress make sure you set it up accordingly.

Screenshots

To optimize the load of the main repo README, screenshots were removed from here. To see the screenshots, visit images directory.

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

Please clone noVNC:

cd src/assets/
git clone https://github.com/novnc/noVNC.git

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 like websocket VNC.
Note: This method doesn't support Prometheus integration.
Note: This method doesn't support NGINX basic_auth.

Testing

The tests implemented are pretty simple so far. To run the tests, simply execure:

npm test

References

  1. kubevirt-manager.io
  2. Kubernetes
  3. Kubectl
  4. CDI
  5. KubeVirt
  6. NodeJS
  7. Angular
  8. AdminLTE
  9. NoVNC
  10. Prometheus Operator
  11. kube-state-metrics
  12. KubeVirt Monitoring
  13. NGINX basic_auth
  14. Kubernetes Cluster API Provider for Kubevirt
  15. Cluster API Quick Start
  16. ClusterResourceSet
  17. image-builder
  18. capk-versions.json
  19. cni-versions.json
  20. features.json

License

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

kubevirt-manager's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

kubevirt-manager's Issues

Add different types of DV support

As requested on #56 , besides being able to select a DV as Template for VM, on the DV Screen we may need to add options for creating DVs like we have on New VM Screen and New VM Pool screen.

After a few minutes the page shows a 404 error

After the deployment is complete, the console page of kubevirt-manage can be accessed normally, but after a few minutes, there will be a 404 error and cannot be accessed. I have to close the current page and reopen it.
image

image

And I found that the virtual machine cannot be created through Virtual Machines, VM Pools is blank. Cannot add anything in Data Volumes and Instance type. Where am I going wrong?

Need to support sending Ctrl+Alt+Del and other shortcut keys

The current functionality of VNC Viewer is too simple. It needs to at least support sending some common shortcut keys (e.g. Ctrl+Alt+Del) to meet daily work needs, such as accessing Windows servers, without the ability to send Ctrl+Alt+Del, it is impossible to login the system. I sincerely hope that the next version can support sending common shortcut keys. It would be even better if more features such as power on/off and clipboard support can be added in the future.

https://github.com/novnc/noVNC/blob/master/docs/API.md

Datavolume CR is disappeared.

Hi, Thanks for your awesome GUI tool :)
I've been looking for GUI tool with non integration with openShift.

One small thing is that DataVolume resource doesn't exist anymore.
It's just used to make PVC resource and after done making PVC, DataVolume resource is disappeared.

So, there is no any DataVolume resource in kubevirt-manager.

Please help :)

readwritemany as default option for pvc

hi

great tool! my one problem is

my vm pool wont spin up due to the pvc's being readwriteonce. can we have an option to change this when creating a vmpool or set it as default to readwritemany?

NoVNC Connection Error.

I am attempting to access a VM console using kubevirt-manager's NoVNC client. However I consistently get errors when trying to connect.

image

I'm really not sure where to start looking to debug the issue. Any guidance would be much appreciated.

cloud-config templates

it would be nice to have a list of stored cloud-configs that you could select from when creating a new vm.

I cannot get the prometheus data into the manager UI

I can see the logs in the prometheus instance so the service monitor is working and I applied the prometheus.yml with the below configuration. I have my prometheus in a monitoring namespace with the services below. Everythings coming up but the metrics are not showing in the dashboard

NAME                    TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)                      AGE
alertmanager-main       ClusterIP   10.110.103.180   <none>        9093/TCP,8080/TCP            63m
alertmanager-operated   ClusterIP   None             <none>        9093/TCP,9094/TCP,9094/UDP   63m
blackbox-exporter       ClusterIP   10.98.252.194    <none>        9115/TCP,19115/TCP           63m
grafana                 ClusterIP   10.111.166.151   <none>        3000/TCP                     63m
kube-state-metrics      ClusterIP   None             <none>        8443/TCP,9443/TCP            63m
node-exporter           ClusterIP   None             <none>        9100/TCP                     63m
prometheus-adapter      ClusterIP   10.110.134.89    <none>        443/TCP                      63m
prometheus-k8s          ClusterIP   10.110.21.127    <none>        9090/TCP,8080/TCP            63m
prometheus-operated     ClusterIP   None             <none>        9090/TCP                     63m
prometheus-operator     ClusterIP   None             <none>        8443/TCP                     63m

apiVersion: v1
kind: ConfigMap
metadata:
  name: prometheus-config
  namespace: kubevirt-manager
  labels:
    app: kubevirt-manager
    kubevirt-manager.io/version: 1.3.3
    kubevirt-manager.io/managed: "true"
data:
  prometheus.conf: |
    location /api {
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Authorization "";
        proxy_pass_request_body on;
        proxy_pass_request_headers on;
        client_max_body_size 5g;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
        proxy_pass http://prometheus-k8s.monitoring.svc:9090;
    }

Logs from the kubevirt-manager:

k logs -n kubevirt-manager kubevirt-manager-74c64cfc6-r75l2 
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: can not modify /etc/nginx/conf.d/default.conf (read-only file system?)
/docker-entrypoint.sh: Sourcing /docker-entrypoint.d/15-local-resolvers.envsh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/91-startkubectl.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2024/04/22 17:09:00 [warn] 1#1: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:2
nginx: [warn] the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:2
2024/04/22 17:09:00 [warn] 1#1: duplicate MIME type "text/html" in /etc/nginx/conf.d/gzip.conf:32
nginx: [warn] duplicate MIME type "text/html" in /etc/nginx/conf.d/gzip.conf:32
2024/04/22 17:09:00 [notice] 1#1: using the "epoll" event method
2024/04/22 17:09:00 [notice] 1#1: nginx/1.25.4
2024/04/22 17:09:00 [notice] 1#1: built by gcc 12.2.1 20220924 (Alpine 12.2.1_git20220924-r10) 
2024/04/22 17:09:00 [notice] 1#1: OS: Linux 5.14.0-362.18.1.el9_3.x86_64
2024/04/22 17:09:00 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2024/04/22 17:09:00 [notice] 1#1: start worker processes
2024/04/22 17:09:00 [notice] 1#1: start worker process 29
2024/04/22 17:09:00 [notice] 1#1: start worker process 30
2024/04/22 17:09:00 [notice] 1#1: start worker process 31
2024/04/22 17:09:00 [notice] 1#1: start worker process 32
2024/04/22 17:09:00 [notice] 1#1: start worker process 33
2024/04/22 17:09:00 [notice] 1#1: start worker process 34
2024/04/22 17:09:00 [notice] 1#1: start worker process 36
2024/04/22 17:09:00 [notice] 1#1: start worker process 37
2024/04/22 17:09:00 [notice] 1#1: start worker process 38
2024/04/22 17:09:00 [notice] 1#1: start worker process 39
2024/04/22 17:09:00 [notice] 1#1: start worker process 40
2024/04/22 17:09:00 [notice] 1#1: start worker process 41
2024/04/22 17:09:00 [notice] 1#1: start worker process 42
2024/04/22 17:09:00 [notice] 1#1: start worker process 43
2024/04/22 17:09:00 [notice] 1#1: start worker process 44
2024/04/22 17:09:00 [notice] 1#1: start worker process 48
2024/04/22 17:09:00 [notice] 1#1: start worker process 50
2024/04/22 17:09:00 [notice] 1#1: start worker process 52
2024/04/22 17:09:00 [notice] 1#1: start worker process 53
2024/04/22 17:09:00 [notice] 1#1: start worker process 54
2024/04/22 17:09:00 [notice] 1#1: start worker process 55
2024/04/22 17:09:00 [notice] 1#1: start worker process 57
2024/04/22 17:09:00 [notice] 1#1: start worker process 58
2024/04/22 17:09:00 [notice] 1#1: start worker process 59
2024/04/22 17:09:00 [notice] 1#1: start worker process 60
2024/04/22 17:09:00 [notice] 1#1: start worker process 61
2024/04/22 17:09:00 [notice] 1#1: start worker process 62
2024/04/22 17:09:00 [notice] 1#1: start worker process 63
2024/04/22 17:09:00 [notice] 1#1: start worker process 64
2024/04/22 17:09:00 [notice] 1#1: start worker process 65
2024/04/22 17:09:00 [notice] 1#1: start worker process 66
2024/04/22 17:09:00 [notice] 1#1: start worker process 67
2024/04/22 17:09:00 [notice] 1#1: start worker process 68
2024/04/22 17:09:00 [notice] 1#1: start worker process 69
2024/04/22 17:09:00 [notice] 1#1: start worker process 70
2024/04/22 17:09:00 [notice] 1#1: start worker process 71
2024/04/22 17:09:00 [notice] 1#1: start worker process 72
2024/04/22 17:09:00 [notice] 1#1: start worker process 73
2024/04/22 17:09:00 [notice] 1#1: start worker process 74
2024/04/22 17:09:00 [notice] 1#1: start worker process 75
2024/04/22 17:09:00 [notice] 1#1: start worker process 76
2024/04/22 17:09:00 [notice] 1#1: start worker process 77
2024/04/22 17:09:00 [notice] 1#1: start worker process 78
2024/04/22 17:09:00 [notice] 1#1: start worker process 79
2024/04/22 17:09:00 [notice] 1#1: start worker process 80
2024/04/22 17:09:00 [notice] 1#1: start worker process 81
2024/04/22 17:09:00 [notice] 1#1: start worker process 82
2024/04/22 17:09:00 [notice] 1#1: start worker process 83
Starting to serve on [::]:8001

Create new vm from Datavolume

When I try to create a new VM using a datavolume there are no volumes available in the UI. I have 2 "local" templates that I would like to select to clone the new VMs disk from.

here is an example how I do this currently (these are visible in the DataVolumes screen)

dataVolumeTemplates: - metadata: name: vm1-disk0 spec: pvc: accessModes: - ReadWriteMany resources: requests: storage: 30Gi storageClassName: netapp-nas source: pvc: namespace: vm-templates name: debian12-genericcloud-qcow2

HTTP 404 when reloading page

There is a bug with NGINX config that presents 404 page when you hit reload.
Nginx needs to have config updated to:

    location / {
        # Fix 404s on Single Page Application
        try_files $uri $uri/ /index.html;
        include /etc/nginx/auth.d/*.conf;
    }

LoadBalancer `Target Resource` options not populated unless other fields toggled first

First of all, thanks so much for making this project, it's been a fantastic tool for my home-lab as well as for showing off Kubevirt's features to friends and colleagues!

The issue I'm seeing is that when creating a LoadBalancer with the goal of attaching it to an existing VM, the Target Instance field is unpopulated until another option is toggled (changing the namespace for example). Once the toggle action has been performed though, everything works as expected.

Here is a short video of the issue:

Screen.Recording.2023-12-03.at.14.33.56.mov

Cheers!

datavolumes are not displayed on /dsklist page

I can see on the dashboard page that I have 13 datavolumes but there are none displayed when I click the "More Info" button for /dsklist.

cdi v1.58.1
kubevirt v1.2.0-rc1
rke2 v1.27.8

I do have data on vms, nodes, networks as expected. I was able to create a new empty datavolume successfully but this also did not show in the dsklist

I do have ExpandDisks and HonorWaitForFirstConsumer featureGates enabled. My storage classes has the allowVolumeExpansion set to true.

[BUG] Memory Metrics

Seems like prometheus metrics for Memory has changed at some point in time. Code was developed with kubevirt_vmi_memory_domain_total_bytes and tested against 0.57, however on 0.58 looks like the metric is kubevirt_vmi_memory_domain_bytes_total.

Issue when creating Load Balancer

Drop downs doesn't seem to be working correctly. I need to test them better and make sure everything works fine.
Also, there may be possibilities to include a few new options.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.