Install KubeOps Virtualisation on a Dedicated Machine

This guide describes how to set up virtualization using KubeOps automatic install routines. The setup takes place on a physical or virtual machine and runs automatically - only a few settings are required by the user. An ISO file is booted on the machine to set up a simple cluster with a corresponding node.

The virtualization software kubevirt and additional KubeOps products, such as KOSI package manager, are automatically installed on the node.

When the guide is carried out successfully, we have the following system:

  • one cluster
  • one running node (the node is admin and worker at the same time)
  • one virtual machine ubuntu vm running in the namepsace kubevirt
  • the vm runs the preconfigured ubuntu image

The ubuntu image is preconfigured with a username and a corresponding password.

Requirements

To follow the next steps, make sure you have your credentials ready from your KubeOps.net account and your Red Hat Subscription-Manager account.

For more information about Red Hat Subscription-Manager, refer Red Hat Online Documentation.

System Requirements

You can install the ISO on a physical machine or a virtual machine. Ensure that the machine supports the minimum system requirements.

CPU 4x
Memory 8 GB
Disk space 50 GB(unformatted non-partitioned disk storage)

Step 1 - Download the KubeOps-VM ISO File

Download the ISO file from https://kubeops.net/users-only/welcome.

Step 2 - Install the KubeOps-VM ISO

You will be prompted to make settings during the installation. Follow the instructions on the screen and enter the desired values.

  1. Boot your machine with the ISO.
  2. To start the installation, select “Install Red Hat Enterprise”.

  1. Select the hard disk where the ISO is to be installed.

  1. Configure the networking.
  • Select your preferred networking device.
  • Select whether the IP is dynamic or static.
  • Enter the IP address.
  • Enter the subnet mask address.
  • Enter the gateway address.
  • Enter the DNS server address.
  • Enter your preferred hostname. This will be the name of the machine. (no special characters)

  1. Select your preferred activation method for the Red Hat Subscription-Manager.

  2. Select your preferred security method for the grub bootloader. We recommend the option “random password” - this will set up the security automatically. For more information about the grub bootloader and its security, refer to the respective documentation.

  3. Enter your KubeOps.net account credentials.

  4. To finish the installation, follow the instructions on the screen.

Step 3 - Login to the Master Node on the Cluster

During setup using an ISO file, the master node was automatically preconfigured with a user (root) and its password.

User ko-admin
Password KubeOps2024
  1. Log in to the master node remotely. For example, using ssh. The first time you log in, you must use the preconfigured password (see above). Use the hostname or the IP address that you assigned in a previous step during the installation.
ssh ko-admin@[HOSTNAME]

or

ssh ko-admin@[IP ADDRESS]
  1. After logging in, you will be asked to change the user password. Follow the instructions on the screen. After changing the password, you will be automatically logged out.

  2. Login to the machine again using your new credentials.

  3. Most kubeops software needs root privileges. Switch to root user.

sudo -i
  1. To check the state of background configuration, run the journalctl command.
journalctl -u clustersetup.service

Keep the view open.

Check your kubeops virtualisation by using the kubectl get pods command.

kubectl get pods -n kubevirt

The installation is complete when the status of all pods is set to “Running”. For example:

Note: The Pods in the namespace kubevirt are now in a Pending state. You can either join worker nodes according to our guide How to join Nodes to a KubeOps Cluster or run the command kubectl taint node kubevirt node-role.kubernetes.io/control-plane- in order to remove the control-plain taint.

  1. To change the password of the root user, run the passwd command.
passwd

Step 4 - Install the example VM

  1. Login to the machine using your new credentials.
  2. Most kubeops software needs root privileges. Switch to root user.
sudo -i
  1. you need to create values for your machines:
ubuntuvmValues:
  name: ubuntu-vm
  namespace: kubevirt-vm 
  sshkeys:
    - key: <public ssh key, p.e. id_rsa.pub file>
  dataVolume:
    storageClassName: rook-cephfs
    source:
      secret: kubeops-auth

in this example these values are saved in the vmvalues.yaml file.

  1. Make sure you are still logged in to KOSI using your kosi username. The login is only active for 24h, after that time you need to login again.
kosi login -u [USERNAME]
  1. Use the KOSI package manager to search for available software packages. In this case, we restrict the search to KubeOps virtualization using the hub kubeops-vm and filter for ubuntu.
kosi search --hub kubeops-vm --ps ubuntu

  1. The example vm configuration is named kubevirt-ubuntu-vm. Install the package using the kosi install command.
kosi install --hub kubeops-vm kubeops/kubevirt-ubuntu-vm:1.0.0 -f vmvalues.yaml --dname ubuntu

you need to create a custom secret for that:

kubectl create secret generic kubeops-auth --from-literal=accessKeyId=<kubeopsaccount> --from-literal=secretKey="<password-token for imagepullregistry> --namespace <namespace of vm>

note: the password token is not the password directly, if the registry is connected with oicd, p.e. with keycloak.

if you want to install kubevirt in an airgap environment, then you need to have a domain address for harbor, a ip address with port address does not work. Copying the images to the corresponding nodes and loading them with containerd does not work. also you maybe need to create a secret with the name kubeops-vm, it has the same values as the kubeops-auth created by the kubeops plattform tools like rook-ceph. otherwise you can create it with the following command:

kubectl -n kubevirt create secret docker-registry kubeops-vm --docker-server=<registry for image pulling> --docker-username=<username of registry> --docker-password=<password-token for imagepullregistry>

Step 7 - Access the Example VM

You can access the example vm remotely from the master node. For example, using ssh.

  1. Login to the machine using your new credentials.
  2. Identify the IP address of your example vm by using the kubectl get vmi command.
kubectl get vmi -A

This command lists all virtual machine instances. Since we only have one VM installed, the output looks something like this.

NAMESPACE   NAME         AGE   PHASE     IP              NODENAME       READY

kubevirt    ubuntu-vm   22h   Running   192.168.16.48   stackedadmin   True
  1. Log in to the example vm remotely (e.g. using ssh). Use the IP address from the previous step. Use the credentials of the running ubuntu image from the table below.
ssh ubuntu@192.168.16.48
User (ubuntu image) ubuntu
Password (ubuntu image) ubuntu

Next Steps

For more commands for KubeOps Virtual Machines, see [Commandline Operations](Commandline Operations).