Introduction to KSV
KubeSphere Virtualization (KSV) is a lightweight virtual machine management platform that supports single-node and multi-node deployment, and is easy to use. KSV adopts a separated front-end and back-end architecture to realize a cloud-native design. Each module is loosely coupled. As an enterprise-level virtualization platform, KSV provides an easy-to-use web console to help users quickly realize the virtualization of enterprise hardware resources.
Official website: https://kubesphere.cloud/ksv/
The underlying principle of KSV
The bottom layer of KSV is based on technologies such as K3S
, , Kubevirt
and rook ceph
, and the underlying principles are described in the following table:
name | describe |
---|---|
virtual machine | The bottom layer of KSV uses the KubeVirt plug-in to support lifecycle management, state management and connection management of virtual machines. |
network | The bottom layer of KSV uses the Multus plug-in to create MacVTap (a device driver for simplifying virtualized bridged networks) on the node network card as the network card of the virtual machine. By setting the IP pool, the virtual machine can be in the same network segment as the server node, which is convenient for users to access. |
mirror image | The bottom layer of KSV uses the CDI plug-in to import the image into the persistent volume, and realizes the creation of the system disk through the cloning of the persistent volume. |
storage | KSV supports linkage with Kubernetes' CSI plug-in to manage storage-related resources. |
Product Architecture Diagram:
KSV installation
prerequisites:
- The operating system version of the server node needs to be Ubuntu 18.04 / Ubuntu 20.04, CentOS 7.9 / CentOS 8.5. Other operating systems have not been fully tested, and there may be unknown problems. More operating systems will be supported in the future.
- Minimum hardware configuration
4 核/8 GB/系统磁盘100GB
, recommended configuration8 核/16 GB/系统磁盘100 GB
- A server node must additionally have at least 1 unformatted and unpartitioned disk, or 1 unformatted partition. The minimum configuration for this disk or partition is 100 GB, and the recommended configuration is 200 GB. For rook ceph osd.
- Server nodes need to support virtualization. If the server node does not support virtualization, KSV will run in emulated mode. This mode will consume more resources and may affect performance. If you choose vmware vsphere, vmware workstation, or virtualbox virtual machine, you need to enable the nested virtualization function, and it is recommended to deploy on bare metal in the production environment.
Install KSV:
Prepare an Ubuntu 20.04 operating system and use a single-node installation method.
1. Execute the following command to download the installation package (the size of the installation package is about 3.7 GB):
curl -OL https://virtualization.kubesphere.cloud/v1.4.0/kubesphere-virtualization-amd64-v1.4.0.tar.gz
2. Execute the following command to decompress the installation package:
tar -zxvf kubesphere-virtualization-amd64-v1.4.0.tar.gz
3. Execute the following command to enter the directory generated after decompression of the installation package:
cd kubesphere-virtualization-amd64
4. Execute the following command to start the installation:
./install.sh -a --ratio <超卖比>
The parameter --ratio is optional and is used to specify the oversold ratio of the KSV cluster, which can be an integer from 1 to 4. If the --ratio parameter is not set, the oversold ratio defaults to 2.
The oversold ratio will determine the total number of virtual machines that KSV can create. The total number of virtual machines that can be created = total number of cluster CPU cores x oversold ratio.
5. If the following information is displayed, the installation is successful:
#####################################################
### Welcome to KubeSphere Virtualization! ###
#####################################################
Console: http://172.16.0.59:30880
Username: admin
Password: P@88w0rd
NOTE:
Please change the default password of the admin user
after login.
#####################################################
https://kubesphere.cloud/ksv/ 2021-04-29 14:03:45
#####################################################
View cluster node information, run k3s and containerd at the bottom
root@ubuntu:~# kubectl get nodes -o wide
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
ubuntu Ready control-plane,master,worker 13h v1.21.6+k3s1 192.168.72.14 <none> Ubuntu 20.04.4 LTS 5.4.0-113-generic containerd://1.4.11-k3s1
View the created Pods, running kubevirt, rook-ceph, prometheus, calico and other components at the bottom
root@ubuntu:~/kubesphere-virtualization-amd64# kubectl get pods -A
NAMESPACE NAME READY STATUS RESTARTS AGE
cdi cdi-apiserver-6fd8c49c78-rsdcp 1/1 Running 0 7m6s
cdi cdi-deployment-7c98f568cf-sbds5 1/1 Running 0 7m
cdi cdi-operator-745df7d6f7-zv7pz 1/1 Running 0 7m48s
cdi cdi-uploadproxy-7f644f8cd4-8f2vc 1/1 Running 0 6m56s
default importer-img-zelkv348 0/1 Pending 0 5m
kube-system calico-kube-controllers-5544f8d8d9-v8sn2 1/1 Running 0 13m
kube-system calico-node-ldrzj 1/1 Running 0 13m
kube-system coredns-7448499f4d-sv89f 1/1 Running 0 13m
kube-system kube-multus-ds-amd64-cmrxs 1/1 Running 0 7m51s
kubekey-system kubekey-controller-manager-8b6fbfff5-tcvlj 2/2 Running 0 13m
kubesphere-controls-system default-http-backend-6c6cb9b454-bvfp7 1/1 Running 0 8m23s
kubesphere-controls-system kubectl-admin-86995f5c5-rkrh6 1/1 Running 0 5m
kubesphere-monitoring-system alertmanager-main-0 2/2 Running 0 5m45s
kubesphere-monitoring-system kube-state-metrics-5b9cfc944d-77dwg 3/3 Running 0 5m55s
kubesphere-monitoring-system node-exporter-svknb 2/2 Running 0 5m56s
kubesphere-monitoring-system notification-manager-deployment-57cfc676d8-ghcrl 1/1 Running 0 5m13s
kubesphere-monitoring-system notification-manager-operator-94f799b96-bxvbp 2/2 Running 0 5m21s
kubesphere-monitoring-system prometheus-k8s-0 3/3 Running 1 5m51s
kubesphere-monitoring-system prometheus-operator-68c489748c-jnmj9 2/2 Running 0 5m58s
kubesphere-system ftp-server-6dbf5bff55-c9sgh 1/1 Running 0 7m50s
kubesphere-system ks-apiserver-5bf4bbc657-m7n6q 1/1 Running 0 4m57s
kubesphere-system ks-console-58cf78bb45-9w52f 1/1 Running 0 8m10s
kubesphere-system ks-controller-manager-59fd54bdb8-94jnx 1/1 Running 0 4m57s
kubesphere-system ks-installer-c45748b6f-t6xlx 1/1 Running 0 13m
kubesphere-system minio-576546f95d-rd4mq 1/1 Running 0 11m
kubesphere-system sync-images-job-hxxs8 0/1 Completed 0 7m51s
kubesphere-virtualization-system express-network-agent-79l5t 1/1 Running 0 7m39s
kubesphere-virtualization-system express-network-controller-6c9bd5577c-rtv7m 1/1 Running 0 7m39s
kubevirt virt-api-5c5498b8f4-h4nq4 1/1 Running 0 6m45s
kubevirt virt-api-5c5498b8f4-w5sxg 1/1 Running 0 6m47s
kubevirt virt-controller-64cc9949b8-6ghh5 1/1 Running 0 6m20s
kubevirt virt-controller-64cc9949b8-sd98r 1/1 Running 0 6m19s
kubevirt virt-handler-x5hn7 1/1 Running 0 6m20s
kubevirt virt-operator-74fc8b4f97-6fjqs 1/1 Running 0 7m49s
rook-ceph csi-rbdplugin-provisioner-76d45b5b57-lt7vn 6/6 Running 0 11m
rook-ceph csi-rbdplugin-rmw58 3/3 Running 0 11m
rook-ceph rook-ceph-crashcollector-ubuntu-d575979d4-drl2k 1/1 Running 0 10m
rook-ceph rook-ceph-mgr-a-c7bf4b69b-jvrj4 1/1 Running 0 10m
rook-ceph rook-ceph-mon-a-86cc8985f7-z9jdg 1/1 Running 0 11m
rook-ceph rook-ceph-operator-6457f8c765-cdx82 1/1 Running 0 12m
rook-ceph rook-ceph-osd-0-5b9d4bfc56-67598 1/1 Running 0 10m
rook-ceph rook-ceph-osd-prepare-ubuntu-wt8jq 0/1 Completed 0 10m
rook-ceph rook-ceph-tools-568c5cddd5-fmxtt 1/1 Running 0 12m
rook-ceph rook-discover-hd496 1/1 Running 0 11m
rook-ceph snapshot-controller-0 1/1 Running 0 12m
KSV creates a virtual machine
1. Create a new IP pool, in which the network card name and network segment need to be consistent with the cluster nodes
2. Upload the image
It comes with ubuntu 20.04 by default, here upload Ubuntu 22.04 LTS cloud image LTS and windows server 2022 image:
3. Create the following virtual machines
4. View the linux virtual machine
Install nginx on the unbut virtual machine
apt update -y
apt install -y nginx
systemctl status nginx
The IP address of the virtual machine can be directly accessed outside the cluster
5. Windows virtual machine creation process
Select the image:
select to load the driver,
select the driver, and
start installing
VNC to log in to windwos server 2022