Enable Kubevirt Using the PMK Addon Manager During Cluster Creation
Introduction
In this article, we detail how to enable Kubevirt during the creation of the cluster. We have two options here; we can simply deploy the Luigi network plugin operator addon or the Kubevirt addon. Currently, user should enable this from the DU, as UI support for this feature is limited. This is supported from PF9 5.4 < releases.
Instructions
Step 1.
SSH into the CDU. For a DDU, users need to exec into the sunpike-apiserver pod and run the same commands.
Step 2.
After login, if only the Luigi network plugin operator is needed, add the following luigi_addon.json file,
{ "apiVersion": "sunpike.platform9.com/v1alpha2", "kind": "ClusterAddon", "metadata": { "labels": { "sunpike.pf9.io/cluster": "", "type": "luigi" }, "name": "luigi", "namespace": "default" }, "spec": { "clusterID": "", "override": {}, "type": "luigi", "version": "0.3.0", "watch": true }}For KubeVirt, use both the luigi_addon.json noted above, and the kubevirt_addon.json file noted below, as both are required.
{ "apiVersion": "sunpike.platform9.com/v1alpha2", "kind": "ClusterAddon", "metadata": { "labels": { "sunpike.pf9.io/cluster": "", "type": "kubvirt" }, "name": "kubevirt", "namespace": "default" }, "spec": { "clusterID": "", "override": {}, "type": "kubevirt", "version": "0.45.0", "watch": true }}The name of the cluster addon objects need to be in the following format: <clsuuid>-kubevirt or <clsuuid>-luigi The version of luigi should be: 0.3.0
Step 3.
After coping the required files to your DU, run the following command.
sudo kubectl --kubeconfig /etc/sunpike/kubeconfig get clusteraddons.Step 4.
Next, make note of the clusterID of the cluster where the operators need to be deployed.
Step 5.
Open the json files copied above and add the Cluster ID in the “clusterID_” field, and the “_sunpike.pf9.io/cluster” : * “”* and prefix it using the names “_clusterID-kubevirt_” or “_clusterID-luigi_”.
Step 6.
Finally, run the following command for Kubevirt.
sudo kubectl --kubeconfig /etc/sunpike/kubeconfig apply -f kubevirtaddon.json && sudo kubectl --kubeconfig /etc/sunpike/kubeconfig apply -f luigi addon.jsonTo only employ the network plugin operator, run this command.
sudo kubectl --kubeconfig /etc/sunpike/kubeconfig apply -f kubevirt_addon.json